mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-20 02:45:08 +03:00
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>
This commit is contained in:
parent
e4c2c60b57
commit
7536d7d2f8
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue