TextEditor: Fix default context menu

Text editor implementations that did not do anything special with
invoking their context menu, including our plain text editor, only had
Qt's default context menu, without Qt Creator's clipboard history and
BOM actions.

Make the default actions in our custom context menu more similar to Qt's
default actions by adding Undo, Redo and Select All, and not hiding
disabled actions, and use that by default in all text editor
implementations.

Change-Id: Idd5fb276dcd652223d96536dacde8110f9eb576f
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2018-03-21 14:46:14 +01:00
parent deec3fc642
commit 5e6305f346
2 changed files with 24 additions and 15 deletions

View File

@@ -476,6 +476,7 @@ protected:
QTextBlock blockForVisibleRow(int row) const;
QTextBlock blockForVerticalOffset(int offset) const;
bool event(QEvent *e) override;
void contextMenuEvent(QContextMenuEvent *e) override;
void inputMethodEvent(QInputMethodEvent *e) override;
void keyPressEvent(QKeyEvent *e) override;
void wheelEvent(QWheelEvent *e) override;