From 2136813bd6c8ae23167be6c27e2bd28c64ad2023 Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Sat, 14 Jun 2014 13:51:12 +0200 Subject: [PATCH] MainWindow: Add Ctrl+Return shortcut for executing SQL and add tooltips Add the Ctrl+Return shortcut for executing the current SQL again. This needs to be done using C++ code instead of setting it in Qt Designer because setting multiple shortcuts in the latter means defining a key sequence row. Also add the keyboard shortcuts to the tooltips of the buttons as they didn't appear anywhere in the program. --- src/MainWindow.cpp | 5 +++++ src/MainWindow.ui | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index e60b367af..c73ce8dae 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -79,6 +79,11 @@ void MainWindow::init() ui->dbTreeWidget->setColumnHidden(1, true); ui->dbTreeWidget->setColumnWidth(0, 300); + // Add keyboard shortcuts + QList shortcuts = ui->actionExecuteSql->shortcuts(); + shortcuts.push_back(QKeySequence(tr("Ctrl+Return"))); + ui->actionExecuteSql->setShortcuts(shortcuts); + // Create the actions for the recently opened dbs list for(int i = 0; i < MaxRecentFiles; ++i) { recentFileActs[i] = new QAction(this); diff --git a/src/MainWindow.ui b/src/MainWindow.ui index 08be07084..68c61c5b4 100644 --- a/src/MainWindow.ui +++ b/src/MainWindow.ui @@ -1360,6 +1360,9 @@ &Execute SQL + + Execute SQL [F5, Ctrl+Return] + F5 @@ -1402,6 +1405,9 @@ Execute current line + + Execute current line [Ctrl+E] + Ctrl+E