changeset 286:345571aae522

Change + operator to | for defining keyboard shortcuts combinations and use correct keyboard modifiers instead of the actual key definitions for alt/ctrl.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 09 May 2023 11:37:13 +0300
parents 6f5d2028b882
children 0644b1529d13
files src/main.cpp
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.cpp	Tue May 09 11:23:49 2023 +0300
+++ b/src/main.cpp	Tue May 09 11:37:13 2023 +0300
@@ -321,7 +321,7 @@
     setActivePerson(-1);
 
     // Keyboard shortcuts
-    new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this, SLOT(on_button_Quit_clicked()));
+    new QShortcut(QKeySequence(Qt::ControlModifier | Qt::Key_Q), this, SLOT(on_button_Quit_clicked()));
     new QShortcut(QKeySequence(Qt::Key_F10), this, SLOT(on_button_Quit_clicked()));
 
     new QShortcut(QKeySequence(Qt::Key_F5), this, SLOT(on_button_AddPerson_clicked()));
@@ -332,20 +332,20 @@
 
     new QShortcut(QKeySequence(QKeySequence::ZoomIn), this, SLOT(changeUIZoomIn()));
     new QShortcut(QKeySequence(QKeySequence::ZoomOut), this, SLOT(changeUIZoomOut()));
-    new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_0), this, SLOT(changeUIZoomReset()));
-    new QShortcut(QKeySequence(Qt::CTRL + Qt::KeypadModifier + Qt::Key_Plus), this, SLOT(changeUIZoomIn()));
-    new QShortcut(QKeySequence(Qt::CTRL + Qt::KeypadModifier + Qt::Key_Minus), this, SLOT(changeUIZoomOut()));
-    new QShortcut(QKeySequence(Qt::CTRL + Qt::KeypadModifier + Qt::Key_0), this, SLOT(changeUIZoomReset()));
+    new QShortcut(QKeySequence(Qt::ControlModifier | Qt::Key_0), this, SLOT(changeUIZoomReset()));
+    new QShortcut(QKeySequence(Qt::ControlModifier | Qt::KeypadModifier | Qt::Key_Plus), this, SLOT(changeUIZoomIn()));
+    new QShortcut(QKeySequence(Qt::ControlModifier | Qt::KeypadModifier | Qt::Key_Minus), this, SLOT(changeUIZoomOut()));
+    new QShortcut(QKeySequence(Qt::ControlModifier | Qt::KeypadModifier | Qt::Key_0), this, SLOT(changeUIZoomReset()));
 
-    new QShortcut(QKeySequence(Qt::ALT + Qt::Key_Return), this, SLOT(toggleFullScreen()));
+    new QShortcut(QKeySequence(Qt::AltModifier | Qt::Key_Return), this, SLOT(toggleFullScreen()));
 
     new QShortcut(QKeySequence(Qt::Key_PageUp), this, SLOT(selectRowPrev()));
     new QShortcut(QKeySequence(Qt::Key_PageDown), this, SLOT(selectRowNext()));
 
-    new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Return), this, SLOT(focusDebtEdit()));
+    new QShortcut(QKeySequence(Qt::ControlModifier | Qt::Key_Return), this, SLOT(focusDebtEdit()));
 
-    new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_P), this, SLOT(on_button_Print_clicked()));
-    new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_T), this, SLOT(on_button_ViewTransactions_clicked()));
+    new QShortcut(QKeySequence(Qt::ControlModifier | Qt::Key_P), this, SLOT(on_button_Print_clicked()));
+    new QShortcut(QKeySequence(Qt::ControlModifier | Qt::Key_T), this, SLOT(on_button_ViewTransactions_clicked()));
 
     // Check for latest successful backup time
     qint64 threshold = 7;