diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-03-28 11:54:59 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-04-03 08:30:28 +0000 |
commit | 3e044b5054dde5245b65b096da9a393457094f57 (patch) | |
tree | 2c4550c3ee0b8132fc245fe321ad7973c61e0b5a /tools | |
parent | 01bd91e4f93f83953b044dc60363b84b88c93e45 (diff) |
q3dsviewer: Add submenu for profile ui
...and include the scale up/down options. End users of the
viewer need a discoverable way to control this, the engine's
built-in shortcuts are not ideal (plus doing it via widget menus
has the benfit of not having trouble with the QWindow having or not
having focus)
Change-Id: I250a4d5d73dab0b075326ca5d56539368a15b13a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/q3dsviewer/q3dsmainwindow.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/q3dsviewer/q3dsmainwindow.cpp b/tools/q3dsviewer/q3dsmainwindow.cpp index 464bb79..2d2f0d8 100644 --- a/tools/q3dsviewer/q3dsmainwindow.cpp +++ b/tools/q3dsviewer/q3dsmainwindow.cpp @@ -96,10 +96,20 @@ Q3DStudioMainWindow::Q3DStudioMainWindow(Q3DSWindow *view, QWidget *parent) setWindowState(s); }, QKeySequence::FullScreen); - viewMenu->addAction(tr("Toggle in-scene &debug view"), this, [view] { - Q3DSSceneManager *sm = view->engine()->sceneManager(); - sm->setProfileUiVisible(!sm->isProfileUiVisible()); + QMenu *profileSubMenu = new QMenu(tr("&Profile and debug")); + profileSubMenu->addAction(tr("Toggle in-scene &debug view"), this, [view] { + Q3DSEngine *engine = view->engine(); + engine->setProfileUiVisible(!engine->isProfileUiVisible()); }, Qt::Key_F10); + profileSubMenu->addAction(tr("Scale in-scene debug view up"), this, [view] { + Q3DSEngine *engine = view->engine(); + engine->configureProfileUi(engine->profileUiScaleFactor() + 0.2f); + }, QKeySequence(QLatin1String("Ctrl+F10"))); + profileSubMenu->addAction(tr("Scale in-scene debug view down"), this, [view] { + Q3DSEngine *engine = view->engine(); + engine->configureProfileUi(engine->profileUiScaleFactor() - 0.2f); + }, QKeySequence(QLatin1String("Alt+F10"))); + viewMenu->addMenu(profileSubMenu); static const bool enableDebugMenu = qEnvironmentVariableIntValue("Q3DS_DEBUG") >= 1; if (enableDebugMenu) { |