summaryrefslogtreecommitdiffstats
path: root/src/runtime/api/q3dswidget.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2018-03-26 12:58:29 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2018-03-26 14:40:28 +0000
commitcde5e29ca2bf4d37df7af34a07557d6ce14142e8 (patch)
tree7643ba8adf4f076d98fead6f1a1917da78b75121 /src/runtime/api/q3dswidget.cpp
parent40f677db563c66032417044a1e9015b7c42720be (diff)
Q3DSPresentation: add profilingEnabled property
Have a way in the public API to enable the profile UI and to load presentations with QObject tracking enabled. The private API separates these two but for simplicity the public API has a single flag for both. Defaults to disabled which is what applications need in production. During development one can just do profilingEnabled: true. Change-Id: I228d7936897b6891bf4727ade126b4dbda72f73f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/runtime/api/q3dswidget.cpp')
-rw-r--r--src/runtime/api/q3dswidget.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/runtime/api/q3dswidget.cpp b/src/runtime/api/q3dswidget.cpp
index 0b28fb9..c8c0e1c 100644
--- a/src/runtime/api/q3dswidget.cpp
+++ b/src/runtime/api/q3dswidget.cpp
@@ -221,7 +221,16 @@ Q3DSWidgetPrivate::~Q3DSWidgetPrivate()
void Q3DSWidgetPrivate::createEngine()
{
engine = new Q3DSEngine;
- engine->setFlags(Q3DSEngine::WithoutRenderAspect);
+
+ Q3DSEngine::Flags flags = Q3DSEngine::WithoutRenderAspect;
+ if (sourceFlags.testFlag(Q3DSPresentationController::Profiling)) {
+ flags |= Q3DSEngine::EnableProfiling;
+ engine->setProfileUiEnabled(true);
+ } else {
+ engine->setProfileUiEnabled(false);
+ }
+
+ engine->setFlags(flags);
engine->setSurface(q_ptr->window()->windowHandle());
qCDebug(lc3DSWidget, "Created engine %p", engine);
@@ -274,7 +283,7 @@ void Q3DSWidgetPrivate::destroyEngine()
}
}
-void Q3DSWidgetPrivate::handlePresentationSource(const QUrl &newSource)
+void Q3DSWidgetPrivate::handlePresentationSource(const QUrl &newSource, SourceFlags flags)
{
if (newSource == source)
return;
@@ -283,6 +292,7 @@ void Q3DSWidgetPrivate::handlePresentationSource(const QUrl &newSource)
destroyEngine();
source = newSource;
+ sourceFlags = flags;
needsInit = true;
q_ptr->update();