summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Leinonen <tony.leinonen@qt.io>2021-03-25 14:18:06 +0200
committerTony Leinonen <tony.leinonen@qt.io>2021-03-31 05:58:24 +0200
commitabab2a028b3dcae9a10b4f2e7a8e3f83d6e810e6 (patch)
treef53785ceebce733195879d49204cebfa8f171c16
parent0c230118289f150754e1d044952c8007ec92904a (diff)
Add frameDraw signal to QML API
frameDraw was initially only added to C++ API. This patch adds frameDraw to the QML API with updated qmltypes file. Task-number: QT3DS-4224 Change-Id: I215368943e124d0fee1b80806ede841f9bc769ed Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r--src/api/studio3dqml/plugins.qmltypes234
-rw-r--r--src/api/studio3dqml/q3dsrenderer.cpp4
-rw-r--r--src/api/studio3dqml/q3dsrenderer_p.h1
-rw-r--r--src/api/studio3dqml/q3dsstudio3d.cpp2
-rw-r--r--src/api/studio3dqml/q3dsstudio3d_p.h2
5 files changed, 236 insertions, 7 deletions
diff --git a/src/api/studio3dqml/plugins.qmltypes b/src/api/studio3dqml/plugins.qmltypes
index a1d360d..9fe0749 100644
--- a/src/api/studio3dqml/plugins.qmltypes
+++ b/src/api/studio3dqml/plugins.qmltypes
@@ -7,7 +7,7 @@ import QtQuick.tooling 1.2
// 'qmlplugindump -nonrelocatable QtStudio3D.OpenGL 2.5'
Module {
- dependencies: ["QtQuick 2.12"]
+ dependencies: []
Component {
name: "Q3DSDataInput"
prototype: "QObject"
@@ -145,6 +145,10 @@ Module {
name: "shaderCacheExported"
Parameter { name: "success"; type: "bool" }
}
+ Signal {
+ name: "shaderCacheLoadErrors"
+ Parameter { name: "errors"; type: "string" }
+ }
Method {
name: "setSource"
Parameter { name: "source"; type: "QUrl" }
@@ -235,6 +239,19 @@ Module {
revision: 1
Parameter { name: "binaryShaders"; type: "bool" }
}
+ Method {
+ name: "exportShaderCache"
+ revision: 2
+ Parameter { name: "shaderCacheFile"; type: "QUrl" }
+ Parameter { name: "binaryShaders"; type: "bool" }
+ Parameter { name: "compressionLevel"; type: "int" }
+ }
+ Method {
+ name: "exportShaderCache"
+ revision: 2
+ Parameter { name: "binaryShaders"; type: "bool" }
+ Parameter { name: "compressionLevel"; type: "int" }
+ }
}
Component {
name: "Q3DSPresentationItem"
@@ -242,9 +259,10 @@ Module {
prototype: "Q3DSPresentation"
exports: [
"QtStudio3D.OpenGL/Presentation 2.4",
- "QtStudio3D.OpenGL/Presentation 2.5"
+ "QtStudio3D.OpenGL/Presentation 2.5",
+ "QtStudio3D.OpenGL/Presentation 2.7"
]
- exportMetaObjectRevisions: [0, 0]
+ exportMetaObjectRevisions: [0, 1, 2]
Property { name: "qmlChildren"; type: "QObject"; isList: true; isReadonly: true }
Method {
name: "appendQmlChildren"
@@ -328,7 +346,7 @@ Module {
"QtStudio3D.OpenGL/Studio3D 2.4",
"QtStudio3D.OpenGL/Studio3D 2.5"
]
- exportMetaObjectRevisions: [0, 0]
+ exportMetaObjectRevisions: [0, 1]
Enum {
name: "EventIgnoreFlags"
values: {
@@ -346,6 +364,7 @@ Module {
Property { name: "ignoredEvents"; type: "EventIgnoreFlags" }
Property { name: "asyncInit"; revision: 1; type: "bool" }
Signal { name: "frameUpdate" }
+ Signal { name: "frameDraw" }
Signal {
name: "runningChanged"
Parameter { name: "initialized"; type: "bool" }
@@ -374,9 +393,10 @@ Module {
prototype: "QObject"
exports: [
"QtStudio3D.OpenGL/ViewerSettings 2.4",
- "QtStudio3D.OpenGL/ViewerSettings 2.5"
+ "QtStudio3D.OpenGL/ViewerSettings 2.5",
+ "QtStudio3D.OpenGL/ViewerSettings 2.7"
]
- exportMetaObjectRevisions: [0, 0]
+ exportMetaObjectRevisions: [0, 1, 2]
Enum {
name: "ShadeMode"
values: {
@@ -397,7 +417,9 @@ Module {
values: {
"StereoModeMono": 0,
"StereoModeTopBottom": 1,
- "StereoModeLeftRight": 2
+ "StereoModeLeftRight": 2,
+ "StereoModeAnaglyphRedCyan": 3,
+ "StereoModeAnaglyphGreenMagenta": 4
}
}
Property { name: "matteEnabled"; type: "bool" }
@@ -406,6 +428,8 @@ Module {
Property { name: "scaleMode"; type: "ScaleMode" }
Property { name: "stereoMode"; revision: 1; type: "StereoMode" }
Property { name: "stereoEyeSeparation"; revision: 1; type: "double" }
+ Property { name: "stereoProgressiveEnabled"; revision: 2; type: "bool" }
+ Property { name: "skipFramesInterval"; revision: 2; type: "int" }
Signal {
name: "matteEnabledChanged"
Parameter { name: "enabled"; type: "bool" }
@@ -434,6 +458,16 @@ Module {
name: "stereoEyeSeparationChanged"
Parameter { name: "separation"; type: "double" }
}
+ Signal {
+ name: "stereoProgressiveEnabledChanged"
+ revision: 2
+ Parameter { name: "enabled"; type: "bool" }
+ }
+ Signal {
+ name: "skipFramesIntervalChanged"
+ revision: 2
+ Parameter { name: "interval"; type: "int" }
+ }
Method {
name: "setMatteEnabled"
Parameter { name: "enabled"; type: "bool" }
@@ -459,6 +493,16 @@ Module {
Parameter { name: "separation"; type: "double" }
}
Method {
+ name: "setStereoProgressiveEnabled"
+ revision: 2
+ Parameter { name: "enabled"; type: "bool" }
+ }
+ Method {
+ name: "setSkipFramesInterval"
+ revision: 2
+ Parameter { name: "interval"; type: "int" }
+ }
+ Method {
name: "save"
Parameter { name: "group"; type: "string" }
Parameter { name: "organization"; type: "string" }
@@ -504,4 +548,180 @@ Module {
Parameter { type: "bool" }
}
}
+ Component {
+ name: "QQuickItem"
+ defaultProperty: "data"
+ prototype: "QObject"
+ Enum {
+ name: "Flags"
+ values: {
+ "ItemClipsChildrenToShape": 1,
+ "ItemAcceptsInputMethod": 2,
+ "ItemIsFocusScope": 4,
+ "ItemHasContents": 8,
+ "ItemAcceptsDrops": 16
+ }
+ }
+ Enum {
+ name: "TransformOrigin"
+ values: {
+ "TopLeft": 0,
+ "Top": 1,
+ "TopRight": 2,
+ "Left": 3,
+ "Center": 4,
+ "Right": 5,
+ "BottomLeft": 6,
+ "Bottom": 7,
+ "BottomRight": 8
+ }
+ }
+ Property { name: "parent"; type: "QQuickItem"; isPointer: true }
+ Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true }
+ Property { name: "x"; type: "double" }
+ Property { name: "y"; type: "double" }
+ Property { name: "z"; type: "double" }
+ Property { name: "width"; type: "double" }
+ Property { name: "height"; type: "double" }
+ Property { name: "opacity"; type: "double" }
+ Property { name: "enabled"; type: "bool" }
+ Property { name: "visible"; type: "bool" }
+ Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true }
+ Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true }
+ Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true }
+ Property { name: "state"; type: "string" }
+ Property { name: "childrenRect"; type: "QRectF"; isReadonly: true }
+ Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true }
+ Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true }
+ Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true }
+ Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true }
+ Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true }
+ Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true }
+ Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true }
+ Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true }
+ Property { name: "baselineOffset"; type: "double" }
+ Property { name: "clip"; type: "bool" }
+ Property { name: "focus"; type: "bool" }
+ Property { name: "activeFocus"; type: "bool"; isReadonly: true }
+ Property { name: "activeFocusOnTab"; revision: 1; type: "bool" }
+ Property { name: "rotation"; type: "double" }
+ Property { name: "scale"; type: "double" }
+ Property { name: "transformOrigin"; type: "TransformOrigin" }
+ Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true }
+ Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true }
+ Property { name: "smooth"; type: "bool" }
+ Property { name: "antialiasing"; type: "bool" }
+ Property { name: "implicitWidth"; type: "double" }
+ Property { name: "implicitHeight"; type: "double" }
+ Property { name: "containmentMask"; revision: 11; type: "QObject"; isPointer: true }
+ Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true }
+ Signal {
+ name: "childrenRectChanged"
+ Parameter { type: "QRectF" }
+ }
+ Signal {
+ name: "baselineOffsetChanged"
+ Parameter { type: "double" }
+ }
+ Signal {
+ name: "stateChanged"
+ Parameter { type: "string" }
+ }
+ Signal {
+ name: "focusChanged"
+ Parameter { type: "bool" }
+ }
+ Signal {
+ name: "activeFocusChanged"
+ Parameter { type: "bool" }
+ }
+ Signal {
+ name: "activeFocusOnTabChanged"
+ revision: 1
+ Parameter { type: "bool" }
+ }
+ Signal {
+ name: "parentChanged"
+ Parameter { type: "QQuickItem"; isPointer: true }
+ }
+ Signal {
+ name: "transformOriginChanged"
+ Parameter { type: "TransformOrigin" }
+ }
+ Signal {
+ name: "smoothChanged"
+ Parameter { type: "bool" }
+ }
+ Signal {
+ name: "antialiasingChanged"
+ Parameter { type: "bool" }
+ }
+ Signal {
+ name: "clipChanged"
+ Parameter { type: "bool" }
+ }
+ Signal {
+ name: "windowChanged"
+ revision: 1
+ Parameter { name: "window"; type: "QQuickWindow"; isPointer: true }
+ }
+ Signal { name: "containmentMaskChanged"; revision: 11 }
+ Method { name: "update" }
+ Method {
+ name: "grabToImage"
+ revision: 4
+ type: "bool"
+ Parameter { name: "callback"; type: "QJSValue" }
+ Parameter { name: "targetSize"; type: "QSize" }
+ }
+ Method {
+ name: "grabToImage"
+ revision: 4
+ type: "bool"
+ Parameter { name: "callback"; type: "QJSValue" }
+ }
+ Method {
+ name: "contains"
+ type: "bool"
+ Parameter { name: "point"; type: "QPointF" }
+ }
+ Method {
+ name: "mapFromItem"
+ Parameter { type: "QQmlV4Function"; isPointer: true }
+ }
+ Method {
+ name: "mapToItem"
+ Parameter { type: "QQmlV4Function"; isPointer: true }
+ }
+ Method {
+ name: "mapFromGlobal"
+ revision: 7
+ Parameter { type: "QQmlV4Function"; isPointer: true }
+ }
+ Method {
+ name: "mapToGlobal"
+ revision: 7
+ Parameter { type: "QQmlV4Function"; isPointer: true }
+ }
+ Method { name: "forceActiveFocus" }
+ Method {
+ name: "forceActiveFocus"
+ Parameter { name: "reason"; type: "Qt::FocusReason" }
+ }
+ Method {
+ name: "nextItemInFocusChain"
+ revision: 1
+ type: "QQuickItem*"
+ Parameter { name: "forward"; type: "bool" }
+ }
+ Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" }
+ Method {
+ name: "childAt"
+ type: "QQuickItem*"
+ Parameter { name: "x"; type: "double" }
+ Parameter { name: "y"; type: "double" }
+ }
+ }
}
diff --git a/src/api/studio3dqml/q3dsrenderer.cpp b/src/api/studio3dqml/q3dsrenderer.cpp
index 8f0081e..8aa2c21 100644
--- a/src/api/studio3dqml/q3dsrenderer.cpp
+++ b/src/api/studio3dqml/q3dsrenderer.cpp
@@ -237,6 +237,8 @@ bool Q3DSRenderer::initializeRuntime(QOpenGLFramebufferObject *inFbo)
this, &Q3DSRenderer::presentationLoaded);
connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigLoadShaderCacheErrors,
this, &Q3DSRenderer::shaderCacheLoadErrors);
+ connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigFrameDraw,
+ this, &Q3DSRenderer::frameDraw);
int theWidth = inFbo->width();
int theHeight = inFbo->height();
@@ -283,6 +285,8 @@ bool Q3DSRenderer::initializeRuntime(QOpenGLFramebufferObject *inFbo)
this, &Q3DSRenderer::customSignalEmitted);
connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigElementsCreated,
this, &Q3DSRenderer::elementsCreated);
+ connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigFrameDraw,
+ this, &Q3DSRenderer::frameDraw);
connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigMaterialsCreated,
this, &Q3DSRenderer::materialsCreated);
connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigMeshesCreated,
diff --git a/src/api/studio3dqml/q3dsrenderer_p.h b/src/api/studio3dqml/q3dsrenderer_p.h
index 0ba6c31..084163e 100644
--- a/src/api/studio3dqml/q3dsrenderer_p.h
+++ b/src/api/studio3dqml/q3dsrenderer_p.h
@@ -76,6 +76,7 @@ Q_SIGNALS:
void requestResponse(const QString &elementPath, CommandType commandType, void *requestData);
void presentationReady();
void presentationLoaded();
+ void frameDraw();
void customSignalEmitted(const QString &elNmentPath, const QString &name);
void elementsCreated(const QStringList &elementPaths, const QString &error);
void materialsCreated(const QStringList &materialNames, const QString &error);
diff --git a/src/api/studio3dqml/q3dsstudio3d.cpp b/src/api/studio3dqml/q3dsstudio3d.cpp
index 815535c..3b0ac0d 100644
--- a/src/api/studio3dqml/q3dsstudio3d.cpp
+++ b/src/api/studio3dqml/q3dsstudio3d.cpp
@@ -449,6 +449,8 @@ QQuickFramebufferObject::Renderer *Q3DSStudio3D::createRenderer() const
this, &Q3DSStudio3D::presentationLoaded);
connect(renderer, &Q3DSRenderer::presentationReady,
this, &Q3DSStudio3D::presentationReady);
+ connect(renderer, &Q3DSRenderer::frameDraw,
+ this, &Q3DSStudio3D::frameDraw);
return renderer;
}
diff --git a/src/api/studio3dqml/q3dsstudio3d_p.h b/src/api/studio3dqml/q3dsstudio3d_p.h
index 1fd32fe..905ea35 100644
--- a/src/api/studio3dqml/q3dsstudio3d_p.h
+++ b/src/api/studio3dqml/q3dsstudio3d_p.h
@@ -65,6 +65,7 @@ class Q3DSStudio3D : public QQuickFramebufferObject
Q_PROPERTY(bool asyncInit READ asyncInit WRITE setAsyncInit NOTIFY asyncInitChanged REVISION 1)
public:
+
enum EventIgnoreFlag {
EnableAllEvents = 0,
IgnoreMouseEvents = 0x01,
@@ -104,6 +105,7 @@ public:
Q_SIGNALS:
void frameUpdate();
+ void frameDraw();
void runningChanged(bool initialized);
void errorChanged(const QString &error);
void ignoredEventsChanged();