summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2017-06-23 13:30:29 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2017-06-26 07:12:23 +0000
commit681d60143f1bf96f3cf61581a3917e810b26f9f5 (patch)
treef3841852702bc05ea2d721d34e090d1fbb1eaebb
parent2123aebf652212d962a8bb57db4ea6ac20f7f840 (diff)
downloadqt-creator-681d60143f1bf96f3cf61581a3917e810b26f9f5.tar.gz
QmlDesigner: Be more specific with overriding shortcuts
We have to be less aggressive when ovveriden keys, so that shortcuts like strg+shift+up/down still work. Task-number: QTCREATORBUG-18361 Change-Id: I2f4819f627f8820533b603575e853aec7d91171d Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
-rw-r--r--src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp b/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp
index d82fabfaf0..591164138f 100644
--- a/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp
+++ b/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp
@@ -175,14 +175,18 @@ void TextEditorWidget::setBlockCurserSelectionSyncronisation(bool b)
bool TextEditorWidget::eventFilter( QObject *, QEvent *event)
{
- static std::vector<int> overrideKeys = { Qt::Key_Delete, Qt::Key_Backspace, Qt::Key_Left,
- Qt::Key_Right, Qt::Key_Up, Qt::Key_Down, Qt::Key_Insert,
+ static std::vector<int> overrideKeys = { Qt::Key_Delete, Qt::Key_Backspace, Qt::Key_Insert,
Qt::Key_Escape };
static std::vector<QKeySequence> overrideSequences = { QKeySequence::SelectAll, QKeySequence::Cut,
- QKeySequence::Copy, QKeySequence::Delete,
- QKeySequence::Paste, QKeySequence::Undo,
- QKeySequence::Redo, QKeySequence(Qt::CTRL + Qt::ALT) };
+ QKeySequence::Copy, QKeySequence::Delete,
+ QKeySequence::Paste, QKeySequence::Undo,
+ QKeySequence::Redo, QKeySequence(Qt::CTRL + Qt::ALT),
+ QKeySequence(Qt::Key_Left + Qt::CTRL),
+ QKeySequence(Qt::Key_Right + Qt::CTRL),
+ QKeySequence(Qt::Key_Up + Qt::CTRL),
+ QKeySequence(Qt::Key_Down + Qt::CTRL)
+ };
if (event->type() == QEvent::ShortcutOverride) {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);