diff options
author | Antti Määttä <antti.maatta@qt.io> | 2019-02-27 09:43:47 +0200 |
---|---|---|
committer | Antti Määttä <antti.maatta@qt.io> | 2019-03-12 12:11:15 +0000 |
commit | 9e497c6c136925d3235cfacd61f3d8a2ad7defa5 (patch) | |
tree | d584b65302788a1f95dd926844bd66fb79e7cc35 | |
parent | baf98fd6f90d85328b2998f38ec6dcc0139fe58f (diff) |
Add revision to delayed loading
Change-Id: I37575940d36e4af6f5c22655fe051d2f2ad83fbc
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/imports/studio3d/plugin.cpp | 1 | ||||
-rw-r--r-- | src/imports/studio3d/plugins.qmltypes | 30 | ||||
-rw-r--r-- | src/runtime/api/q3dspresentation.h | 8 | ||||
-rw-r--r-- | tests/manual/dynamicloadingapp/main.qml | 2 |
4 files changed, 34 insertions, 7 deletions
diff --git a/src/imports/studio3d/plugin.cpp b/src/imports/studio3d/plugin.cpp index 9470abb..3129168 100644 --- a/src/imports/studio3d/plugin.cpp +++ b/src/imports/studio3d/plugin.cpp @@ -73,6 +73,7 @@ public: { qmlRegisterType<Q3DSStudio3DItem>(uri, 2, 0, "Studio3D"); qmlRegisterType<Q3DSPresentationItem>(uri, 2, 0, "Presentation"); + qmlRegisterRevision<Q3DSPresentation, 3>(uri, 2, 3); qmlRegisterType<Q3DSSubPresentationSettings>(uri, 2, 0, "SubPresentationSettings"); qmlRegisterType<Q3DSViewerSettings>(uri, 2, 0, "ViewerSettings"); diff --git a/src/imports/studio3d/plugins.qmltypes b/src/imports/studio3d/plugins.qmltypes index d29725a..b1e15e0 100644 --- a/src/imports/studio3d/plugins.qmltypes +++ b/src/imports/studio3d/plugins.qmltypes @@ -22,6 +22,8 @@ Module { exportMetaObjectRevisions: [0] Property { name: "name"; type: "string" } Property { name: "value"; type: "QVariant" } + Property { name: "max"; type: "float" } + Property { name: "min"; type: "float" } Method { name: "setName" Parameter { name: "name"; type: "string" } @@ -30,6 +32,14 @@ Module { name: "setValue" Parameter { name: "value"; type: "QVariant" } } + Method { + name: "setMin" + Parameter { name: "min"; type: "float" } + } + Method { + name: "setMax" + Parameter { name: "max"; type: "float" } + } } Component { name: "Q3DSElement" @@ -180,6 +190,7 @@ Module { Property { name: "profilingEnabled"; type: "bool" } Property { name: "profileUiVisible"; type: "bool" } Property { name: "profileUiScale"; type: "float" } + Property { name: "delayedLoading"; revision: 3; type: "bool" } Signal { name: "customSignalEmitted" Parameter { name: "elementPath"; type: "string" } @@ -197,6 +208,7 @@ Module { Parameter { name: "index"; type: "int" } Parameter { name: "name"; type: "string" } } + Signal { name: "delayedLoadingChanged"; revision: 3 } Method { name: "reload" } Method { name: "setDataInputValue" @@ -230,6 +242,16 @@ Module { Parameter { name: "wrap"; type: "bool" } } Method { + name: "preloadSlide" + revision: 3 + Parameter { name: "elementPath"; type: "string" } + } + Method { + name: "unloadSlide" + revision: 3 + Parameter { name: "elementPath"; type: "string" } + } + Method { name: "getAttribute" type: "QVariant" Parameter { name: "elementPath"; type: "string" } @@ -241,13 +263,17 @@ Module { Parameter { name: "attributeName"; type: "string" } Parameter { name: "value"; type: "QVariant" } } + Method { name: "getDataInputs"; type: "QVariantList" } } Component { name: "Q3DSPresentationItem" defaultProperty: "qmlChildren" prototype: "Q3DSPresentation" - exports: ["QtStudio3D/Presentation 2.0"] - exportMetaObjectRevisions: [0] + exports: [ + "QtStudio3D/Presentation 2.0", + "QtStudio3D/Presentation 2.3" + ] + exportMetaObjectRevisions: [0, 3] Property { name: "qmlChildren"; type: "QObject"; isList: true; isReadonly: true } Method { name: "appendQmlChildren" diff --git a/src/runtime/api/q3dspresentation.h b/src/runtime/api/q3dspresentation.h index 9aaffa5..a2e48d1 100644 --- a/src/runtime/api/q3dspresentation.h +++ b/src/runtime/api/q3dspresentation.h @@ -59,7 +59,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 delayedLoading READ isDelayedLoadingEnabled WRITE setDelayedLoading NOTIFY delayedLoadingChanged) + Q_PROPERTY(bool delayedLoading READ isDelayedLoadingEnabled WRITE setDelayedLoading NOTIFY delayedLoadingChanged REVISION 3) public: explicit Q3DSPresentation(QObject *parent = nullptr); @@ -94,8 +94,8 @@ public: Q_INVOKABLE void goToSlide(const QString &elementPath, int index); Q_INVOKABLE void goToSlide(const QString &elementPath, bool next, bool wrap); - Q_INVOKABLE void preloadSlide(const QString &elementPath); - Q_INVOKABLE void unloadSlide(const QString &elementPath); + Q_REVISION(3) Q_INVOKABLE void preloadSlide(const QString &elementPath); + Q_REVISION(3) Q_INVOKABLE void unloadSlide(const QString &elementPath); Q_INVOKABLE QVariant getAttribute(const QString &elementPath, const QString &attributeName); Q_INVOKABLE void setAttribute(const QString &elementPath, const QString &attributeName, const QVariant &value); @@ -129,7 +129,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 delayedLoadingChanged(); + Q_REVISION(3) void delayedLoadingChanged(); protected: Q3DSPresentation(Q3DSPresentationPrivate &dd, QObject *parent); diff --git a/tests/manual/dynamicloadingapp/main.qml b/tests/manual/dynamicloadingapp/main.qml index 2c91968..0e056a5 100644 --- a/tests/manual/dynamicloadingapp/main.qml +++ b/tests/manual/dynamicloadingapp/main.qml @@ -49,7 +49,7 @@ ****************************************************************************/ import QtQuick 2.7 -import QtStudio3D 2.0 +import QtStudio3D 2.3 Item { id: mainview |