From 8d80f263b09eb39076680bab7219dc061caf3d5b Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Mon, 5 Apr 2021 23:21:15 +0800 Subject: [PATCH] feat: add default shortcuts for some actions --- app/actionmanager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/actionmanager.cpp b/app/actionmanager.cpp index c87523d..f914f77 100644 --- a/app/actionmanager.cpp +++ b/app/actionmanager.cpp @@ -46,7 +46,7 @@ void ActionManager::retranslateUi(MainWindow *mainWindow) actionZoomIn->setText(QCoreApplication::translate("MainWindow", "Zoom in", nullptr)); actionZoomOut->setText(QCoreApplication::translate("MainWindow", "Zoom out", nullptr)); - actionHorizontalFlip->setText(QCoreApplication::translate("MainWindow", "Horizontal flip", nullptr)); + actionHorizontalFlip->setText(QCoreApplication::translate("MainWindow", "Flip &Horizontally", nullptr)); actionCopyPixmap->setText(QCoreApplication::translate("MainWindow", "Copy P&ixmap", nullptr)); actionCopyFilePath->setText(QCoreApplication::translate("MainWindow", "Copy &File Path", nullptr)); actionPaste->setText(QCoreApplication::translate("MainWindow", "&Paste", nullptr)); @@ -63,6 +63,12 @@ void ActionManager::setupShortcuts() { actionZoomIn->setShortcut(QKeySequence(QKeySequence::ZoomIn)); actionZoomOut->setShortcut(QKeySequence(QKeySequence::ZoomOut)); + actionHorizontalFlip->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R)); + actionCopyPixmap->setShortcut(QKeySequence(QKeySequence::Copy)); + actionPaste->setShortcut(QKeySequence::Paste); + actionHelp->setShortcut(QKeySequence::HelpContents); + actionSettings->setShortcut(QKeySequence::Preferences); + actionProperties->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_I)); actionQuitApp->setShortcuts({ QKeySequence(Qt::Key_Space), QKeySequence(Qt::Key_Escape)