diff options
author | Jake Petroules <jake.petroules@petroules.com> | 2014-07-11 02:39:36 -0400 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2014-07-11 15:09:42 +0200 |
commit | d51dddb4aefa72b2c3a662bb112c41c024a2288c (patch) | |
tree | 0177dc433e1ee22b006346cd83d3f6c6d48055b7 | |
parent | 0736a8d9e46b27a16b3677689f2d4cdfea56c05f (diff) |
Make qbs-config-ui menu more cross platform.
Use QKeySequence for cross-platform shortcuts,
and set the menu role for the Exit/Quit item.
Change-Id: I8143f562efdba1cb315c4e4762baf3472165122a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rw-r--r-- | src/app/config-ui/mainwindow.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/app/config-ui/mainwindow.cpp b/src/app/config-ui/mainwindow.cpp index 6a49f55d7..5636f76ec 100644 --- a/src/app/config-ui/mainwindow.cpp +++ b/src/app/config-ui/mainwindow.cpp @@ -56,10 +56,10 @@ MainWindow::MainWindow(const QString &settingsDir, QWidget *parent) QMenu * const viewMenu = menuBar()->addMenu(tr("&View")); QAction * const reloadAction = new QAction(tr("&Reload"), this); - reloadAction->setShortcut(Qt::CTRL | Qt::Key_R); + reloadAction->setShortcut(QKeySequence::Refresh); connect(reloadAction, SIGNAL(triggered()), SLOT(reloadSettings())); QAction * const saveAction = new QAction(tr("&Save"), this); - saveAction->setShortcut(Qt::CTRL | Qt::Key_S); + saveAction->setShortcut(QKeySequence::Save); connect(saveAction, SIGNAL(triggered()), SLOT(saveSettings())); QAction * const expandAllAction = new QAction(tr("&Expand All"), this); expandAllAction->setShortcut(Qt::CTRL | Qt::Key_E); @@ -68,7 +68,8 @@ MainWindow::MainWindow(const QString &settingsDir, QWidget *parent) collapseAllAction->setShortcut(Qt::CTRL | Qt::Key_O); connect(collapseAllAction, SIGNAL(triggered()), SLOT(collapseAll())); QAction * const exitAction = new QAction(tr("E&xit"), this); - exitAction->setShortcut(Qt::CTRL | Qt::Key_Q); + exitAction->setShortcut(QKeySequence::Quit); + exitAction->setMenuRole(QAction::QuitRole); connect(exitAction, SIGNAL(triggered()), SLOT(exit())); fileMenu->addAction(reloadAction); |