diff options
Diffstat (limited to 'src/runtime/api')
-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 |
3 files changed, 43 insertions, 1 deletions
diff --git a/src/runtime/api/q3dspresentation.cpp b/src/runtime/api/q3dspresentation.cpp index 6c502e1..3a8e37e 100644 --- a/src/runtime/api/q3dspresentation.cpp +++ b/src/runtime/api/q3dspresentation.cpp @@ -169,6 +169,38 @@ 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 @@ -616,6 +648,9 @@ 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 085ce89..898eef8 100644 --- a/src/runtime/api/q3dspresentation.h +++ b/src/runtime/api/q3dspresentation.h @@ -56,6 +56,7 @@ 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); @@ -73,6 +74,9 @@ 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); @@ -109,6 +113,7 @@ 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 b056c0c..63c0f9a 100644 --- a/src/runtime/api/q3dspresentation_p.h +++ b/src/runtime/api/q3dspresentation_p.h @@ -59,7 +59,8 @@ public: void initializePresentationController(Q3DSEngine *engine, Q3DSPresentation *presentation); enum SourceFlag { - Profiling = 0x01 + Profiling = 0x01, + AwakenTheDragon = 0x02 }; Q_DECLARE_FLAGS(SourceFlags, SourceFlag) @@ -119,6 +120,7 @@ public: bool profileUiVisible = false; float profileUiScale = 1.0f; QVector<Q3DSInlineQmlSubPresentation *> inlineQmlSubPresentations; + bool dragonRenderAspectEnabled = false; }; QT_END_NAMESPACE |