diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/qmldesigner/qmldesignerconstants.h | 1 | ||||
-rw-r--r-- | src/plugins/qmldesigner/shortcutmanager.cpp | 20 |
2 files changed, 10 insertions, 11 deletions
diff --git a/src/plugins/qmldesigner/qmldesignerconstants.h b/src/plugins/qmldesigner/qmldesignerconstants.h index 427fdba5ad..7ee8f2e42f 100644 --- a/src/plugins/qmldesigner/qmldesignerconstants.h +++ b/src/plugins/qmldesigner/qmldesignerconstants.h @@ -33,6 +33,7 @@ namespace QmlDesigner { namespace Constants { +const char C_BACKSPACE[] = "QmlDesigner.Backspace"; const char C_DELETE[] = "QmlDesigner.Delete"; // Context diff --git a/src/plugins/qmldesigner/shortcutmanager.cpp b/src/plugins/qmldesigner/shortcutmanager.cpp index 4f3b9c0604..23fa8a8787 100644 --- a/src/plugins/qmldesigner/shortcutmanager.cpp +++ b/src/plugins/qmldesigner/shortcutmanager.cpp @@ -115,11 +115,19 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex //Edit Menu + command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_BACKSPACE, qmlDesignerFormEditorContext); + command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_BACKSPACE, qmlDesignerNavigatorContext); + command->setDefaultKeySequence(QKeySequence(Qt::Key_Backspace)); + command->setAttribute(Core::Command::CA_Hide); // don't show delete in other modes + if (Utils::HostOsInfo::isMacHost()) + editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE); + command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerFormEditorContext); command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerNavigatorContext); command->setDefaultKeySequence(QKeySequence::Delete); command->setAttribute(Core::Command::CA_Hide); // don't show delete in other modes - editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE); + if (!Utils::HostOsInfo::isMacHost()) + editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE); command = Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerFormEditorContext); command = Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerNavigatorContext); @@ -159,16 +167,6 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex viewsMenu->addAction(command); command = Core::ActionManager::registerAction(&m_hideSidebarsAction, Core::Constants::TOGGLE_SIDEBAR, qmlDesignerMainContext); - - if (Utils::HostOsInfo::isMacHost()) { - // add second shortcut to trigger delete - QAction *deleteAction = new QAction(this); - deleteAction->setShortcut(QKeySequence(QLatin1String("Backspace"))); - connect(deleteAction, - SIGNAL(triggered()), - &m_deleteAction, - SIGNAL(triggered())); - } } void ShortCutManager::updateActions(Core::IEditor* currentEditor) |