summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaj Grönholm <kaj.gronholm@qt.io>2018-12-13 15:22:44 +0200
committerTomi Korpipää <tomi.korpipaa@qt.io>2019-01-09 07:46:19 +0000
commit9f92fcc309b10d2dc40e639c753588b8a5646a95 (patch)
tree5a3edc7234a6939c5d10e3087389429752aca958
parent7ffe0aff86fc78cb6c673f1b6041bfacd4e481b6 (diff)
Add missing shortcuts to viewer
CTRL+Q to quit and ESC to exit when in fullscreen mode. Task-number: QT3DS-2390 Change-Id: Ib307f9d906fc0857a3a49ea945762c6396c8a2b6 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
-rw-r--r--tools/q3dsviewer/q3dsmainwindow.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/q3dsviewer/q3dsmainwindow.cpp b/tools/q3dsviewer/q3dsmainwindow.cpp
index adcc5fa..6e16c21 100644
--- a/tools/q3dsviewer/q3dsmainwindow.cpp
+++ b/tools/q3dsviewer/q3dsmainwindow.cpp
@@ -116,6 +116,7 @@ Q3DStudioMainWindow::Q3DStudioMainWindow(Q3DSWindow *view, Q3DSRemoteDeploymentM
fileMenu->addAction(reloadAction);
addAction(reloadAction);
QAction *exitAction = fileMenu->addAction(tr("E&xit"), this, &QWidget::close, QKeySequence::Quit);
+ exitAction->setShortcut(QKeySequence(tr("Ctrl+Q")));
addAction(exitAction);
QMenu *viewMenu = menuBar()->addMenu(tr("&View"));
@@ -333,6 +334,16 @@ Q3DStudioMainWindow::Q3DStudioMainWindow(Q3DSWindow *view, Q3DSRemoteDeploymentM
addAction(fullscreenAction);
viewMenu->addAction(fullscreenAction);
+ // Action for ESC fullscreen exit
+ QAction *exitFullscreenAction = new QAction();
+ exitFullscreenAction->setShortcut(Qt::Key_Escape);
+ connect(exitFullscreenAction, &QAction::triggered, [this, fullscreenAction]() {
+ if (windowState().testFlag(Qt::WindowFullScreen)) {
+ fullscreenAction->trigger();
+ }
+ });
+ addAction(exitFullscreenAction);
+
QMenu *profileSubMenu = new QMenu(tr("&Profile and Debug"));
QAction *showDebugView = profileSubMenu->addAction(tr("Toggle in-scene &debug view"), this, [view] {
Q3DSEngine *engine = view->engine();