Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_gui_widgets_qtextedit.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4//! [0]
5void MyTextEdit::contextMenuEvent(QContextMenuEvent *event)
6{
7 QMenu *menu = createStandardContextMenu();
8 menu->addAction(tr("My Menu Item"));
9 //...
10 menu->exec(event->globalPos());
11 delete menu;
12}
13//! [0]
14
15
16//! [1]
17edit->textCursor().insertText(text);
18//! [1]
19
20
21//! [2]
22edit->textCursor().insertHtml(fragment);
23//! [2]