diff options
author | Svenn-Arne Dragly <s@dragly.com> | 2018-11-19 22:15:35 +0100 |
---|---|---|
committer | Andy Nichols <andy.nichols@qt.io> | 2018-11-27 09:06:58 +0000 |
commit | 11ec833a0d21b60abbcfad0d1224fbe7ccad0682 (patch) | |
tree | c90b70990cab2d446ca481c9e3ce84333f04024f | |
parent | 96a5c4a6faa0bf5c554cd10f7196ecc22127c8fa (diff) |
Dragon: Replace public API to enable Dragon with environment variable
This API will not make any sense in the future, when there is only one
aspect to choose from. The Dragon render aspect can in the meantime
be enabled by setting the environment variable Q3DS_DRAGON to a non-zero
number (like 1).
Change-Id: I9e95347a1eb9d75bbeaa6f813260ce5e718230b4
Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io>
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
-rw-r--r-- | src/imports/studio3d/q3dsstudio3ditem.cpp | 2 | ||||
-rw-r--r-- | src/runtime/api/q3dspresentation.cpp | 35 | ||||
-rw-r--r-- | src/runtime/api/q3dspresentation.h | 5 | ||||
-rw-r--r-- | src/runtime/api/q3dspresentation_p.h | 4 | ||||
-rw-r--r-- | src/runtime/api/q3dssurfaceviewer.cpp | 2 | ||||
-rw-r--r-- | src/runtime/api/q3dswidget.cpp | 2 | ||||
-rw-r--r-- | tools/q3dsviewer/main.cpp | 2 |
7 files changed, 5 insertions, 47 deletions
diff --git a/src/imports/studio3d/q3dsstudio3ditem.cpp b/src/imports/studio3d/q3dsstudio3ditem.cpp index b4652e2..e5d94bb 100644 --- a/src/imports/studio3d/q3dsstudio3ditem.cpp +++ b/src/imports/studio3d/q3dsstudio3ditem.cpp @@ -427,7 +427,7 @@ void Q3DSStudio3DItem::createEngine() if (m_sourceFlags.testFlag(Q3DSPresentationController::Profiling)) flags |= Q3DSEngine::EnableProfiling; - if (m_sourceFlags.testFlag(Q3DSPresentationController::AwakenTheDragon)) + if (qEnvironmentVariableIntValue("Q3DS_DRAGON")) flags |= Q3DSEngine::AwakenTheDragon; m_engine->setFlags(flags); diff --git a/src/runtime/api/q3dspresentation.cpp b/src/runtime/api/q3dspresentation.cpp index db2f77a..102f714 100644 --- a/src/runtime/api/q3dspresentation.cpp +++ b/src/runtime/api/q3dspresentation.cpp @@ -169,38 +169,6 @@ void Q3DSPresentation::setProfilingEnabled(bool enable) } /*! - \property Q3DSPresentation::dragonRenderAspectEnabled - - When enabled, the new, experimental Qt3D render aspect - (codenamed "Dragon") is enabled. - This render aspect will replace the original render aspect - in a future release. - This property will be deprecated once the aspect has been - replaced. - - The default value is \c false. - - \note Changing the value after the presentation has been loaded - has no effect for the already loaded presentation. Therefore the - changing of this property must happen before calling setSource(). -*/ -bool Q3DSPresentation::isDragonRenderAspectEnabled() const -{ - Q_D(const Q3DSPresentation); - return d->dragonRenderAspectEnabled; -} - -void Q3DSPresentation::setDragonRenderAspectEnabled(bool dragonRenderAspectEnabled) -{ - Q_D(Q3DSPresentation); - if (d->dragonRenderAspectEnabled == dragonRenderAspectEnabled) - return; - - d->dragonRenderAspectEnabled = dragonRenderAspectEnabled; - emit dragonRenderAspectEnabledChanged(); -} - -/*! \property Q3DSPresentation::profileUiVisible When this property is \c{true}, the interactive statistics and profile @@ -665,9 +633,6 @@ Q3DSPresentationController::SourceFlags Q3DSPresentationPrivate::sourceFlags() c if (profiling) flags |= Q3DSPresentationController::Profiling; - if (dragonRenderAspectEnabled) - flags |= Q3DSPresentationController::AwakenTheDragon; - return flags; } diff --git a/src/runtime/api/q3dspresentation.h b/src/runtime/api/q3dspresentation.h index 3ee3aaf..a04a226 100644 --- a/src/runtime/api/q3dspresentation.h +++ b/src/runtime/api/q3dspresentation.h @@ -57,7 +57,6 @@ class Q3DSV_EXPORT Q3DSPresentation : public QObject Q_PROPERTY(bool profilingEnabled READ isProfilingEnabled WRITE setProfilingEnabled NOTIFY profilingEnabledChanged) Q_PROPERTY(bool profileUiVisible READ isProfileUiVisible WRITE setProfileUiVisible NOTIFY profileUiVisibleChanged) Q_PROPERTY(float profileUiScale READ profileUiScale WRITE setProfileUiScale NOTIFY profileUiScaleChanged) - Q_PROPERTY(bool dragonRenderAspectEnabled READ isDragonRenderAspectEnabled WRITE setDragonRenderAspectEnabled NOTIFY dragonRenderAspectEnabledChanged) public: explicit Q3DSPresentation(QObject *parent = nullptr); @@ -75,9 +74,6 @@ public: float profileUiScale() const; void setProfileUiScale(float scale); - bool isDragonRenderAspectEnabled() const; - void setDragonRenderAspectEnabled(bool dragonRenderAspectEnabled); - Q_INVOKABLE void reload(); Q_INVOKABLE void setDataInputValue(const QString &name, const QVariant &value); @@ -116,7 +112,6 @@ Q_SIGNALS: void customSignalEmitted(const QString &elementPath, const QString &name); void slideEntered(const QString &elementPath, int index, const QString &name); void slideExited(const QString &elementPath, int index, const QString &name); - void dragonRenderAspectEnabledChanged(); protected: Q3DSPresentation(Q3DSPresentationPrivate &dd, QObject *parent); diff --git a/src/runtime/api/q3dspresentation_p.h b/src/runtime/api/q3dspresentation_p.h index 56859a5..eab60dd 100644 --- a/src/runtime/api/q3dspresentation_p.h +++ b/src/runtime/api/q3dspresentation_p.h @@ -59,8 +59,7 @@ public: void initializePresentationController(Q3DSEngine *engine, Q3DSPresentation *presentation); enum SourceFlag { - Profiling = 0x01, - AwakenTheDragon = 0x02 + Profiling = 0x01 }; Q_DECLARE_FLAGS(SourceFlags, SourceFlag) @@ -122,7 +121,6 @@ public: bool profileUiVisible = false; float profileUiScale = 1.0f; QVector<Q3DSInlineQmlSubPresentation *> inlineQmlSubPresentations; - bool dragonRenderAspectEnabled = false; }; QT_END_NAMESPACE diff --git a/src/runtime/api/q3dssurfaceviewer.cpp b/src/runtime/api/q3dssurfaceviewer.cpp index 4a759cc..60bc162 100644 --- a/src/runtime/api/q3dssurfaceviewer.cpp +++ b/src/runtime/api/q3dssurfaceviewer.cpp @@ -501,7 +501,7 @@ bool Q3DSSurfaceViewerPrivate::createEngine() Q3DSEngine::Flags flags = Q3DSEngine::WithoutRenderAspect; if (sourceFlags.testFlag(Q3DSPresentationController::Profiling)) flags |= Q3DSEngine::EnableProfiling; - if (sourceFlags.testFlag(Q3DSPresentationController::AwakenTheDragon)) + if (qEnvironmentVariableIntValue("Q3DS_DRAGON")) flags |= Q3DSEngine::AwakenTheDragon; engine->setFlags(flags); diff --git a/src/runtime/api/q3dswidget.cpp b/src/runtime/api/q3dswidget.cpp index 6eded69..352218b 100644 --- a/src/runtime/api/q3dswidget.cpp +++ b/src/runtime/api/q3dswidget.cpp @@ -354,7 +354,7 @@ void Q3DSWidgetPrivate::createEngine() Q3DSEngine::Flags flags = Q3DSEngine::WithoutRenderAspect; if (sourceFlags.testFlag(Q3DSPresentationController::Profiling)) flags |= Q3DSEngine::EnableProfiling; - if (sourceFlags.testFlag(Q3DSPresentationController::AwakenTheDragon)) + if (qEnvironmentVariableIntValue("Q3DS_DRAGON")) flags |= Q3DSEngine::AwakenTheDragon; engine->setFlags(flags); diff --git a/tools/q3dsviewer/main.cpp b/tools/q3dsviewer/main.cpp index d123277..1f2d491 100644 --- a/tools/q3dsviewer/main.cpp +++ b/tools/q3dsviewer/main.cpp @@ -119,7 +119,7 @@ int main(int argc, char *argv[]) flags |= Q3DSEngine::Force4xMSAA; if (!cmdLineParser.isSet(noProfOption)) flags |= Q3DSEngine::EnableProfiling; - if (cmdLineParser.isSet(dragonRendererOption)) + if (cmdLineParser.isSet(dragonRendererOption) || qEnvironmentVariableIntValue("Q3DS_DRAGON")) flags |= Q3DSEngine::AwakenTheDragon; QScopedPointer<Q3DSEngine> engine(new Q3DSEngine); |