summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Korpipaa <tomi.korpipaa@qt.io>2019-09-30 09:10:45 +0300
committerTomi Korpipaa <tomi.korpipaa@qt.io>2019-10-01 13:57:23 +0300
commit247e38fcb8c08e8af3e221e32ab0d776cf758da5 (patch)
treea508d0a9f868e53a81df57550474e897d61ee3f1
parent2902563f2f97fe18e3a547e72e66ee57d443df4f (diff)
Bump qml module version
Revision new APIs: asyncInit, shaderCache, exportShaderCache, stereMode, stereoEyeSeparation, textureId, and addImageProvider. Also fixed missing array in qt_attribution.json Task-number: QT3DS-3963 Change-Id: I3fc6ac38ff6f524a5268ad4706f4d0edcc0af6f3 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--examples/studio3d/dynamicloading/main.qml2
-rw-r--r--src/api/studio3d/q3dspresentation.cpp10
-rw-r--r--src/api/studio3d/q3dspresentation.h7
-rw-r--r--src/api/studio3d/q3dsviewersettings.cpp15
-rw-r--r--src/api/studio3d/q3dsviewersettings.h4
-rw-r--r--src/api/studio3dqml/plugins.qmltypes85
-rw-r--r--src/api/studio3dqml/q3dsplugin.cpp5
-rw-r--r--src/api/studio3dqml/q3dsstudio3d.cpp1
-rw-r--r--src/api/studio3dqml/q3dsstudio3d_p.h2
-rw-r--r--src/foundation/qt_attribution.json5
-rw-r--r--tools/viewer/qml/main.qml2
11 files changed, 119 insertions, 19 deletions
diff --git a/examples/studio3d/dynamicloading/main.qml b/examples/studio3d/dynamicloading/main.qml
index daa8a94..be2ab9b 100644
--- a/examples/studio3d/dynamicloading/main.qml
+++ b/examples/studio3d/dynamicloading/main.qml
@@ -49,7 +49,7 @@
****************************************************************************/
import QtQuick 2.12
-import QtStudio3D.OpenGL 2.4
+import QtStudio3D.OpenGL 2.5
Item {
id: mainview
diff --git a/src/api/studio3d/q3dspresentation.cpp b/src/api/studio3d/q3dspresentation.cpp
index 84a925a..05e2e8e 100644
--- a/src/api/studio3d/q3dspresentation.cpp
+++ b/src/api/studio3d/q3dspresentation.cpp
@@ -613,6 +613,7 @@ void Q3DSPresentation::unloadSlide(const QString &elementPath)
/*!
\qmlmethod Presentation::exportShaderCache(url shaderCacheFile, bool binaryShaders)
+ \since QtStudio3D.OpenGL 2.5
Writes the shaders currently in use to the file specified by \a shaderCacheFile URL.
If \a binaryShaders property is \c{true}, precompiled shaders are exported. Otherwise,
@@ -631,6 +632,7 @@ void Q3DSPresentation::unloadSlide(const QString &elementPath)
\sa shaderCacheFile, shaderCacheExported
*/
/*!
+ \since Qt 3D Studio 2.5
Writes the shaders currently in use to the file specified by \a shaderCacheFile URL.
If \a binaryShaders property is \c{true}, precompiled shaders are exported. Otherwise,
the shader source code is exported.
@@ -657,6 +659,7 @@ void Q3DSPresentation::exportShaderCache(const QUrl &shaderCacheFile, bool binar
/*!
\qmlmethod Presentation::exportShaderCache(bool binaryShaders)
+ \since QtStudio3D.OpenGL 2.5
Exports the shaders currently in use and dumps the resulting cache encoded with base64 into
stderr. This function is provided as a means to extract the shader cache from environments
@@ -680,6 +683,7 @@ void Q3DSPresentation::exportShaderCache(const QUrl &shaderCacheFile, bool binar
\sa shaderCacheFile, shaderCacheExported
*/
/*!
+ \since Qt 3D Studio 2.5
Exports the shaders currently in use and dumps the resulting cache encoded with base64 into
stderr. This function is provided as a means to extract the shader cache from environments
without a writable disk. The base64 output needs to be converted back to binary
@@ -707,6 +711,7 @@ void Q3DSPresentation::exportShaderCache(bool binaryShaders)
/*!
\qmlproperty url Presentation::shaderCacheFile
+ \since QtStudio3D.OpenGL 2.5
Specifies the shader cache file to be used for initial shader initialization.
This property value must be set before the presentation is shown.
@@ -722,6 +727,7 @@ void Q3DSPresentation::exportShaderCache(bool binaryShaders)
\sa exportShaderCache(), shaderCacheExport
*/
/*!
+ \since Qt 3D Studio 2.5
Specifies the shader cache file to be used for initial shader initialization.
This property value must be set before the presentation is shown.
Using cached shaders improves presentation initialization speed.
@@ -750,6 +756,7 @@ void Q3DSPresentation::setShaderCacheFile(const QUrl &fileName)
/*!
\qmlsignal Presentation::shaderCacheExported(bool success)
+ \since QtStudio3D.OpenGL 2.5
Emitted when a shader cache export is completed. The parameter \a success indicates whether
or not the export was successful.
@@ -759,6 +766,7 @@ void Q3DSPresentation::setShaderCacheFile(const QUrl &fileName)
/*!
\fn Q3DSPresentation::shaderCacheExported(bool success)
+ \since Qt 3D Studio 2.5
Emitted when a shader cache export is completed. The parameter \a success indicates whether
or not the export was successful.
@@ -941,6 +949,7 @@ void Q3DSPresentation::setAttribute(const QString &elementPath, const QString &a
}
/*!
+ \since Qt 3D Studio 2.5
Sets the \a provider to use for images requested via the \e
image: url scheme, with host \a providerId. The runtime
takes ownership of \a provider.
@@ -959,6 +968,7 @@ void Q3DSPresentation::addImageProvider(const QString &providerId, QQmlImageProv
}
/*!
+ \since Qt 3D Studio 2.5
Returns the OpenGL texture id associated with a layer or an image specified
by \a elementPath.
diff --git a/src/api/studio3d/q3dspresentation.h b/src/api/studio3d/q3dspresentation.h
index 6822ab0..5210a29 100644
--- a/src/api/studio3d/q3dspresentation.h
+++ b/src/api/studio3d/q3dspresentation.h
@@ -59,7 +59,7 @@ class Q_STUDIO3D_EXPORT Q3DSPresentation : public QObject
Q_PROPERTY(QStringList createdElements READ createdElements NOTIFY elementsCreated)
Q_PROPERTY(QStringList createdMaterials READ createdMaterials NOTIFY materialsCreated)
Q_PROPERTY(QStringList createdMeshes READ createdMeshes NOTIFY meshesCreated)
- Q_PROPERTY(QUrl shaderCacheFile READ shaderCacheFile WRITE setShaderCacheFile NOTIFY shaderCacheFileChanged )
+ Q_PROPERTY(QUrl shaderCacheFile READ shaderCacheFile WRITE setShaderCacheFile NOTIFY shaderCacheFileChanged REVISION 1)
public:
explicit Q3DSPresentation(QObject *parent = nullptr);
@@ -92,8 +92,9 @@ public:
Q_INVOKABLE void preloadSlide(const QString &elementPath);
Q_INVOKABLE void unloadSlide(const QString &elementPath);
- Q_INVOKABLE void exportShaderCache(const QUrl &shaderCacheFile, bool binaryShaders);
- Q_INVOKABLE void exportShaderCache(bool binaryShaders);
+ Q_REVISION(1) Q_INVOKABLE void exportShaderCache(const QUrl &shaderCacheFile,
+ bool binaryShaders);
+ Q_REVISION(1) Q_INVOKABLE void exportShaderCache(bool binaryShaders);
QUrl shaderCacheFile() const;
// Input event handlers
diff --git a/src/api/studio3d/q3dsviewersettings.cpp b/src/api/studio3d/q3dsviewersettings.cpp
index ead4eb9..eb62c32 100644
--- a/src/api/studio3d/q3dsviewersettings.cpp
+++ b/src/api/studio3d/q3dsviewersettings.cpp
@@ -231,7 +231,7 @@ void Q3DSViewerSettings::setScaleMode(Q3DSViewerSettings::ScaleMode mode)
/*!
\qmlproperty enumeration ViewerSettings::stereoMode
- \since Qt 3D Studio 2.5
+ \since QtStudio3D.OpenGL 2.5
Specifies the stereo mode. The default value \c is StereoModeMono where the
view is rendered normally, as suitable for 2D displays. Other available modes
@@ -272,6 +272,19 @@ void Q3DSViewerSettings::setStereoMode(Q3DSViewerSettings::StereoMode mode)
}
/*!
+ \qmlproperty real ViewerSettings::stereoEyeSeparation
+
+ \since QtStudio3D.OpenGL 2.5
+
+ Specifies the eye (camera) separation of stereo rendering.
+ Value is the amount left and right eye cameras move in x-coordinate
+ values away from center. Bigger separation increases the 3D effect.
+ Optimal value depends on viewed presentation.
+
+ This has only effect when stereo mode is set to something else than
+ default \c{StereoModeMono}.
+ */
+/*!
\property Q3DSViewerSettings::stereoEyeSeparation
\since Qt 3D Studio 2.5
diff --git a/src/api/studio3d/q3dsviewersettings.h b/src/api/studio3d/q3dsviewersettings.h
index 0d78e1b..1099e35 100644
--- a/src/api/studio3d/q3dsviewersettings.h
+++ b/src/api/studio3d/q3dsviewersettings.h
@@ -50,8 +50,8 @@ class Q_STUDIO3D_EXPORT Q3DSViewerSettings : public QObject
Q_PROPERTY(QColor matteColor READ matteColor WRITE setMatteColor NOTIFY matteColorChanged)
Q_PROPERTY(bool showRenderStats READ isShowRenderStats WRITE setShowRenderStats NOTIFY showRenderStatsChanged)
Q_PROPERTY(ScaleMode scaleMode READ scaleMode WRITE setScaleMode NOTIFY scaleModeChanged)
- Q_PROPERTY(StereoMode stereoMode READ stereoMode WRITE setStereoMode NOTIFY stereoModeChanged)
- Q_PROPERTY(double stereoEyeSeparation READ stereoEyeSeparation WRITE setStereoEyeSeparation NOTIFY stereoEyeSeparationChanged)
+ Q_PROPERTY(StereoMode stereoMode READ stereoMode WRITE setStereoMode NOTIFY stereoModeChanged REVISION 1)
+ Q_PROPERTY(double stereoEyeSeparation READ stereoEyeSeparation WRITE setStereoEyeSeparation NOTIFY stereoEyeSeparationChanged REVISION 1)
public:
enum ShadeMode {
diff --git a/src/api/studio3dqml/plugins.qmltypes b/src/api/studio3dqml/plugins.qmltypes
index bb8f052..a1d360d 100644
--- a/src/api/studio3dqml/plugins.qmltypes
+++ b/src/api/studio3dqml/plugins.qmltypes
@@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable QtStudio3D.OpenGL 2.4'
+// 'qmlplugindump -nonrelocatable QtStudio3D.OpenGL 2.5'
Module {
dependencies: ["QtQuick 2.12"]
@@ -25,6 +25,11 @@ Module {
Method {
name: "setValue"
Parameter { name: "value"; type: "QVariant" }
+ Parameter { name: "force"; type: "bool" }
+ }
+ Method {
+ name: "setValue"
+ Parameter { name: "value"; type: "QVariant" }
}
Method {
name: "metadata"
@@ -85,6 +90,7 @@ Module {
Property { name: "createdElements"; type: "QStringList"; isReadonly: true }
Property { name: "createdMaterials"; type: "QStringList"; isReadonly: true }
Property { name: "createdMeshes"; type: "QStringList"; isReadonly: true }
+ Property { name: "shaderCacheFile"; revision: 1; type: "QUrl" }
Signal {
name: "variantListChanged"
Parameter { name: "variantList"; type: "QStringList" }
@@ -131,6 +137,14 @@ Module {
Parameter { name: "meshNames"; type: "QStringList" }
Parameter { name: "error"; type: "string" }
}
+ Signal {
+ name: "shaderCacheFileChanged"
+ Parameter { name: "fileName"; type: "QUrl" }
+ }
+ Signal {
+ name: "shaderCacheExported"
+ Parameter { name: "success"; type: "bool" }
+ }
Method {
name: "setSource"
Parameter { name: "source"; type: "QUrl" }
@@ -184,13 +198,17 @@ Module {
name: "setDataInputValue"
Parameter { name: "name"; type: "string" }
Parameter { name: "value"; type: "QVariant" }
- Parameter { name: "valueRole"; type: "Q3DSDataInput::ValueRole" }
+ Parameter { name: "force"; type: "bool" }
}
Method {
name: "setDataInputValue"
Parameter { name: "name"; type: "string" }
Parameter { name: "value"; type: "QVariant" }
}
+ Method {
+ name: "setShaderCacheFile"
+ Parameter { name: "fileName"; type: "QUrl" }
+ }
Method { name: "getDataInputs"; type: "QVariantList" }
Method {
name: "getDataInputs"
@@ -206,13 +224,27 @@ Module {
name: "unloadSlide"
Parameter { name: "elementPath"; type: "string" }
}
+ Method {
+ name: "exportShaderCache"
+ revision: 1
+ Parameter { name: "shaderCacheFile"; type: "QUrl" }
+ Parameter { name: "binaryShaders"; type: "bool" }
+ }
+ Method {
+ name: "exportShaderCache"
+ revision: 1
+ Parameter { name: "binaryShaders"; type: "bool" }
+ }
}
Component {
name: "Q3DSPresentationItem"
defaultProperty: "qmlChildren"
prototype: "Q3DSPresentation"
- exports: ["QtStudio3D.OpenGL/Presentation 2.4"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtStudio3D.OpenGL/Presentation 2.4",
+ "QtStudio3D.OpenGL/Presentation 2.5"
+ ]
+ exportMetaObjectRevisions: [0, 0]
Property { name: "qmlChildren"; type: "QObject"; isList: true; isReadonly: true }
Method {
name: "appendQmlChildren"
@@ -292,8 +324,11 @@ Module {
name: "Q3DSStudio3D"
defaultProperty: "data"
prototype: "QQuickFramebufferObject"
- exports: ["QtStudio3D.OpenGL/Studio3D 2.4"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtStudio3D.OpenGL/Studio3D 2.4",
+ "QtStudio3D.OpenGL/Studio3D 2.5"
+ ]
+ exportMetaObjectRevisions: [0, 0]
Enum {
name: "EventIgnoreFlags"
values: {
@@ -309,6 +344,7 @@ Module {
Property { name: "viewerSettings"; type: "Q3DSViewerSettings"; isReadonly: true; isPointer: true }
Property { name: "error"; type: "string"; isReadonly: true }
Property { name: "ignoredEvents"; type: "EventIgnoreFlags" }
+ Property { name: "asyncInit"; revision: 1; type: "bool" }
Signal { name: "frameUpdate" }
Signal {
name: "runningChanged"
@@ -320,6 +356,10 @@ Module {
}
Signal { name: "presentationReady" }
Signal { name: "presentationLoaded" }
+ Signal {
+ name: "asyncInitChanged"
+ Parameter { name: "enabled"; type: "bool" }
+ }
Method { name: "reset" }
}
Component {
@@ -332,8 +372,11 @@ Module {
Component {
name: "Q3DSViewerSettings"
prototype: "QObject"
- exports: ["QtStudio3D.OpenGL/ViewerSettings 2.4"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtStudio3D.OpenGL/ViewerSettings 2.4",
+ "QtStudio3D.OpenGL/ViewerSettings 2.5"
+ ]
+ exportMetaObjectRevisions: [0, 0]
Enum {
name: "ShadeMode"
values: {
@@ -349,10 +392,20 @@ Module {
"ScaleModeCenter": 2
}
}
+ Enum {
+ name: "StereoMode"
+ values: {
+ "StereoModeMono": 0,
+ "StereoModeTopBottom": 1,
+ "StereoModeLeftRight": 2
+ }
+ }
Property { name: "matteEnabled"; type: "bool" }
Property { name: "matteColor"; type: "QColor" }
Property { name: "showRenderStats"; type: "bool" }
Property { name: "scaleMode"; type: "ScaleMode" }
+ Property { name: "stereoMode"; revision: 1; type: "StereoMode" }
+ Property { name: "stereoEyeSeparation"; revision: 1; type: "double" }
Signal {
name: "matteEnabledChanged"
Parameter { name: "enabled"; type: "bool" }
@@ -373,6 +426,14 @@ Module {
name: "scaleModeChanged"
Parameter { name: "mode"; type: "ScaleMode" }
}
+ Signal {
+ name: "stereoModeChanged"
+ Parameter { name: "mode"; type: "StereoMode" }
+ }
+ Signal {
+ name: "stereoEyeSeparationChanged"
+ Parameter { name: "separation"; type: "double" }
+ }
Method {
name: "setMatteEnabled"
Parameter { name: "enabled"; type: "bool" }
@@ -390,6 +451,14 @@ Module {
Parameter { name: "mode"; type: "ScaleMode" }
}
Method {
+ name: "setStereoMode"
+ Parameter { name: "mode"; type: "StereoMode" }
+ }
+ Method {
+ name: "setStereoEyeSeparation"
+ Parameter { name: "separation"; type: "double" }
+ }
+ Method {
name: "save"
Parameter { name: "group"; type: "string" }
Parameter { name: "organization"; type: "string" }
diff --git a/src/api/studio3dqml/q3dsplugin.cpp b/src/api/studio3dqml/q3dsplugin.cpp
index 640018f..8a01141 100644
--- a/src/api/studio3dqml/q3dsplugin.cpp
+++ b/src/api/studio3dqml/q3dsplugin.cpp
@@ -57,6 +57,11 @@ void Q3DSPlugin::registerTypes(const char *uri)
qmlRegisterType<Q3DSSubPresentationSettings>(uri, 2, 4, "SubPresentationSettings");
qmlRegisterType<Q3DSDataInput>(uri, 2, 4, "DataInput");
qmlRegisterType<Q3DSDataOutput>(uri, 2, 4, "DataOutput");
+
+ // 2.5
+ qmlRegisterType<Q3DSStudio3D, 1>(uri, 2, 5, "Studio3D");
+ qmlRegisterType<Q3DSViewerSettings, 1>(uri, 2, 5, "ViewerSettings");
+ qmlRegisterType<Q3DSPresentationItem, 1>(uri, 2, 5, "Presentation");
}
QT_END_NAMESPACE
diff --git a/src/api/studio3dqml/q3dsstudio3d.cpp b/src/api/studio3dqml/q3dsstudio3d.cpp
index 4cb0850..f1e383f 100644
--- a/src/api/studio3dqml/q3dsstudio3d.cpp
+++ b/src/api/studio3dqml/q3dsstudio3d.cpp
@@ -214,6 +214,7 @@ void Q3DSStudio3D::setError(const QString &error)
/*!
\qmlproperty bool Studio3D::asyncInit
+ \since QtStudio3D.OpenGL 2.5
If set to \c{true}, indicates that renderer initialization should be done asynchronously
in a helper thread. This improves UI responsiveness while initialization is happening,
diff --git a/src/api/studio3dqml/q3dsstudio3d_p.h b/src/api/studio3dqml/q3dsstudio3d_p.h
index 963474c..1fd32fe 100644
--- a/src/api/studio3dqml/q3dsstudio3d_p.h
+++ b/src/api/studio3dqml/q3dsstudio3d_p.h
@@ -62,7 +62,7 @@ class Q3DSStudio3D : public QQuickFramebufferObject
Q_PROPERTY(Q3DSViewerSettings *viewerSettings READ viewerSettings CONSTANT)
Q_PROPERTY(QString error READ error NOTIFY errorChanged)
Q_PROPERTY(EventIgnoreFlags ignoredEvents READ ignoredEvents WRITE setIgnoredEvents NOTIFY ignoredEventsChanged)
- Q_PROPERTY(bool asyncInit READ asyncInit WRITE setAsyncInit NOTIFY asyncInitChanged)
+ Q_PROPERTY(bool asyncInit READ asyncInit WRITE setAsyncInit NOTIFY asyncInitChanged REVISION 1)
public:
enum EventIgnoreFlag {
diff --git a/src/foundation/qt_attribution.json b/src/foundation/qt_attribution.json
index 537d8be..46b571c 100644
--- a/src/foundation/qt_attribution.json
+++ b/src/foundation/qt_attribution.json
@@ -1,3 +1,4 @@
+[
{
"Id": "convertutf",
"Name": "ConvertUTF",
@@ -7,8 +8,7 @@
"License": "Other",
"LicenseFile": "LICENSE_CONVERTUTF.TXT",
"Copyright": "Copyright 2001-2004 Unicode, Inc."
-}
-,
+},
{
"Id": "socket",
"Name": "Socket",
@@ -20,3 +20,4 @@
"LicenseFile": "LICENCE_SOCKET.TXT",
"Copyright": "Copyright (C) 2004-2013 Diego Nehab."
}
+]
diff --git a/tools/viewer/qml/main.qml b/tools/viewer/qml/main.qml
index 1a59739..a53c0df 100644
--- a/tools/viewer/qml/main.qml
+++ b/tools/viewer/qml/main.qml
@@ -31,7 +31,7 @@ import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Dialogs 1.2
import Qt3DStudioViewer 1.0
-import QtStudio3D.OpenGL 2.4
+import QtStudio3D.OpenGL 2.5
import QtQuick.Window 2.2
ApplicationWindow {