diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-03-22 21:30:04 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-03-24 10:33:54 +0200 |
commit | 7536d7d2f8a369f4603633a19b0c19a1583f96a1 (patch) | |
tree | be6fcdfaedf84b5a4accd719785e0357385d4ec3 /src | |
parent | e4c2c60b57bbda7bf1f1bb5b6d4a2e36bc9d5635 (diff) |
qcam: main_window: Add shortcuts for toolbar actions
Allow triggering toolbar actions with keyboard shortcuts.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qcam/main_window.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp index 9f008a57..6afb7714 100644 --- a/src/qcam/main_window.cpp +++ b/src/qcam/main_window.cpp @@ -99,6 +99,7 @@ int MainWindow::createToolbars() action = toolbar_->addAction(QIcon::fromTheme("application-exit", QIcon(":x-circle.svg")), "Quit"); + action->setShortcut(Qt::CTRL | Qt::Key_Q); connect(action, &QAction::triggered, this, &MainWindow::quit); /* Camera selection. */ @@ -120,12 +121,14 @@ int MainWindow::createToolbars() action = toolbar_->addAction(iconPlay_, "Start Capture"); action->setCheckable(true); + action->setShortcut(Qt::Key_Space); connect(action, &QAction::toggled, this, &MainWindow::toggleCapture); startStopAction_ = action; action = toolbar_->addAction(QIcon::fromTheme("document-save-as", QIcon(":save.svg")), "Save As..."); + action->setShortcut(QKeySequence::SaveAs); connect(action, &QAction::triggered, this, &MainWindow::saveImageAs); return 0; |