summaryrefslogtreecommitdiffstats
path: root/src/imports/studio3d/q3dsstudio3ditem.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2018-03-26 13:29:51 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2018-03-26 14:41:18 +0000
commit6ade5518e91bcbeb76fdd89e32a8cec812aef35e (patch)
tree08f197b4382ccd0c1b631f17a71459576ee67818 /src/imports/studio3d/q3dsstudio3ditem.cpp
parent90846a54c9646905fd120813479606f8efa55566 (diff)
Add API for toggling profile UI and disable the implicit toggles
In the viewer profiling is enabled by default and the built-in toggles (F10, backtick, double double click) or the menu item (when using widgets) can be used to bring up the UI. For applications none of these is ideal. Instead, provide a Q3DSPresentation property that can be used to toggle the UI. Therefore, an application will typically do profilingEnabled: true on its Presentation and then set profileUiVisible to true when it wants to. This way we are not tied to the sometimes not ideal keyboard and mouse shortcuts in real applications. Rename Q3DSEngine::profileUiEnabled to autoToggleProfileUi because that's what it really is. It merely enables or disables the built-in keyboard and mouse shortcuts for toggling, nothing more. Change-Id: If49ed7bc2575b7e81c2f6101dba307a639c3c011 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/imports/studio3d/q3dsstudio3ditem.cpp')
-rw-r--r--src/imports/studio3d/q3dsstudio3ditem.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/imports/studio3d/q3dsstudio3ditem.cpp b/src/imports/studio3d/q3dsstudio3ditem.cpp
index 1005580..d964b4a 100644
--- a/src/imports/studio3d/q3dsstudio3ditem.cpp
+++ b/src/imports/studio3d/q3dsstudio3ditem.cpp
@@ -176,14 +176,11 @@ void Q3DSStudio3DItem::createEngine()
// Rendering will be driven manually from the Quick render thread via the QRenderAspect.
// We create the render aspect ourselves on the Quick render thread.
Q3DSEngine::Flags flags = Q3DSEngine::WithoutRenderAspect;
- if (m_sourceFlags.testFlag(Q3DSPresentationController::Profiling)) {
+ if (m_sourceFlags.testFlag(Q3DSPresentationController::Profiling))
flags |= Q3DSEngine::EnableProfiling;
- m_engine->setProfileUiEnabled(true);
- } else {
- m_engine->setProfileUiEnabled(false);
- }
m_engine->setFlags(flags);
+ m_engine->setAutoToggleProfileUi(false); // up to the app to control this via the API instead
// Use our QQmlEngine for QML subpresentations and behavior scripts.
QQmlEngine *qmlEngine = QQmlEngine::contextForObject(this)->engine();