feat: add default shortcuts for some actions

This commit is contained in:
Gary Wang 2021-04-05 23:21:15 +08:00
parent 114e7359cd
commit 8d80f263b0

View File

@ -46,7 +46,7 @@ void ActionManager::retranslateUi(MainWindow *mainWindow)
actionZoomIn->setText(QCoreApplication::translate("MainWindow", "Zoom in", nullptr)); actionZoomIn->setText(QCoreApplication::translate("MainWindow", "Zoom in", nullptr));
actionZoomOut->setText(QCoreApplication::translate("MainWindow", "Zoom out", 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)); actionCopyPixmap->setText(QCoreApplication::translate("MainWindow", "Copy P&ixmap", nullptr));
actionCopyFilePath->setText(QCoreApplication::translate("MainWindow", "Copy &File Path", nullptr)); actionCopyFilePath->setText(QCoreApplication::translate("MainWindow", "Copy &File Path", nullptr));
actionPaste->setText(QCoreApplication::translate("MainWindow", "&Paste", nullptr)); actionPaste->setText(QCoreApplication::translate("MainWindow", "&Paste", nullptr));
@ -63,6 +63,12 @@ void ActionManager::setupShortcuts()
{ {
actionZoomIn->setShortcut(QKeySequence(QKeySequence::ZoomIn)); actionZoomIn->setShortcut(QKeySequence(QKeySequence::ZoomIn));
actionZoomOut->setShortcut(QKeySequence(QKeySequence::ZoomOut)); 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({ actionQuitApp->setShortcuts({
QKeySequence(Qt::Key_Space), QKeySequence(Qt::Key_Space),
QKeySequence(Qt::Key_Escape) QKeySequence(Qt::Key_Escape)