From patchwork Mon Mar 23 14:21:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3251 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2629262C5A for ; Mon, 23 Mar 2020 15:22:21 +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 AA55E308 for ; Mon, 23 Mar 2020 15:22:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1584973340; bh=fUPxOR4GjouFYTsBGilSKWyclN8t7TYqptysdhj8FHk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=u31SKwUMQa28B1EHDaMIcW8/GQunDChnkdVijY+7SSAynvkXLGAP6TWLv8cOnNrL2 3ZY2QVem1dWBkHBcb30owlhB/1AnUhk+3lXqe8WNCU9MknucK4dXifRUteudGG4T5f y+CbR9S58Ms45ye3j36BQ6KlZrfqPO0MvsTHrhD0= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 23 Mar 2020 16:21:52 +0200 Message-Id: <20200323142205.28342-9-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200323142205.28342-1-laurent.pinchart@ideasonboard.com> References: <20200323142205.28342-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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 14:22:24 -0000 Allow triggering toolbar actions with keyboard shortcuts. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- 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 14baf7ec4c2e..18aae07ffce7 100644 --- a/src/qcam/main_window.cpp +++ b/src/qcam/main_window.cpp @@ -100,6 +100,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. */ @@ -118,12 +119,14 @@ int MainWindow::createToolbars() QIcon(":play-circle.svg")), "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(Qt::CTRL | Qt::Key_S); connect(action, &QAction::triggered, this, &MainWindow::saveImageAs); return 0;