diff options
-rw-r--r-- | qt-ui/mainwindow.cpp | 6 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 4 | ||||
-rw-r--r-- | qt-ui/usermanual.cpp | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index d94ec8561..cda6e349d 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -502,11 +502,11 @@ void MainWindow::on_actionYearlyStatistics_triggered() yearlyStats->setMinimumWidth(600); yearlyStats->setWindowTitle(tr("Yearly Statistics")); yearlyStats->setWindowIcon(QIcon(":subsurface-icon")); - QShortcut *closeKey = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), yearlyStats); + QShortcut *closeKey = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), yearlyStats, 0, 0, Qt::WidgetShortcut); connect(closeKey, SIGNAL(activated()), yearlyStats, SLOT(close())); - closeKey = new QShortcut(QKeySequence(Qt::Key_Escape), yearlyStats); + closeKey = new QShortcut(QKeySequence(Qt::Key_Escape), yearlyStats, 0, 0, Qt::WidgetShortcut); connect(closeKey, SIGNAL(activated()), yearlyStats, SLOT(close())); - QShortcut *quitKey = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), yearlyStats); + QShortcut *quitKey = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), yearlyStats, 0, 0, Qt::WidgetShortcut); connect(quitKey, SIGNAL(activated()), this, SLOT(close())); } /* problem here is that without more MainWindow variables or a separate YearlyStatistics diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index ccdbe1888..54af27ba3 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -1044,8 +1044,10 @@ void ProfileWidget2::disconnectTemporaryConnections() disconnect(plannerModel, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SLOT(pointsRemoved(const QModelIndex &, int, int))); - Q_FOREACH (QAction *action, actionsForKeys.values()) + Q_FOREACH (QAction *action, actionsForKeys.values()) { action->setShortcut(QKeySequence()); + action->setShortcutContext(Qt::WidgetShortcut); + } } void ProfileWidget2::pointInserted(const QModelIndex &parent, int start, int end) diff --git a/qt-ui/usermanual.cpp b/qt-ui/usermanual.cpp index 60c94382f..82691594c 100644 --- a/qt-ui/usermanual.cpp +++ b/qt-ui/usermanual.cpp @@ -18,12 +18,12 @@ UserManual::UserManual(QWidget *parent) : QMainWindow(parent), QAction *actionShowSearch = new QAction(this); actionShowSearch->setShortcut(Qt::CTRL + Qt::Key_F); - actionShowSearch->setShortcutContext(Qt::WindowShortcut); + actionShowSearch->setShortcutContext(Qt::WidgetShortcut); addAction(actionShowSearch); QAction *actionHideSearch = new QAction(this); actionHideSearch->setShortcut(Qt::Key_Escape); - actionHideSearch->setShortcutContext(Qt::WindowShortcut); + actionHideSearch->setShortcutContext(Qt::WidgetShortcut); addAction(actionHideSearch); setWindowTitle(tr("User Manual")); |