From patchwork Mon Mar 23 17:35:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3274 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2859662C9A for ; Mon, 23 Mar 2020 18:36:19 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BD199308 for ; Mon, 23 Mar 2020 18:36:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1584984978; bh=Xracp1fiNf22uYy2CLIxNfwSgQxuNQd7bvIJzTbxX38=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lx51jEm3x2b06XzP44GINNRt47UGAEXJym+RZwnV+AYGO70vQA8pkuz+085b2i3wi F4GM6rXG6VyVh/NX1U3QPNxa4PdOoECkVR5hAoCWlZmyaak0iv3j2T7582G/tNESvi i5D0ms6ZQrAJ4lRRAy33BO5lB5JMdcKtcyzJE1tE= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 23 Mar 2020 19:35:46 +0200 Message-Id: <20200323173559.21109-9-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200323173559.21109-1-laurent.pinchart@ideasonboard.com> References: <20200323173559.21109-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 08/21] qcam: main_window: Add shortcuts for toolbar actions X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2020 17:36:22 -0000 Allow triggering toolbar actions with keyboard shortcuts. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- Changes since v1: - Use QKeySequence::SaveAs --- src/qcam/main_window.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp index 9f008a57f9a1..6afb7714c457 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;