forked from qt-creator/qt-creator
QmlDesigner: Fix ESC issues
We do not want to switch to the editor whenever pressing ESCAPE. Using shortcut override does not work for QQuickWidget. Therefore we register our own action and disable it. Change-Id: I399265a5254767d2825edf3fe823dd35177a6ce5 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
f70d1359c0
commit
5da074f95a
@@ -133,6 +133,8 @@ Controls.TextField {
|
||||
event.accepted = true
|
||||
if (textField.completionActive) {
|
||||
listView.model = null
|
||||
} else {
|
||||
textField.rejected()
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -218,6 +218,11 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
viewsMenu->addAction(command);
|
||||
|
||||
/* Registering disabled action for Escape, because Qt Quick does not support shortcut overrides. */
|
||||
command = Core::ActionManager::registerAction(&m_escapeAction, Core::Constants::S_RETURNTOEDITOR, qmlDesignerMainContext);
|
||||
command->setDefaultKeySequence(QKeySequence(Qt::Key_Escape));
|
||||
m_escapeAction.setEnabled(false);
|
||||
|
||||
Core::ActionManager::registerAction(&m_hideSidebarsAction, Core::Constants::TOGGLE_SIDEBAR, qmlDesignerMainContext);
|
||||
}
|
||||
|
||||
|
@@ -91,6 +91,7 @@ private:
|
||||
QAction m_toggleLeftSidebarAction;
|
||||
QAction m_toggleRightSidebarAction;
|
||||
QAction m_goIntoComponentAction;
|
||||
QAction m_escapeAction;
|
||||
};
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
Reference in New Issue
Block a user