summaryrefslogtreecommitdiffstats
path: root/src/quick3d
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2017-05-21 08:26:29 +0100
committerSean Harmer <sean.harmer@kdab.com>2017-05-21 08:26:29 +0100
commit9f8fc3717508a6b8045f65e6c820692fb67dc450 (patch)
treead426afcaa91f61ecd669fbc416838f108554771 /src/quick3d
parenta830a9365832fd52c1849768543a64c55e4cee0a (diff)
parentcd9059a22604307f483764db134d51b15c540758 (diff)
Merge branch '5.9' into dev
Conflicts: .qmake.conf src/core/qscene.cpp src/plugins/sceneparsers/gltf/gltfimporter.cpp src/plugins/sceneparsers/gltfexport/gltfexporter.cpp src/render/texture/gltexture.cpp Change-Id: I7bde0fc0177eae252fef01cc43725fcf69c13a80
Diffstat (limited to 'src/quick3d')
-rw-r--r--src/quick3d/imports/animation/plugins.qmltypes670
-rw-r--r--src/quick3d/imports/animation/qt3dquick3danimationplugin.cpp3
-rw-r--r--src/quick3d/imports/core/plugins.qmltypes82
-rw-r--r--src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp5
-rw-r--r--src/quick3d/imports/core/qt3dquick3dcoreplugin.h1
-rw-r--r--src/quick3d/imports/extras/plugins.qmltypes394
-rw-r--r--src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp2
-rw-r--r--src/quick3d/imports/input/plugins.qmltypes86
-rw-r--r--src/quick3d/imports/input/qt3dquick3dinputplugin.cpp2
-rw-r--r--src/quick3d/imports/logic/plugins.qmltypes27
-rw-r--r--src/quick3d/imports/render/plugins.qmltypes438
-rw-r--r--src/quick3d/imports/scene3d/scene3ditem.cpp2
-rw-r--r--src/quick3d/imports/scene3d/scene3ditem_p.h2
-rw-r--r--src/quick3d/imports/scene3d/scene3drenderer.cpp18
-rw-r--r--src/quick3d/quick3d/qt3dquick_global.cpp7
-rw-r--r--src/quick3d/quick3d/qt3dquick_global_p.h1
-rw-r--r--src/quick3d/quick3danimation/items/items.pri6
-rw-r--r--src/quick3d/quick3danimation/items/quick3dvertexblendanimation.cpp104
-rw-r--r--src/quick3d/quick3danimation/items/quick3dvertexblendanimation_p.h93
-rw-r--r--src/quick3d/quick3dextras/qt3dquickwindow.cpp80
-rw-r--r--src/quick3d/quick3dextras/qt3dquickwindow.h14
-rw-r--r--src/quick3d/quick3dextras/qt3dquickwindow_p.h86
-rw-r--r--src/quick3d/quick3dextras/quick3dextras.pro1
-rw-r--r--src/quick3d/quick3dscene2d/items/qscene2d.cpp203
-rw-r--r--src/quick3d/quick3dscene2d/items/qscene2d.h22
-rw-r--r--src/quick3d/quick3dscene2d/items/qscene2d_p.h7
-rw-r--r--src/quick3d/quick3dscene2d/items/scene2d.cpp108
-rw-r--r--src/quick3d/quick3dscene2d/items/scene2d_p.h2
-rw-r--r--src/quick3d/quick3dscene2d/items/scene2dmanager.cpp141
-rw-r--r--src/quick3d/quick3dscene2d/items/scene2dmanager_p.h15
30 files changed, 2022 insertions, 600 deletions
diff --git a/src/quick3d/imports/animation/plugins.qmltypes b/src/quick3d/imports/animation/plugins.qmltypes
new file mode 100644
index 000000000..08879ee52
--- /dev/null
+++ b/src/quick3d/imports/animation/plugins.qmltypes
@@ -0,0 +1,670 @@
+import QtQuick.tooling 1.2
+
+// This file describes the plugin-supplied types contained in the library.
+// It is used for QML tooling purposes only.
+//
+// This file was auto-generated by:
+// 'qmlplugindump -nonrelocatable Qt3D.Animation 2.9'
+
+Module {
+ dependencies: ["QtQuick 2.8"]
+ Component {
+ name: "Qt3DAnimation::Animation::Quick::Quick3DChannelMapper"
+ defaultProperty: "mappings"
+ prototype: "Qt3DAnimation::QChannelMapper"
+ exports: ["Qt3D.Animation/ChannelMapper 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property {
+ name: "mappings"
+ type: "Qt3DAnimation::QChannelMapping"
+ isList: true
+ isReadonly: true
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAbstractAnimation"
+ prototype: "QObject"
+ exports: ["Qt3D.Animation/AbstractAnimation 2.9"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "AnimationType"
+ values: {
+ "KeyframeAnimation": 1,
+ "MorphingAnimation": 2,
+ "VertexBlendAnimation": 3
+ }
+ }
+ Property { name: "animationName"; type: "string" }
+ Property { name: "animationType"; type: "QAbstractAnimation::AnimationType"; isReadonly: true }
+ Property { name: "position"; type: "float" }
+ Property { name: "duration"; type: "float"; isReadonly: true }
+ Signal {
+ name: "animationNameChanged"
+ Parameter { name: "name"; type: "string" }
+ }
+ Signal {
+ name: "positionChanged"
+ Parameter { name: "position"; type: "float" }
+ }
+ Signal {
+ name: "durationChanged"
+ Parameter { name: "duration"; type: "float" }
+ }
+ Method {
+ name: "setAnimationName"
+ Parameter { name: "name"; type: "string" }
+ }
+ Method {
+ name: "setPosition"
+ Parameter { name: "position"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAbstractAnimationClip"
+ prototype: "Qt3DCore::QNode"
+ exports: ["Qt3D.Animation/AbstractAnimationClip 2.9"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ Property { name: "duration"; type: "float"; isReadonly: true }
+ Signal {
+ name: "durationChanged"
+ Parameter { name: "duration"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAbstractClipAnimator"
+ prototype: "Qt3DCore::QComponent"
+ exports: ["Qt3D.Animation/AbstractClipAnimator 2.9"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "Loops"
+ values: {
+ "Infinite": -1
+ }
+ }
+ Property { name: "running"; type: "bool" }
+ Property { name: "loops"; type: "int" }
+ Property { name: "channelMapper"; type: "Qt3DAnimation::QChannelMapper"; isPointer: true }
+ Signal {
+ name: "runningChanged"
+ Parameter { name: "running"; type: "bool" }
+ }
+ Signal {
+ name: "channelMapperChanged"
+ Parameter { name: "channelMapper"; type: "Qt3DAnimation::QChannelMapper"; isPointer: true }
+ }
+ Signal {
+ name: "loopCountChanged"
+ Parameter { name: "loops"; type: "int" }
+ }
+ Method {
+ name: "setRunning"
+ Parameter { name: "running"; type: "bool" }
+ }
+ Method {
+ name: "setChannelMapper"
+ Parameter { name: "channelMapper"; type: "Qt3DAnimation::QChannelMapper"; isPointer: true }
+ }
+ Method {
+ name: "setLoopCount"
+ Parameter { name: "loops"; type: "int" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAbstractClipBlendNode"
+ prototype: "Qt3DCore::QNode"
+ exports: ["Qt3D.Animation/AbstractClipBlendNode 2.9"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ }
+ Component {
+ name: "Qt3DAnimation::QAdditiveClipBlend"
+ prototype: "Qt3DAnimation::QAbstractClipBlendNode"
+ exports: ["Qt3D.Animation/AdditiveClipBlend 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "baseClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ Property {
+ name: "additiveClip"
+ type: "Qt3DAnimation::QAbstractClipBlendNode"
+ isPointer: true
+ }
+ Property { name: "additiveFactor"; type: "float" }
+ Signal {
+ name: "additiveFactorChanged"
+ Parameter { name: "additiveFactor"; type: "float" }
+ }
+ Signal {
+ name: "baseClipChanged"
+ Parameter { name: "baseClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ }
+ Signal {
+ name: "additiveClipChanged"
+ Parameter {
+ name: "additiveClip"
+ type: "Qt3DAnimation::QAbstractClipBlendNode"
+ isPointer: true
+ }
+ }
+ Method {
+ name: "setAdditiveFactor"
+ Parameter { name: "additiveFactor"; type: "float" }
+ }
+ Method {
+ name: "setBaseClip"
+ Parameter { name: "baseClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ }
+ Method {
+ name: "setAdditiveClip"
+ Parameter {
+ name: "additiveClip"
+ type: "Qt3DAnimation::QAbstractClipBlendNode"
+ isPointer: true
+ }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAnimationClip"
+ prototype: "Qt3DAnimation::QAbstractAnimationClip"
+ exports: ["Qt3D.Animation/AnimationClip 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "clipData"; type: "Qt3DAnimation::QAnimationClipData" }
+ Signal {
+ name: "clipDataChanged"
+ Parameter { name: "clipData"; type: "Qt3DAnimation::QAnimationClipData" }
+ }
+ Method {
+ name: "setClipData"
+ Parameter { name: "clipData"; type: "Qt3DAnimation::QAnimationClipData" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAnimationClipLoader"
+ prototype: "Qt3DAnimation::QAbstractAnimationClip"
+ exports: ["Qt3D.Animation/AnimationClipLoader 2.9"]
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "Status"
+ values: {
+ "NotReady": 0,
+ "Ready": 1,
+ "Error": 2
+ }
+ }
+ Property { name: "source"; type: "QUrl" }
+ Property { name: "status"; type: "Status"; isReadonly: true }
+ Signal {
+ name: "sourceChanged"
+ Parameter { name: "source"; type: "QUrl" }
+ }
+ Signal {
+ name: "statusChanged"
+ Parameter { name: "status"; type: "Status" }
+ }
+ Method {
+ name: "setSource"
+ Parameter { name: "source"; type: "QUrl" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAnimationController"
+ prototype: "QObject"
+ Property { name: "activeAnimationGroup"; type: "int" }
+ Property { name: "position"; type: "float" }
+ Property { name: "positionScale"; type: "float" }
+ Property { name: "positionOffset"; type: "float" }
+ Property { name: "entity"; type: "Qt3DCore::QEntity"; isPointer: true }
+ Property { name: "recursive"; type: "bool" }
+ Signal {
+ name: "activeAnimationGroupChanged"
+ Parameter { name: "index"; type: "int" }
+ }
+ Signal {
+ name: "positionChanged"
+ Parameter { name: "position"; type: "float" }
+ }
+ Signal {
+ name: "positionScaleChanged"
+ Parameter { name: "scale"; type: "float" }
+ }
+ Signal {
+ name: "positionOffsetChanged"
+ Parameter { name: "offset"; type: "float" }
+ }
+ Signal {
+ name: "entityChanged"
+ Parameter { name: "entity"; type: "Qt3DCore::QEntity"; isPointer: true }
+ }
+ Signal {
+ name: "recursiveChanged"
+ Parameter { name: "recursive"; type: "bool" }
+ }
+ Method {
+ name: "setActiveAnimationGroup"
+ Parameter { name: "index"; type: "int" }
+ }
+ Method {
+ name: "setPosition"
+ Parameter { name: "position"; type: "float" }
+ }
+ Method {
+ name: "setPositionScale"
+ Parameter { name: "scale"; type: "float" }
+ }
+ Method {
+ name: "setPositionOffset"
+ Parameter { name: "offset"; type: "float" }
+ }
+ Method {
+ name: "setEntity"
+ Parameter { name: "entity"; type: "Qt3DCore::QEntity"; isPointer: true }
+ }
+ Method {
+ name: "setRecursive"
+ Parameter { name: "recursive"; type: "bool" }
+ }
+ Method {
+ name: "getAnimationIndex"
+ type: "int"
+ Parameter { name: "name"; type: "string" }
+ }
+ Method {
+ name: "getGroup"
+ type: "Qt3DAnimation::QAnimationGroup*"
+ Parameter { name: "index"; type: "int" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAnimationGroup"
+ prototype: "QObject"
+ Property { name: "name"; type: "string" }
+ Property { name: "position"; type: "float" }
+ Property { name: "duration"; type: "float"; isReadonly: true }
+ Signal {
+ name: "nameChanged"
+ Parameter { name: "name"; type: "string" }
+ }
+ Signal {
+ name: "positionChanged"
+ Parameter { name: "position"; type: "float" }
+ }
+ Signal {
+ name: "durationChanged"
+ Parameter { name: "duration"; type: "float" }
+ }
+ Method {
+ name: "setName"
+ Parameter { name: "name"; type: "string" }
+ }
+ Method {
+ name: "setPosition"
+ Parameter { name: "position"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QBlendedClipAnimator"
+ prototype: "Qt3DAnimation::QAbstractClipAnimator"
+ exports: ["Qt3D.Animation/BlendedClipAnimator 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "blendTree"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ Signal {
+ name: "blendTreeChanged"
+ Parameter { name: "blendTree"; type: "QAbstractClipBlendNode"; isPointer: true }
+ }
+ Method {
+ name: "setBlendTree"
+ Parameter { name: "blendTree"; type: "QAbstractClipBlendNode"; isPointer: true }
+ }
+ }
+ Component { name: "Qt3DAnimation::QChannelMapper"; prototype: "Qt3DCore::QNode" }
+ Component {
+ name: "Qt3DAnimation::QChannelMapping"
+ prototype: "Qt3DCore::QNode"
+ exports: ["Qt3D.Animation/ChannelMapping 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "channelName"; type: "string" }
+ Property { name: "target"; type: "Qt3DCore::QNode"; isPointer: true }
+ Property { name: "property"; type: "string" }
+ Signal {
+ name: "channelNameChanged"
+ Parameter { name: "channelName"; type: "string" }
+ }
+ Signal {
+ name: "targetChanged"
+ Parameter { name: "target"; type: "Qt3DCore::QNode"; isPointer: true }
+ }
+ Signal {
+ name: "propertyChanged"
+ Parameter { name: "property"; type: "string" }
+ }
+ Method {
+ name: "setChannelName"
+ Parameter { name: "channelName"; type: "string" }
+ }
+ Method {
+ name: "setTarget"
+ Parameter { name: "target"; type: "Qt3DCore::QNode"; isPointer: true }
+ }
+ Method {
+ name: "setProperty"
+ Parameter { name: "property"; type: "string" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QClipAnimator"
+ prototype: "Qt3DAnimation::QAbstractClipAnimator"
+ exports: ["Qt3D.Animation/ClipAnimator 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "clip"; type: "Qt3DAnimation::QAbstractAnimationClip"; isPointer: true }
+ Signal {
+ name: "clipChanged"
+ Parameter { name: "clip"; type: "Qt3DAnimation::QAbstractAnimationClip"; isPointer: true }
+ }
+ Method {
+ name: "setClip"
+ Parameter { name: "clip"; type: "Qt3DAnimation::QAbstractAnimationClip"; isPointer: true }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QClipBlendValue"
+ prototype: "Qt3DAnimation::QAbstractClipBlendNode"
+ exports: ["Qt3D.Animation/ClipBlendValue 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "clip"; type: "Qt3DAnimation::QAbstractAnimationClip"; isPointer: true }
+ Signal {
+ name: "clipChanged"
+ Parameter { name: "clip"; type: "Qt3DAnimation::QAbstractAnimationClip"; isPointer: true }
+ }
+ Method {
+ name: "setClip"
+ Parameter { name: "clip"; type: "Qt3DAnimation::QAbstractAnimationClip"; isPointer: true }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QKeyframeAnimation"
+ prototype: "Qt3DAnimation::QAbstractAnimation"
+ Enum {
+ name: "RepeatMode"
+ values: {
+ "None": 0,
+ "Constant": 1,
+ "Repeat": 2
+ }
+ }
+ Property { name: "framePositions"; type: "QVector<float>" }
+ Property { name: "target"; type: "Qt3DCore::QTransform"; isPointer: true }
+ Property { name: "easing"; type: "QEasingCurve" }
+ Property { name: "targetName"; type: "string" }
+ Property { name: "startMode"; type: "QKeyframeAnimation::RepeatMode" }
+ Property { name: "endMode"; type: "QKeyframeAnimation::RepeatMode" }
+ Signal {
+ name: "framePositionsChanged"
+ Parameter { name: "positions"; type: "QVector<float>" }
+ }
+ Signal {
+ name: "targetChanged"
+ Parameter { name: "target"; type: "Qt3DCore::QTransform"; isPointer: true }
+ }
+ Signal {
+ name: "easingChanged"
+ Parameter { name: "easing"; type: "QEasingCurve" }
+ }
+ Signal {
+ name: "targetNameChanged"
+ Parameter { name: "name"; type: "string" }
+ }
+ Signal {
+ name: "startModeChanged"
+ Parameter { name: "startMode"; type: "QKeyframeAnimation::RepeatMode" }
+ }
+ Signal {
+ name: "endModeChanged"
+ Parameter { name: "endMode"; type: "QKeyframeAnimation::RepeatMode" }
+ }
+ Method {
+ name: "setFramePositions"
+ Parameter { name: "positions"; type: "QVector<float>" }
+ }
+ Method {
+ name: "setTarget"
+ Parameter { name: "target"; type: "Qt3DCore::QTransform"; isPointer: true }
+ }
+ Method {
+ name: "setEasing"
+ Parameter { name: "easing"; type: "QEasingCurve" }
+ }
+ Method {
+ name: "setTargetName"
+ Parameter { name: "name"; type: "string" }
+ }
+ Method {
+ name: "setStartMode"
+ Parameter { name: "mode"; type: "RepeatMode" }
+ }
+ Method {
+ name: "setEndMode"
+ Parameter { name: "mode"; type: "RepeatMode" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QLerpClipBlend"
+ prototype: "Qt3DAnimation::QAbstractClipBlendNode"
+ exports: ["Qt3D.Animation/LerpClipBlend 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "startClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ Property { name: "endClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ Property { name: "blendFactor"; type: "float" }
+ Signal {
+ name: "blendFactorChanged"
+ Parameter { name: "blendFactor"; type: "float" }
+ }
+ Signal {
+ name: "startClipChanged"
+ Parameter { name: "startClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ }
+ Signal {
+ name: "endClipChanged"
+ Parameter { name: "endClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ }
+ Method {
+ name: "setBlendFactor"
+ Parameter { name: "blendFactor"; type: "float" }
+ }
+ Method {
+ name: "setStartClip"
+ Parameter { name: "startClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ }
+ Method {
+ name: "setEndClip"
+ Parameter { name: "endClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QMorphTarget"
+ prototype: "QObject"
+ Property { name: "attributeNames"; type: "QStringList"; isReadonly: true }
+ Signal {
+ name: "attributeNamesChanged"
+ Parameter { name: "attributeNames"; type: "QStringList" }
+ }
+ Method {
+ name: "fromGeometry"
+ type: "QMorphTarget*"
+ Parameter { name: "geometry"; type: "Qt3DRender::QGeometry"; isPointer: true }
+ Parameter { name: "attributes"; type: "QStringList" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QMorphingAnimation"
+ prototype: "Qt3DAnimation::QAbstractAnimation"
+ Enum {
+ name: "Method"
+ values: {
+ "Normalized": 0,
+ "Relative": 1
+ }
+ }
+ Property { name: "targetPositions"; type: "QVector<float>" }
+ Property { name: "interpolator"; type: "float"; isReadonly: true }
+ Property { name: "target"; type: "Qt3DRender::QGeometryRenderer"; isPointer: true }
+ Property { name: "targetName"; type: "string" }
+ Property { name: "method"; type: "QMorphingAnimation::Method" }
+ Property { name: "easing"; type: "QEasingCurve" }
+ Signal {
+ name: "targetPositionsChanged"
+ Parameter { name: "targetPositions"; type: "QVector<float>" }
+ }
+ Signal {
+ name: "interpolatorChanged"
+ Parameter { name: "interpolator"; type: "float" }
+ }
+ Signal {
+ name: "targetChanged"
+ Parameter { name: "target"; type: "Qt3DRender::QGeometryRenderer"; isPointer: true }
+ }
+ Signal {
+ name: "targetNameChanged"
+ Parameter { name: "name"; type: "string" }
+ }
+ Signal {
+ name: "methodChanged"
+ Parameter { name: "method"; type: "QMorphingAnimation::Method" }
+ }
+ Signal {
+ name: "easingChanged"
+ Parameter { name: "easing"; type: "QEasingCurve" }
+ }
+ Method {
+ name: "setTargetPositions"
+ Parameter { name: "targetPositions"; type: "QVector<float>" }
+ }
+ Method {
+ name: "setTarget"
+ Parameter { name: "target"; type: "Qt3DRender::QGeometryRenderer"; isPointer: true }
+ }
+ Method {
+ name: "setTargetName"
+ Parameter { name: "name"; type: "string" }
+ }
+ Method {
+ name: "setMethod"
+ Parameter { name: "method"; type: "QMorphingAnimation::Method" }
+ }
+ Method {
+ name: "setEasing"
+ Parameter { name: "easing"; type: "QEasingCurve" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::Quick::QQuick3DAnimationController"
+ prototype: "Qt3DAnimation::QAnimationController"
+ exports: ["Qt3D.Animation/AnimationController 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property {
+ name: "animationGroups"
+ type: "Qt3DAnimation::QAnimationGroup"
+ isList: true
+ isReadonly: true
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::Quick::QQuick3DAnimationGroup"
+ prototype: "Qt3DAnimation::QAnimationGroup"
+ exports: ["Qt3D.Animation/AnimationGroup 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property {
+ name: "animations"
+ type: "Qt3DAnimation::QAbstractAnimation"
+ isList: true
+ isReadonly: true
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::Quick::QQuick3DKeyframeAnimation"
+ prototype: "Qt3DAnimation::QKeyframeAnimation"
+ exports: ["Qt3D.Animation/KeyframeAnimation 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "keyframes"; type: "Qt3DCore::QTransform"; isList: true; isReadonly: true }
+ }
+ Component {
+ name: "Qt3DAnimation::Quick::QQuick3DMorphTarget"
+ prototype: "Qt3DAnimation::QMorphTarget"
+ exports: ["Qt3D.Animation/MorphTarget 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "attributes"; type: "Qt3DRender::QAttribute"; isList: true; isReadonly: true }
+ }
+ Component {
+ name: "Qt3DAnimation::Quick::QQuick3DMorphingAnimation"
+ prototype: "Qt3DAnimation::QMorphingAnimation"
+ exports: ["Qt3D.Animation/MorphingAnimation 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property {
+ name: "morphTargets"
+ type: "Qt3DAnimation::QMorphTarget"
+ isList: true
+ isReadonly: true
+ }
+ }
+ Component {
+ name: "Qt3DCore::QComponent"
+ prototype: "Qt3DCore::QNode"
+ Property { name: "isShareable"; type: "bool" }
+ Signal {
+ name: "shareableChanged"
+ Parameter { name: "isShareable"; type: "bool" }
+ }
+ Signal {
+ name: "addedToEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
+ Signal {
+ name: "removedFromEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
+ Method {
+ name: "setShareable"
+ Parameter { name: "isShareable"; type: "bool" }
+ }
+ }
+ Component {
+ name: "Qt3DCore::QNode"
+ prototype: "QObject"
+ Enum {
+ name: "PropertyTrackingMode"
+ values: {
+ "TrackFinalValues": 0,
+ "DontTrackValues": 1,
+ "TrackAllValues": 2
+ }
+ }
+ Property { name: "parent"; type: "Qt3DCore::QNode"; isPointer: true }
+ Property { name: "enabled"; type: "bool" }
+ Property { name: "defaultPropertyTrackingMode"; revision: 9; type: "PropertyTrackingMode" }
+ Signal {
+ name: "parentChanged"
+ Parameter { name: "parent"; type: "QObject"; isPointer: true }
+ }
+ Signal {
+ name: "enabledChanged"
+ Parameter { name: "enabled"; type: "bool" }
+ }
+ Signal {
+ name: "defaultPropertyTrackingModeChanged"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
+ Signal { name: "nodeDestroyed" }
+ Method {
+ name: "setParent"
+ Parameter { name: "parent"; type: "QNode"; isPointer: true }
+ }
+ Method {
+ name: "setEnabled"
+ Parameter { name: "isEnabled"; type: "bool" }
+ }
+ Method {
+ name: "setDefaultPropertyTrackingMode"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
+ }
+}
diff --git a/src/quick3d/imports/animation/qt3dquick3danimationplugin.cpp b/src/quick3d/imports/animation/qt3dquick3danimationplugin.cpp
index 87c137763..7feeaf84c 100644
--- a/src/quick3d/imports/animation/qt3dquick3danimationplugin.cpp
+++ b/src/quick3d/imports/animation/qt3dquick3danimationplugin.cpp
@@ -55,6 +55,7 @@
#include <Qt3DAnimation/qmorphinganimation.h>
#include <Qt3DAnimation/qanimationgroup.h>
#include <Qt3DAnimation/qmorphtarget.h>
+#include <Qt3DAnimation/qvertexblendanimation.h>
#include <Qt3DQuickAnimation/private/qt3dquickanimation_global_p.h>
#include <Qt3DQuickAnimation/private/quick3dchannelmapper_p.h>
@@ -63,6 +64,7 @@
#include <Qt3DQuickAnimation/private/quick3danimationcontroller_p.h>
#include <Qt3DQuickAnimation/private/quick3dmorphtarget_p.h>
#include <Qt3DQuickAnimation/private/quick3dmorphinganimation_p.h>
+#include <Qt3DQuickAnimation/private/quick3dvertexblendanimation_p.h>
QT_BEGIN_NAMESPACE
@@ -92,6 +94,7 @@ void Qt3DQuick3DAnimationPlugin::registerTypes(const char *uri)
qmlRegisterExtendedType<Qt3DAnimation::QAnimationController, Qt3DAnimation::Quick::QQuick3DAnimationController>(uri, 2, 9, "AnimationController");
qmlRegisterExtendedType<Qt3DAnimation::QMorphingAnimation, Qt3DAnimation::Quick::QQuick3DMorphingAnimation>(uri, 2, 9, "MorphingAnimation");
qmlRegisterExtendedType<Qt3DAnimation::QMorphTarget, Qt3DAnimation::Quick::QQuick3DMorphTarget>(uri, 2, 9, "MorphTarget");
+ qmlRegisterExtendedType<Qt3DAnimation::QVertexBlendAnimation, Qt3DAnimation::Quick::QQuick3DVertexBlendAnimation>(uri, 2, 9, "VertexBlendAnimation");
}
QT_END_NAMESPACE
diff --git a/src/quick3d/imports/core/plugins.qmltypes b/src/quick3d/imports/core/plugins.qmltypes
index ed06f8e0c..87cdac04c 100644
--- a/src/quick3d/imports/core/plugins.qmltypes
+++ b/src/quick3d/imports/core/plugins.qmltypes
@@ -4,29 +4,41 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable Qt3D.Core 2.0'
+// 'qmlplugindump -nonrelocatable Qt3D.Core 2.9'
Module {
- dependencies: ["QtQuick 2.7"]
+ dependencies: ["QtQuick 2.8"]
Component {
name: "Qt3DCore::QComponent"
- prototype: "Qt3DCore::QNode"
- Property { name: "isShareable"; type: "bool" }
+ defaultProperty: "data"
+ prototype: "Qt3DCore::QComponent"
+ Property { name: "propertyTrackingOverrides"; type: "QJSValue" }
+ Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "childNodes"; type: "Qt3DCore::QNode"; isList: true; isReadonly: true }
Signal {
- name: "shareableChanged"
- Parameter { name: "isShareable"; type: "bool" }
+ name: "propertyTrackingOverridesChanged"
+ Parameter { name: "value"; type: "QJSValue" }
}
- Method {
- name: "setShareable"
- Parameter { name: "isShareable"; type: "bool" }
+ Signal {
+ name: "propertyTrackingOverridesChanged"
+ Parameter { name: "value"; type: "QJSValue" }
}
}
Component { name: "Qt3DCore::QEntity"; prototype: "Qt3DCore::QNode" }
Component {
name: "Qt3DCore::QNode"
prototype: "QObject"
+ Enum {
+ name: "PropertyTrackingMode"
+ values: {
+ "TrackFinalValues": 0,
+ "DontTrackValues": 1,
+ "TrackAllValues": 2
+ }
+ }
Property { name: "parent"; type: "Qt3DCore::QNode"; isPointer: true }
Property { name: "enabled"; type: "bool" }
+ Property { name: "defaultPropertyTrackingMode"; revision: 9; type: "PropertyTrackingMode" }
Signal {
name: "parentChanged"
Parameter { name: "parent"; type: "QObject"; isPointer: true }
@@ -35,6 +47,10 @@ Module {
name: "enabledChanged"
Parameter { name: "enabled"; type: "bool" }
}
+ Signal {
+ name: "defaultPropertyTrackingModeChanged"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
Signal { name: "nodeDestroyed" }
Method {
name: "setParent"
@@ -44,11 +60,14 @@ Module {
name: "setEnabled"
Parameter { name: "isEnabled"; type: "bool" }
}
+ Method {
+ name: "setDefaultPropertyTrackingMode"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
}
Component {
name: "Qt3DCore::QTransform"
prototype: "Qt3DCore::QComponent"
- exports: ["Qt3D.Core/Transform 2.0"]
Property { name: "matrix"; type: "QMatrix4x4" }
Property { name: "scale"; type: "float" }
Property { name: "scale3D"; type: "QVector3D" }
@@ -230,10 +249,8 @@ Module {
Component {
name: "Qt3DCore::Quick::Quick3DEntityLoader"
defaultProperty: "data"
- prototype: "Qt3DCore::QEntity"
- exports: ["Qt3D.Core/EntityLoader 2.0"]
- Property { name: "entity"; type: "Qt3DCore::QEntity"; isPointer: true; isReadonly: true }
- Property { name: "source"; type: "QUrl" }
+ prototype: "Qt3DCore::Quick::Quick3DEntityLoader"
+ Property { name: "components"; type: "Qt3DCore::QComponent"; isList: true; isReadonly: true }
}
Component {
name: "Qt3DCore::Quick::Quick3DNode"
@@ -248,13 +265,36 @@ Module {
Component {
name: "Qt3DCore::Quick::Quick3DNodeInstantiator"
defaultProperty: "delegate"
+ prototype: "Qt3DCore::Quick::Quick3DNodeInstantiator"
+ Property { name: "propertyTrackingOverrides"; type: "QJSValue" }
+ Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "childNodes"; type: "Qt3DCore::QNode"; isList: true; isReadonly: true }
+ Signal {
+ name: "propertyTrackingOverridesChanged"
+ Parameter { name: "value"; type: "QJSValue" }
+ }
+ Signal {
+ name: "propertyTrackingOverridesChanged"
+ Parameter { name: "value"; type: "QJSValue" }
+ }
+ }
+ Component {
+ name: "Qt3DCore::Quick::Quick3DNodeV9"
+ defaultProperty: "data"
prototype: "Qt3DCore::QNode"
- exports: ["Qt3D.Core/NodeInstantiator 2.0"]
- Property { name: "active"; type: "bool" }
- Property { name: "asynchronous"; type: "bool" }
- Property { name: "model"; type: "QVariant" }
- Property { name: "count"; type: "int"; isReadonly: true }
- Property { name: "delegate"; type: "QQmlComponent" }
- Property { name: "object"; type: "QObject"; isReadonly: true }
+ exports: ["Qt3D.Core/Node 2.9"]
+ isCreatable: false
+ exportMetaObjectRevisions: [9]
+ Property { name: "propertyTrackingOverrides"; type: "QJSValue" }
+ Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "childNodes"; type: "Qt3DCore::QNode"; isList: true; isReadonly: true }
+ Signal {
+ name: "propertyTrackingOverridesChanged"
+ Parameter { name: "value"; type: "QJSValue" }
+ }
+ Signal {
+ name: "propertyTrackingOverridesChanged"
+ Parameter { name: "value"; type: "QJSValue" }
+ }
}
}
diff --git a/src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp b/src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp
index 6d2a78166..3ff63d9d9 100644
--- a/src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp
+++ b/src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp
@@ -71,4 +71,9 @@ void Qt3DQuick3DCorePlugin::registerTypes(const char *uri)
qmlRegisterExtendedUncreatableType<Qt3DCore::QNode, Qt3DCore::Quick::Quick3DNodeV9, 9>(uri, 2, 9, "Node", QStringLiteral("Node is a base class"));
}
+Qt3DQuick3DCorePlugin::~Qt3DQuick3DCorePlugin()
+{
+ Qt3DCore::Quick::Quick3D_uninitialize();
+}
+
QT_END_NAMESPACE
diff --git a/src/quick3d/imports/core/qt3dquick3dcoreplugin.h b/src/quick3d/imports/core/qt3dquick3dcoreplugin.h
index a9b215c4a..b0ef5947c 100644
--- a/src/quick3d/imports/core/qt3dquick3dcoreplugin.h
+++ b/src/quick3d/imports/core/qt3dquick3dcoreplugin.h
@@ -57,6 +57,7 @@ class Qt3DQuick3DCorePlugin : public QQmlExtensionPlugin
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
public:
Qt3DQuick3DCorePlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { initResources(); }
+ ~Qt3DQuick3DCorePlugin();
void registerTypes(const char *uri) Q_DECL_OVERRIDE;
};
diff --git a/src/quick3d/imports/extras/plugins.qmltypes b/src/quick3d/imports/extras/plugins.qmltypes
index cbe12c9ad..a623f385c 100644
--- a/src/quick3d/imports/extras/plugins.qmltypes
+++ b/src/quick3d/imports/extras/plugins.qmltypes
@@ -4,68 +4,30 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable Qt3D.Extras 2.0'
+// 'qmlplugindump -nonrelocatable Qt3D.Extras 2.9'
Module {
- dependencies: []
- Component {
- name: "Qt3DCore::QComponent"
- prototype: "Qt3DCore::QNode"
- Property { name: "isShareable"; type: "bool" }
- Signal {
- name: "shareableChanged"
- Parameter { name: "isShareable"; type: "bool" }
- }
- Signal {
- name: "addedToEntity"
- Parameter { name: "entity"; type: "QEntity"; isPointer: true }
- }
- Signal {
- name: "removedFromEntity"
- Parameter { name: "entity"; type: "QEntity"; isPointer: true }
- }
- Method {
- name: "setShareable"
- Parameter { name: "isShareable"; type: "bool" }
- }
- }
+ dependencies: ["Qt3D.Logic 2.0"]
Component { name: "Qt3DCore::QEntity"; prototype: "Qt3DCore::QNode" }
Component {
- name: "Qt3DCore::QNode"
- prototype: "QObject"
- Property { name: "parent"; type: "Qt3DCore::QNode"; isPointer: true }
- Property { name: "enabled"; type: "bool" }
- Signal {
- name: "parentChanged"
- Parameter { name: "parent"; type: "QObject"; isPointer: true }
- }
- Signal {
- name: "enabledChanged"
- Parameter { name: "enabled"; type: "bool" }
- }
- Signal { name: "nodeDestroyed" }
- Method {
- name: "setParent"
- Parameter { name: "parent"; type: "QNode"; isPointer: true }
- }
- Method {
- name: "setEnabled"
- Parameter { name: "isEnabled"; type: "bool" }
- }
- }
- Component {
name: "Qt3DExtras::Extras::Quick::Quick3DLevelOfDetailLoader"
prototype: "Qt3DCore::QEntity"
- exports: ["Qt3D.Extras/LevelOfDetailLoader 2.2"]
+ exports: ["Qt3D.Extras/LevelOfDetailLoader 2.9"]
exportMetaObjectRevisions: [0]
Property { name: "sources"; type: "QVariantList" }
Property { name: "camera"; type: "Qt3DRender::QCamera"; isPointer: true }
Property { name: "currentIndex"; type: "int" }
Property { name: "thresholdType"; type: "Qt3DRender::QLevelOfDetail::ThresholdType" }
Property { name: "thresholds"; type: "QVector<qreal>" }
- Property { name: "volumeOverride"; type: "Qt3DRender::QBoundingSphere"; isPointer: true }
+ Property { name: "volumeOverride"; type: "Qt3DRender::QLevelOfDetailBoundingSphere" }
Property { name: "entity"; type: "QObject"; isReadonly: true; isPointer: true }
Property { name: "source"; type: "QUrl"; isReadonly: true }
+ Method {
+ name: "createBoundingSphere"
+ type: "Qt3DRender::QLevelOfDetailBoundingSphere"
+ Parameter { name: "center"; type: "QVector3D" }
+ Parameter { name: "radius"; type: "float" }
+ }
}
Component {
name: "Qt3DExtras::QConeGeometry"
@@ -590,6 +552,90 @@ Module {
}
}
Component {
+ name: "Qt3DExtras::QExtrudedTextGeometry"
+ prototype: "Qt3DRender::QGeometry"
+ exports: ["Qt3D.Extras/ExtrudedTextGeometry 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "text"; type: "string" }
+ Property { name: "font"; type: "QFont" }
+ Property { name: "extrusionLength"; type: "float" }
+ Property {
+ name: "positionAttribute"
+ type: "Qt3DRender::QAttribute"
+ isReadonly: true
+ isPointer: true
+ }
+ Property {
+ name: "normalAttribute"
+ type: "Qt3DRender::QAttribute"
+ isReadonly: true
+ isPointer: true
+ }
+ Property {
+ name: "indexAttribute"
+ type: "Qt3DRender::QAttribute"
+ isReadonly: true
+ isPointer: true
+ }
+ Signal {
+ name: "textChanged"
+ Parameter { name: "text"; type: "string" }
+ }
+ Signal {
+ name: "fontChanged"
+ Parameter { name: "font"; type: "QFont" }
+ }
+ Signal {
+ name: "depthChanged"
+ Parameter { name: "extrusionLength"; type: "float" }
+ }
+ Method {
+ name: "setText"
+ Parameter { name: "text"; type: "string" }
+ }
+ Method {
+ name: "setFont"
+ Parameter { name: "font"; type: "QFont" }
+ }
+ Method {
+ name: "setDepth"
+ Parameter { name: "extrusionLength"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DExtras::QExtrudedTextMesh"
+ prototype: "Qt3DRender::QGeometryRenderer"
+ exports: ["Qt3D.Extras/ExtrudedTextMesh 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "text"; type: "string" }
+ Property { name: "font"; type: "QFont" }
+ Property { name: "depth"; type: "float" }
+ Signal {
+ name: "textChanged"
+ Parameter { name: "text"; type: "string" }
+ }
+ Signal {
+ name: "fontChanged"
+ Parameter { name: "font"; type: "QFont" }
+ }
+ Signal {
+ name: "depthChanged"
+ Parameter { name: "depth"; type: "float" }
+ }
+ Method {
+ name: "setText"
+ Parameter { name: "text"; type: "string" }
+ }
+ Method {
+ name: "setFont"
+ Parameter { name: "font"; type: "QFont" }
+ }
+ Method {
+ name: "setDepth"
+ Parameter { name: "depth"; type: "float" }
+ }
+ }
+ Component {
name: "Qt3DExtras::QFirstPersonCameraController"
prototype: "Qt3DCore::QEntity"
exports: ["Qt3D.Extras/FirstPersonCameraController 2.0"]
@@ -599,6 +645,14 @@ Module {
Property { name: "lookSpeed"; type: "float" }
Property { name: "acceleration"; type: "float" }
Property { name: "deceleration"; type: "float" }
+ Signal {
+ name: "accelerationChanged"
+ Parameter { name: "acceleration"; type: "float" }
+ }
+ Signal {
+ name: "decelerationChanged"
+ Parameter { name: "deceleration"; type: "float" }
+ }
}
Component {
name: "Qt3DExtras::QForwardRenderer"
@@ -612,6 +666,7 @@ Module {
Property { name: "camera"; type: "Qt3DCore::QEntity"; isPointer: true }
Property { name: "externalRenderTargetSize"; type: "QSize" }
Property { name: "frustumCulling"; type: "bool" }
+ Property { name: "gamma"; revision: 9; type: "float" }
Signal {
name: "viewportRectChanged"
Parameter { name: "viewportRect"; type: "QRectF" }
@@ -636,6 +691,10 @@ Module {
name: "frustumCullingEnabledChanged"
Parameter { name: "enabled"; type: "bool" }
}
+ Signal {
+ name: "gammaChanged"
+ Parameter { name: "gamma"; type: "float" }
+ }
Method {
name: "setViewportRect"
Parameter { name: "viewportRect"; type: "QRectF" }
@@ -660,6 +719,10 @@ Module {
name: "setFrustumCullingEnabled"
Parameter { name: "enabled"; type: "bool" }
}
+ Method {
+ name: "setGamma"
+ Parameter { name: "gamma"; type: "float" }
+ }
}
Component {
name: "Qt3DExtras::QGoochMaterial"
@@ -733,18 +796,11 @@ Module {
Component {
name: "Qt3DExtras::QMetalRoughMaterial"
prototype: "Qt3DRender::QMaterial"
- exports: ["Qt3D.Extras/MetalRoughMaterial 2.2"]
+ exports: ["Qt3D.Extras/MetalRoughMaterial 2.9"]
exportMetaObjectRevisions: [0]
Property { name: "baseColor"; type: "QColor" }
Property { name: "metalness"; type: "float" }
Property { name: "roughness"; type: "float" }
- Property {
- name: "environmentIrradiance"
- type: "Qt3DRender::QAbstractTexture"
- isPointer: true
- }
- Property { name: "environmentSpecular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
- Property { name: "exposure"; type: "float" }
Signal {
name: "baseColorChanged"
Parameter { name: "baseColor"; type: "QColor" }
@@ -757,22 +813,6 @@ Module {
name: "roughnessChanged"
Parameter { name: "roughness"; type: "float" }
}
- Signal {
- name: "environmentIrradianceChanged"
- Parameter {
- name: "environmentIrradiance"
- type: "Qt3DRender::QAbstractTexture"
- isPointer: true
- }
- }
- Signal {
- name: "environmentSpecularChanged"
- Parameter { name: "environmentSpecular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
- }
- Signal {
- name: "exposureChanged"
- Parameter { name: "exposure"; type: "float" }
- }
Method {
name: "setBaseColor"
Parameter { name: "baseColor"; type: "QColor" }
@@ -785,21 +825,56 @@ Module {
name: "setRoughness"
Parameter { name: "roughness"; type: "float" }
}
+ }
+ Component {
+ name: "Qt3DExtras::QMorphPhongMaterial"
+ prototype: "Qt3DRender::QMaterial"
+ exports: ["Qt3D.Extras/MorphPhongMaterial 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "ambient"; type: "QColor" }
+ Property { name: "diffuse"; type: "QColor" }
+ Property { name: "specular"; type: "QColor" }
+ Property { name: "shininess"; type: "float" }
+ Property { name: "interpolator"; type: "float" }
+ Signal {
+ name: "ambientChanged"
+ Parameter { name: "ambient"; type: "QColor" }
+ }
+ Signal {
+ name: "diffuseChanged"
+ Parameter { name: "diffuse"; type: "QColor" }
+ }
+ Signal {
+ name: "specularChanged"
+ Parameter { name: "specular"; type: "QColor" }
+ }
+ Signal {
+ name: "shininessChanged"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Signal {
+ name: "interpolatorChanged"
+ Parameter { name: "interpolator"; type: "float" }
+ }
Method {
- name: "setEnvironmentIrradiance"
- Parameter {
- name: "environmentIrradiance"
- type: "Qt3DRender::QAbstractTexture"
- isPointer: true
- }
+ name: "setAmbient"
+ Parameter { name: "ambient"; type: "QColor" }
+ }
+ Method {
+ name: "setDiffuse"
+ Parameter { name: "diffuse"; type: "QColor" }
}
Method {
- name: "setEnvironmentSpecular"
- Parameter { name: "environmentSpecular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ name: "setSpecular"
+ Parameter { name: "specular"; type: "QColor" }
}
Method {
- name: "setExposure"
- Parameter { name: "exposure"; type: "float" }
+ name: "setShininess"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Method {
+ name: "setInterpolator"
+ Parameter { name: "interpolator"; type: "float" }
}
}
Component {
@@ -1194,6 +1269,7 @@ Module {
exportMetaObjectRevisions: [0]
Property { name: "baseName"; type: "string" }
Property { name: "extension"; type: "string" }
+ Property { name: "gammaCorrect"; revision: 9; type: "bool" }
Signal {
name: "baseNameChanged"
Parameter { name: "path"; type: "string" }
@@ -1202,6 +1278,22 @@ Module {
name: "extensionChanged"
Parameter { name: "extension"; type: "string" }
}
+ Signal {
+ name: "gammaCorrectEnabledChanged"
+ Parameter { name: "enabled"; type: "bool" }
+ }
+ Method {
+ name: "setBaseName"
+ Parameter { name: "path"; type: "string" }
+ }
+ Method {
+ name: "setExtension"
+ Parameter { name: "extension"; type: "string" }
+ }
+ Method {
+ name: "setGammaCorrectEnabled"
+ Parameter { name: "enabled"; type: "bool" }
+ }
}
Component {
name: "Qt3DExtras::QSphereGeometry"
@@ -1318,105 +1410,34 @@ Module {
}
}
Component {
- name: "Qt3DExtras::QText3DGeometry"
- prototype: "Qt3DRender::QGeometry"
- exports: ["Qt3D.Extras/Text3DGeometry 2.2"]
+ name: "Qt3DExtras::QText2DEntity"
+ prototype: "Qt3DCore::QEntity"
+ exports: ["Qt3D.Extras/Text2DEntity 2.9"]
exportMetaObjectRevisions: [0]
- Property { name: "text"; type: "string" }
Property { name: "font"; type: "QFont" }
- Property { name: "depth"; type: "float" }
- Property { name: "edgeSplitAngle"; type: "float" }
- Property {
- name: "positionAttribute"
- type: "Qt3DRender::QAttribute"
- isReadonly: true
- isPointer: true
- }
- Property {
- name: "normalAttribute"
- type: "Qt3DRender::QAttribute"
- isReadonly: true
- isPointer: true
- }
- Property {
- name: "indexAttribute"
- type: "Qt3DRender::QAttribute"
- isReadonly: true
- isPointer: true
- }
- Signal {
- name: "textChanged"
- Parameter { name: "text"; type: "string" }
- }
+ Property { name: "text"; type: "string" }
+ Property { name: "color"; type: "QColor" }
+ Property { name: "width"; type: "float" }
+ Property { name: "height"; type: "float" }
Signal {
name: "fontChanged"
Parameter { name: "font"; type: "QFont" }
}
Signal {
- name: "depthChanged"
- Parameter { name: "depth"; type: "float" }
- }
- Signal {
- name: "edgeSplitAngleChanged"
- Parameter { name: "edgeSplitAngle"; type: "float" }
- }
- Method {
- name: "setText"
- Parameter { name: "text"; type: "string" }
- }
- Method {
- name: "setFont"
- Parameter { name: "font"; type: "QFont" }
- }
- Method {
- name: "setDepth"
- Parameter { name: "depth"; type: "float" }
- }
- Method {
- name: "setEdgeSplitAngle"
- Parameter { name: "edgeSplitAngle"; type: "float" }
+ name: "colorChanged"
+ Parameter { name: "color"; type: "QColor" }
}
- }
- Component {
- name: "Qt3DExtras::QText3DMesh"
- prototype: "Qt3DRender::QGeometryRenderer"
- exports: ["Qt3D.Extras/Text3DMesh 2.2"]
- exportMetaObjectRevisions: [0]
- Property { name: "text"; type: "string" }
- Property { name: "font"; type: "QFont" }
- Property { name: "depth"; type: "float" }
- Property { name: "edgeSplitAngle"; type: "float" }
Signal {
name: "textChanged"
Parameter { name: "text"; type: "string" }
}
Signal {
- name: "fontChanged"
- Parameter { name: "font"; type: "QFont" }
- }
- Signal {
- name: "depthChanged"
- Parameter { name: "depth"; type: "float" }
+ name: "widthChanged"
+ Parameter { name: "width"; type: "float" }
}
Signal {
- name: "edgeSplitAngleChanged"
- Parameter { name: "edgeSplitAngle"; type: "float" }
- }
- Method {
- name: "setText"
- Parameter { name: "text"; type: "string" }
- }
- Method {
- name: "setFont"
- Parameter { name: "font"; type: "QFont" }
- }
- Method {
- name: "setDepth"
- Parameter { name: "depth"; type: "float" }
- }
- Method {
- name: "setEdgeSplitAngle"
- Parameter { name: "edgeSplitAngle"; type: "float" }
+ name: "heightChanged"
+ Parameter { name: "height"; type: "float" }
}
}
Component {
@@ -1446,20 +1467,13 @@ Module {
Component {
name: "Qt3DExtras::QTexturedMetalRoughMaterial"
prototype: "Qt3DRender::QMaterial"
- exports: ["Qt3D.Extras/TexturedMetalRoughMaterial 2.2"]
+ exports: ["Qt3D.Extras/TexturedMetalRoughMaterial 2.9"]
exportMetaObjectRevisions: [0]
Property { name: "baseColor"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
Property { name: "metalness"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
Property { name: "roughness"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
Property { name: "ambientOcclusion"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
Property { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
- Property {
- name: "environmentIrradiance"
- type: "Qt3DRender::QAbstractTexture"
- isPointer: true
- }
- Property { name: "environmentSpecular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
- Property { name: "exposure"; type: "float" }
Signal {
name: "baseColorChanged"
Parameter { name: "baseColor"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
@@ -1480,22 +1494,6 @@ Module {
name: "normalChanged"
Parameter { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
}
- Signal {
- name: "environmentIrradianceChanged"
- Parameter {
- name: "environmentIrradiance"
- type: "Qt3DRender::QAbstractTexture"
- isPointer: true
- }
- }
- Signal {
- name: "environmentSpecularChanged"
- Parameter { name: "environmentSpecular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
- }
- Signal {
- name: "exposureChanged"
- Parameter { name: "exposure"; type: "float" }
- }
Method {
name: "setBaseColor"
Parameter { name: "baseColor"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
@@ -1516,22 +1514,6 @@ Module {
name: "setNormal"
Parameter { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
}
- Method {
- name: "setEnvironmentIrradiance"
- Parameter {
- name: "environmentIrradiance"
- type: "Qt3DRender::QAbstractTexture"
- isPointer: true
- }
- }
- Method {
- name: "setEnvironmentSpecular"
- Parameter { name: "environmentSpecular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
- }
- Method {
- name: "setExposure"
- Parameter { name: "exposure"; type: "float" }
- }
}
Component {
name: "Qt3DExtras::QTorusGeometry"
diff --git a/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp b/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp
index 647eb003b..879b79294 100644
--- a/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp
+++ b/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp
@@ -116,7 +116,9 @@ void Qt3DQuick3DExtrasPlugin::registerTypes(const char *uri)
qmlRegisterType<Qt3DExtras::QCylinderMesh>(uri, 2, 0, "CylinderMesh");
qmlRegisterType<Qt3DExtras::QCylinderGeometry>(uri, 2, 0, "CylinderGeometry");
qmlRegisterType<Qt3DExtras::QPlaneMesh>(uri, 2, 0, "PlaneMesh");
+ qmlRegisterRevision<Qt3DExtras::QPlaneMesh, 9>(uri, 2, 9);
qmlRegisterType<Qt3DExtras::QPlaneGeometry>(uri, 2, 0, "PlaneGeometry");
+ qmlRegisterRevision<Qt3DExtras::QPlaneGeometry, 9>(uri, 2, 9);
qmlRegisterType<Qt3DExtras::QTorusMesh>(uri, 2, 0, "TorusMesh");
qmlRegisterType<Qt3DExtras::QTorusGeometry>(uri, 2, 0, "TorusGeometry");
qmlRegisterType<Qt3DExtras::QSphereMesh>(uri, 2, 0, "SphereMesh");
diff --git a/src/quick3d/imports/input/plugins.qmltypes b/src/quick3d/imports/input/plugins.qmltypes
index 860ab4d68..24655977e 100644
--- a/src/quick3d/imports/input/plugins.qmltypes
+++ b/src/quick3d/imports/input/plugins.qmltypes
@@ -4,10 +4,10 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable Qt3D.Input 2.0'
+// 'qmlplugindump -nonrelocatable Qt3D.Input 2.1'
Module {
- dependencies: ["QtQuick 2.7"]
+ dependencies: ["QtQuick 2.8"]
Component {
name: "Qt3DCore::QComponent"
prototype: "Qt3DCore::QNode"
@@ -16,6 +16,14 @@ Module {
name: "shareableChanged"
Parameter { name: "isShareable"; type: "bool" }
}
+ Signal {
+ name: "addedToEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
+ Signal {
+ name: "removedFromEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
Method {
name: "setShareable"
Parameter { name: "isShareable"; type: "bool" }
@@ -24,8 +32,17 @@ Module {
Component {
name: "Qt3DCore::QNode"
prototype: "QObject"
+ Enum {
+ name: "PropertyTrackingMode"
+ values: {
+ "TrackFinalValues": 0,
+ "DontTrackValues": 1,
+ "TrackAllValues": 2
+ }
+ }
Property { name: "parent"; type: "Qt3DCore::QNode"; isPointer: true }
Property { name: "enabled"; type: "bool" }
+ Property { name: "defaultPropertyTrackingMode"; revision: 9; type: "PropertyTrackingMode" }
Signal {
name: "parentChanged"
Parameter { name: "parent"; type: "QObject"; isPointer: true }
@@ -34,6 +51,10 @@ Module {
name: "enabledChanged"
Parameter { name: "enabled"; type: "bool" }
}
+ Signal {
+ name: "defaultPropertyTrackingModeChanged"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
Signal { name: "nodeDestroyed" }
Method {
name: "setParent"
@@ -43,6 +64,10 @@ Module {
name: "setEnabled"
Parameter { name: "isEnabled"; type: "bool" }
}
+ Method {
+ name: "setDefaultPropertyTrackingMode"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
}
Component {
name: "Qt3DInput::Input::Quick::Quick3DAction"
@@ -101,6 +126,7 @@ Module {
name: "Qt3DInput::Input::Quick::Quick3DPhysicalDevice"
prototype: "Qt3DInput::QAbstractPhysicalDevice"
exports: ["Qt3D.Input/QAbstractPhysicalDevice 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Property { name: "axisSettings"; type: "Qt3DInput::QAxisSetting"; isList: true; isReadonly: true }
}
@@ -186,6 +212,56 @@ Module {
}
}
Component {
+ name: "Qt3DInput::QAxisAccumulator"
+ prototype: "Qt3DCore::QComponent"
+ exports: ["Qt3D.Input/AxisAccumulator 2.1"]
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "SourceAxisType"
+ values: {
+ "Velocity": 0,
+ "Acceleration": 1
+ }
+ }
+ Property { name: "sourceAxis"; type: "Qt3DInput::QAxis"; isPointer: true }
+ Property { name: "sourceAxisType"; type: "SourceAxisType" }
+ Property { name: "scale"; type: "float" }
+ Property { name: "value"; type: "float"; isReadonly: true }
+ Property { name: "velocity"; type: "float"; isReadonly: true }
+ Signal {
+ name: "sourceAxisChanged"
+ Parameter { name: "sourceAxis"; type: "Qt3DInput::QAxis"; isPointer: true }
+ }
+ Signal {
+ name: "sourceAxisTypeChanged"
+ Parameter { name: "sourceAxisType"; type: "QAxisAccumulator::SourceAxisType" }
+ }
+ Signal {
+ name: "valueChanged"
+ Parameter { name: "value"; type: "float" }
+ }
+ Signal {
+ name: "velocityChanged"
+ Parameter { name: "value"; type: "float" }
+ }
+ Signal {
+ name: "scaleChanged"
+ Parameter { name: "scale"; type: "float" }
+ }
+ Method {
+ name: "setSourceAxis"
+ Parameter { name: "sourceAxis"; type: "Qt3DInput::QAxis"; isPointer: true }
+ }
+ Method {
+ name: "setSourceAxisType"
+ Parameter { name: "sourceAxisType"; type: "QAxisAccumulator::SourceAxisType" }
+ }
+ Method {
+ name: "setScale"
+ Parameter { name: "scale"; type: "float" }
+ }
+ }
+ Component {
name: "Qt3DInput::QAxisSetting"
prototype: "Qt3DCore::QNode"
exports: ["Qt3D.Input/AxisSetting 2.0"]
@@ -337,7 +413,6 @@ Module {
Component {
name: "Qt3DInput::QKeyboardDevice"
prototype: "Qt3DInput::QAbstractPhysicalDevice"
- exports: ["Qt3D.Input/KeyboardDevice 2.0"]
Property {
name: "activeInput"
type: "Qt3DInput::QKeyboardHandler"
@@ -537,12 +612,13 @@ Module {
Component {
name: "Qt3DInput::QMouseDevice"
prototype: "Qt3DInput::QAbstractPhysicalDevice"
- exports: ["Qt3D.Input/MouseDevice 2.0"]
Enum {
name: "Axis"
values: {
"X": 0,
- "Y": 1
+ "Y": 1,
+ "WheelX": 2,
+ "WheelY": 3
}
}
Property { name: "sensitivity"; type: "float" }
diff --git a/src/quick3d/imports/input/qt3dquick3dinputplugin.cpp b/src/quick3d/imports/input/qt3dquick3dinputplugin.cpp
index 9d83f964f..5719a2b98 100644
--- a/src/quick3d/imports/input/qt3dquick3dinputplugin.cpp
+++ b/src/quick3d/imports/input/qt3dquick3dinputplugin.cpp
@@ -81,7 +81,9 @@ void Qt3DQuick3DInputPlugin::registerTypes(const char *uri)
qmlRegisterType<Qt3DInput::QInputSettings>(uri, 2, 0, "InputSettings");
qmlRegisterUncreatableType<Qt3DInput::QMouseEvent>(uri, 2, 0, "MouseEvent", QStringLiteral("Events cannot be created"));
+#if QT_CONFIG(wheelevent)
qmlRegisterUncreatableType<Qt3DInput::QWheelEvent>(uri, 2, 0, "WheelEvent", QStringLiteral("Events cannot be created"));
+#endif
qmlRegisterType<Qt3DInput::QMouseHandler>(uri, 2, 0, "MouseHandler");
qmlRegisterType<Qt3DInput::QMouseDevice>(uri, 2, 0, "MouseDevice");
diff --git a/src/quick3d/imports/logic/plugins.qmltypes b/src/quick3d/imports/logic/plugins.qmltypes
index 0c0ccc847..61b67ca73 100644
--- a/src/quick3d/imports/logic/plugins.qmltypes
+++ b/src/quick3d/imports/logic/plugins.qmltypes
@@ -7,7 +7,7 @@ import QtQuick.tooling 1.2
// 'qmlplugindump -nonrelocatable Qt3D.Logic 2.0'
Module {
- dependencies: ["QtQuick 2.7"]
+ dependencies: ["QtQuick 2.8"]
Component {
name: "Qt3DCore::QComponent"
prototype: "Qt3DCore::QNode"
@@ -16,6 +16,14 @@ Module {
name: "shareableChanged"
Parameter { name: "isShareable"; type: "bool" }
}
+ Signal {
+ name: "addedToEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
+ Signal {
+ name: "removedFromEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
Method {
name: "setShareable"
Parameter { name: "isShareable"; type: "bool" }
@@ -24,8 +32,17 @@ Module {
Component {
name: "Qt3DCore::QNode"
prototype: "QObject"
+ Enum {
+ name: "PropertyTrackingMode"
+ values: {
+ "TrackFinalValues": 0,
+ "DontTrackValues": 1,
+ "TrackAllValues": 2
+ }
+ }
Property { name: "parent"; type: "Qt3DCore::QNode"; isPointer: true }
Property { name: "enabled"; type: "bool" }
+ Property { name: "defaultPropertyTrackingMode"; revision: 9; type: "PropertyTrackingMode" }
Signal {
name: "parentChanged"
Parameter { name: "parent"; type: "QObject"; isPointer: true }
@@ -34,6 +51,10 @@ Module {
name: "enabledChanged"
Parameter { name: "enabled"; type: "bool" }
}
+ Signal {
+ name: "defaultPropertyTrackingModeChanged"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
Signal { name: "nodeDestroyed" }
Method {
name: "setParent"
@@ -43,6 +64,10 @@ Module {
name: "setEnabled"
Parameter { name: "isEnabled"; type: "bool" }
}
+ Method {
+ name: "setDefaultPropertyTrackingMode"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
}
Component {
name: "Qt3DLogic::QFrameAction"
diff --git a/src/quick3d/imports/render/plugins.qmltypes b/src/quick3d/imports/render/plugins.qmltypes
index 9e6e5fe38..aa0272430 100644
--- a/src/quick3d/imports/render/plugins.qmltypes
+++ b/src/quick3d/imports/render/plugins.qmltypes
@@ -4,10 +4,10 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable Qt3D.Render 2.0'
+// 'qmlplugindump -nonrelocatable Qt3D.Render 2.9'
Module {
- dependencies: ["QtQuick 2.7"]
+ dependencies: ["QtQuick 2.8"]
Component {
name: "QWindow"
prototype: "QObject"
@@ -25,6 +25,13 @@ Module {
"FullScreen": 5
}
}
+ Enum {
+ name: "AncestorMode"
+ values: {
+ "ExcludeTransients": 0,
+ "IncludeTransients": 1
+ }
+ }
Property { name: "title"; type: "string" }
Property { name: "modality"; type: "Qt::WindowModality" }
Property { name: "flags"; type: "Qt::WindowFlags" }
@@ -178,6 +185,14 @@ Module {
name: "shareableChanged"
Parameter { name: "isShareable"; type: "bool" }
}
+ Signal {
+ name: "addedToEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
+ Signal {
+ name: "removedFromEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
Method {
name: "setShareable"
Parameter { name: "isShareable"; type: "bool" }
@@ -187,8 +202,17 @@ Module {
Component {
name: "Qt3DCore::QNode"
prototype: "QObject"
+ Enum {
+ name: "PropertyTrackingMode"
+ values: {
+ "TrackFinalValues": 0,
+ "DontTrackValues": 1,
+ "TrackAllValues": 2
+ }
+ }
Property { name: "parent"; type: "Qt3DCore::QNode"; isPointer: true }
Property { name: "enabled"; type: "bool" }
+ Property { name: "defaultPropertyTrackingMode"; revision: 9; type: "PropertyTrackingMode" }
Signal {
name: "parentChanged"
Parameter { name: "parent"; type: "QObject"; isPointer: true }
@@ -197,6 +221,10 @@ Module {
name: "enabledChanged"
Parameter { name: "enabled"; type: "bool" }
}
+ Signal {
+ name: "defaultPropertyTrackingModeChanged"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
Signal { name: "nodeDestroyed" }
Method {
name: "setParent"
@@ -206,6 +234,10 @@ Module {
name: "setEnabled"
Parameter { name: "isEnabled"; type: "bool" }
}
+ Method {
+ name: "setDefaultPropertyTrackingMode"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
}
Component {
name: "Qt3DCore::Quick::Quick3DNode"
@@ -404,7 +436,8 @@ Module {
"CubeMapPositiveY": 34071,
"CubeMapNegativeY": 34072,
"CubeMapPositiveZ": 34073,
- "CubeMapNegativeZ": 34074
+ "CubeMapNegativeZ": 34074,
+ "AllFaces": 34075
}
}
Enum {
@@ -446,6 +479,7 @@ Module {
Property { name: "comparisonFunction"; type: "ComparisonFunction" }
Property { name: "comparisonMode"; type: "ComparisonMode" }
Property { name: "layers"; type: "int" }
+ Property { name: "samples"; type: "int" }
Signal {
name: "formatChanged"
Parameter { name: "format"; type: "TextureFormat" }
@@ -494,6 +528,10 @@ Module {
name: "layersChanged"
Parameter { name: "layers"; type: "int" }
}
+ Signal {
+ name: "samplesChanged"
+ Parameter { name: "samples"; type: "int" }
+ }
Method {
name: "setFormat"
Parameter { name: "format"; type: "TextureFormat" }
@@ -538,6 +576,10 @@ Module {
name: "setLayers"
Parameter { name: "layers"; type: "int" }
}
+ Method {
+ name: "setSamples"
+ Parameter { name: "samples"; type: "int" }
+ }
}
Component {
name: "Qt3DRender::QAbstractTextureImage"
@@ -625,7 +667,8 @@ Module {
name: "AttributeType"
values: {
"VertexAttribute": 0,
- "IndexAttribute": 1
+ "IndexAttribute": 1,
+ "DrawIndirectAttribute": 2
}
}
Enum {
@@ -651,6 +694,11 @@ Module {
Property { name: "byteOffset"; type: "uint" }
Property { name: "divisor"; type: "uint" }
Property { name: "attributeType"; type: "AttributeType" }
+ Property { name: "defaultPositionAttributeName"; type: "string"; isReadonly: true }
+ Property { name: "defaultNormalAttributeName"; type: "string"; isReadonly: true }
+ Property { name: "defaultColorAttributeName"; type: "string"; isReadonly: true }
+ Property { name: "defaultTextureCoordinateAttributeName"; type: "string"; isReadonly: true }
+ Property { name: "defaultTangentAttributeName"; type: "string"; isReadonly: true }
Signal {
name: "bufferChanged"
Parameter { name: "buffer"; type: "QBuffer"; isPointer: true }
@@ -660,6 +708,14 @@ Module {
Parameter { name: "name"; type: "string" }
}
Signal {
+ name: "vertexBaseTypeChanged"
+ Parameter { name: "vertexBaseType"; type: "VertexBaseType" }
+ }
+ Signal {
+ name: "vertexSizeChanged"
+ Parameter { name: "vertexSize"; type: "uint" }
+ }
+ Signal {
name: "dataTypeChanged"
Parameter { name: "vertexBaseType"; type: "VertexBaseType" }
}
@@ -696,6 +752,14 @@ Module {
Parameter { name: "name"; type: "string" }
}
Method {
+ name: "setVertexBaseType"
+ Parameter { name: "type"; type: "VertexBaseType" }
+ }
+ Method {
+ name: "setVertexSize"
+ Parameter { name: "size"; type: "uint" }
+ }
+ Method {
name: "setDataType"
Parameter { name: "type"; type: "VertexBaseType" }
}
@@ -780,7 +844,8 @@ Module {
"OneMinusConstantColor": 32770,
"OneMinusConstantAlpha": 32772,
"OneMinusSource1Alpha": 32773,
- "OneMinusSource1Color": 32774
+ "OneMinusSource1Color": 32774,
+ "OneMinusSource1Color0": 32774
}
}
Property { name: "sourceRgb"; type: "Blending" }
@@ -848,6 +913,9 @@ Module {
Component {
name: "Qt3DRender::QBuffer"
prototype: "Qt3DCore::QNode"
+ exports: ["Qt3D.Render/BufferBase 2.0", "Qt3D.Render/BufferBase 2.9"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0, 9]
Enum {
name: "BufferType"
values: {
@@ -856,7 +924,8 @@ Module {
"PixelPackBuffer": 35051,
"PixelUnpackBuffer": 35052,
"UniformBuffer": 35345,
- "ShaderStorageBuffer": 37074
+ "ShaderStorageBuffer": 37074,
+ "DrawIndirectBuffer": 36671
}
}
Enum {
@@ -873,9 +942,18 @@ Module {
"DynamicCopy": 35050
}
}
+ Enum {
+ name: "AccessType"
+ values: {
+ "Write": 1,
+ "Read": 2,
+ "ReadWrite": 3
+ }
+ }
Property { name: "type"; type: "BufferType" }
Property { name: "usage"; type: "UsageType" }
Property { name: "syncData"; type: "bool" }
+ Property { name: "accessType"; revision: 9; type: "AccessType" }
Signal {
name: "dataChanged"
Parameter { name: "bytes"; type: "QByteArray" }
@@ -892,6 +970,11 @@ Module {
name: "syncDataChanged"
Parameter { name: "syncData"; type: "bool" }
}
+ Signal {
+ name: "accessTypeChanged"
+ Parameter { name: "access"; type: "AccessType" }
+ }
+ Signal { name: "dataAvailable" }
Method {
name: "setType"
Parameter { name: "type"; type: "BufferType" }
@@ -904,6 +987,21 @@ Module {
name: "setSyncData"
Parameter { name: "syncData"; type: "bool" }
}
+ Method {
+ name: "setAccessType"
+ Parameter { name: "access"; type: "AccessType" }
+ }
+ Method {
+ name: "updateData"
+ Parameter { name: "offset"; type: "int" }
+ Parameter { name: "bytes"; type: "QByteArray" }
+ }
+ }
+ Component {
+ name: "Qt3DRender::QBufferCapture"
+ prototype: "Qt3DRender::QFrameGraphNode"
+ exports: ["Qt3D.Render/BufferCapture 2.9"]
+ exportMetaObjectRevisions: [0]
}
Component {
name: "Qt3DRender::QCamera"
@@ -927,6 +1025,7 @@ Module {
Property { name: "bottom"; type: "float" }
Property { name: "top"; type: "float" }
Property { name: "projectionMatrix"; type: "QMatrix4x4" }
+ Property { name: "exposure"; revision: 9; type: "float" }
Property { name: "position"; type: "QVector3D" }
Property { name: "upVector"; type: "QVector3D" }
Property { name: "viewCenter"; type: "QVector3D" }
@@ -973,6 +1072,10 @@ Module {
Parameter { name: "projectionMatrix"; type: "QMatrix4x4" }
}
Signal {
+ name: "exposureChanged"
+ Parameter { name: "exposure"; type: "float" }
+ }
+ Signal {
name: "positionChanged"
Parameter { name: "position"; type: "QVector3D" }
}
@@ -1029,6 +1132,10 @@ Module {
Parameter { name: "projectionMatrix"; type: "QMatrix4x4" }
}
Method {
+ name: "setExposure"
+ Parameter { name: "exposure"; type: "float" }
+ }
+ Method {
name: "setPosition"
Parameter { name: "position"; type: "QVector3D" }
}
@@ -1146,6 +1253,7 @@ Module {
Property { name: "bottom"; type: "float" }
Property { name: "top"; type: "float" }
Property { name: "projectionMatrix"; type: "QMatrix4x4" }
+ Property { name: "exposure"; revision: 9; type: "float" }
Signal {
name: "projectionTypeChanged"
Parameter { name: "projectionType"; type: "QCameraLens::ProjectionType" }
@@ -1186,6 +1294,10 @@ Module {
name: "projectionMatrixChanged"
Parameter { name: "projectionMatrix"; type: "QMatrix4x4" }
}
+ Signal {
+ name: "exposureChanged"
+ Parameter { name: "exposure"; type: "float" }
+ }
Method {
name: "setProjectionType"
Parameter { name: "projectionType"; type: "ProjectionType" }
@@ -1226,6 +1338,10 @@ Module {
name: "setProjectionMatrix"
Parameter { name: "projectionMatrix"; type: "QMatrix4x4" }
}
+ Method {
+ name: "setExposure"
+ Parameter { name: "exposure"; type: "float" }
+ }
}
Component {
name: "Qt3DRender::QCameraSelector"
@@ -1496,6 +1612,34 @@ Module {
}
Component { name: "Qt3DRender::QEffect"; prototype: "Qt3DCore::QNode" }
Component {
+ name: "Qt3DRender::QEnvironmentLight"
+ prototype: "Qt3DCore::QComponent"
+ exports: ["Qt3D.Render/EnvironmentLight 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "irradiance"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Property { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Signal {
+ name: "irradianceChanged"
+ Parameter {
+ name: "environmentIrradiance"
+ type: "Qt3DRender::QAbstractTexture"
+ isPointer: true
+ }
+ }
+ Signal {
+ name: "specularChanged"
+ Parameter { name: "environmentSpecular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setIrradiance"
+ Parameter { name: "irradiance"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setSpecular"
+ Parameter { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ }
+ Component {
name: "Qt3DRender::QFilterKey"
prototype: "Qt3DCore::QNode"
exports: ["Qt3D.Render/FilterKey 2.0"]
@@ -1523,7 +1667,6 @@ Module {
name: "Qt3DRender::QFrameGraphNode"
prototype: "Qt3DCore::QNode"
exports: ["Qt3D.Render/FrameGraphNode 2.0"]
- isCreatable: false
exportMetaObjectRevisions: [0]
}
Component {
@@ -1776,6 +1919,76 @@ Module {
}
Component { name: "Qt3DRender::QLayerFilter"; prototype: "Qt3DRender::QFrameGraphNode" }
Component {
+ name: "Qt3DRender::QLevelOfDetail"
+ prototype: "Qt3DCore::QComponent"
+ exports: ["Qt3D.Render/LevelOfDetail 2.9"]
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "ThresholdType"
+ values: {
+ "DistanceToCameraThreshold": 0,
+ "ProjectedScreenPixelSizeThreshold": 1
+ }
+ }
+ Property { name: "camera"; type: "Qt3DRender::QCamera"; isPointer: true }
+ Property { name: "currentIndex"; type: "int" }
+ Property { name: "thresholdType"; type: "ThresholdType" }
+ Property { name: "thresholds"; type: "QVector<qreal>" }
+ Property { name: "volumeOverride"; type: "Qt3DRender::QLevelOfDetailBoundingSphere" }
+ Signal {
+ name: "cameraChanged"
+ Parameter { name: "camera"; type: "QCamera"; isPointer: true }
+ }
+ Signal {
+ name: "currentIndexChanged"
+ Parameter { name: "currentIndex"; type: "int" }
+ }
+ Signal {
+ name: "thresholdTypeChanged"
+ Parameter { name: "thresholdType"; type: "ThresholdType" }
+ }
+ Signal {
+ name: "thresholdsChanged"
+ Parameter { name: "thresholds"; type: "QVector<qreal>" }
+ }
+ Signal {
+ name: "volumeOverrideChanged"
+ Parameter { name: "volumeOverride"; type: "QLevelOfDetailBoundingSphere" }
+ }
+ Method {
+ name: "setCamera"
+ Parameter { name: "camera"; type: "QCamera"; isPointer: true }
+ }
+ Method {
+ name: "setCurrentIndex"
+ Parameter { name: "currentIndex"; type: "int" }
+ }
+ Method {
+ name: "setThresholdType"
+ Parameter { name: "thresholdType"; type: "ThresholdType" }
+ }
+ Method {
+ name: "setThresholds"
+ Parameter { name: "thresholds"; type: "QVector<qreal>" }
+ }
+ Method {
+ name: "setVolumeOverride"
+ Parameter { name: "volumeOverride"; type: "QLevelOfDetailBoundingSphere" }
+ }
+ Method {
+ name: "createBoundingSphere"
+ type: "QLevelOfDetailBoundingSphere"
+ Parameter { name: "center"; type: "QVector3D" }
+ Parameter { name: "radius"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DRender::QLevelOfDetailSwitch"
+ prototype: "Qt3DRender::QLevelOfDetail"
+ exports: ["Qt3D.Render/LevelOfDetailSwitch 2.9"]
+ exportMetaObjectRevisions: [0]
+ }
+ Component {
name: "Qt3DRender::QMaterial"
prototype: "Qt3DCore::QComponent"
Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true }
@@ -1789,6 +2002,39 @@ Module {
}
}
Component {
+ name: "Qt3DRender::QMemoryBarrier"
+ prototype: "Qt3DRender::QFrameGraphNode"
+ Enum {
+ name: "Operation"
+ values: {
+ "None": 0,
+ "VertexAttributeArray": 1,
+ "ElementArray": 2,
+ "Uniform": 4,
+ "TextureFetch": 8,
+ "ShaderImageAccess": 16,
+ "Command": 32,
+ "PixelBuffer": 64,
+ "TextureUpdate": 128,
+ "BufferUpdate": 256,
+ "FrameBuffer": 512,
+ "TransformFeedback": 1024,
+ "AtomicCounter": 2048,
+ "ShaderStorage": 4096,
+ "QueryBuffer": 8192,
+ "All": -1
+ }
+ }
+ Signal {
+ name: "waitOperationsChanged"
+ Parameter { name: "barrierTypes"; type: "QMemoryBarrier::Operations" }
+ }
+ Method {
+ name: "setWaitOperations"
+ Parameter { name: "operations"; type: "QMemoryBarrier::Operations" }
+ }
+ }
+ Component {
name: "Qt3DRender::QMesh"
prototype: "Qt3DRender::QGeometryRenderer"
exports: ["Qt3D.Render/Mesh 2.0"]
@@ -1913,11 +2159,35 @@ Module {
exports: ["Qt3D.Render/PickEvent 2.0"]
isCreatable: false
exportMetaObjectRevisions: [0]
+ Enum {
+ name: "Buttons"
+ values: {
+ "LeftButton": 1,
+ "RightButton": 2,
+ "MiddleButton": 4,
+ "BackButton": 8,
+ "NoButton": 0
+ }
+ }
+ Enum {
+ name: "Modifiers"
+ values: {
+ "NoModifier": 0,
+ "ShiftModifier": 33554432,
+ "ControlModifier": 67108864,
+ "AltModifier": 134217728,
+ "MetaModifier": 268435456,
+ "KeypadModifier": 536870912
+ }
+ }
Property { name: "accepted"; type: "bool" }
Property { name: "position"; type: "QPointF"; isReadonly: true }
Property { name: "distance"; type: "float"; isReadonly: true }
Property { name: "localIntersection"; type: "QVector3D"; isReadonly: true }
Property { name: "worldIntersection"; type: "QVector3D"; isReadonly: true }
+ Property { name: "button"; type: "Qt3DRender::QPickEvent::Buttons"; isReadonly: true }
+ Property { name: "buttons"; type: "int"; isReadonly: true }
+ Property { name: "modifiers"; type: "int"; isReadonly: true }
Signal {
name: "acceptedChanged"
Parameter { name: "accepted"; type: "bool" }
@@ -1946,8 +2216,17 @@ Module {
"AllPicks": 1
}
}
+ Enum {
+ name: "FaceOrientationPickingMode"
+ values: {
+ "FrontFace": 1,
+ "BackFace": 2,
+ "FrontAndBackFace": 3
+ }
+ }
Property { name: "pickMethod"; type: "PickMethod" }
Property { name: "pickResultMode"; type: "PickResultMode" }
+ Property { name: "faceOrientationPickingMode"; type: "FaceOrientationPickingMode" }
Signal {
name: "pickMethodChanged"
Parameter { name: "pickMethod"; type: "QPickingSettings::PickMethod" }
@@ -1956,6 +2235,13 @@ Module {
name: "pickResultModeChanged"
Parameter { name: "pickResult"; type: "QPickingSettings::PickResultMode" }
}
+ Signal {
+ name: "faceOrientationPickingModeChanged"
+ Parameter {
+ name: "faceOrientationPickingMode"
+ type: "QPickingSettings::FaceOrientationPickingMode"
+ }
+ }
Method {
name: "setPickMethod"
Parameter { name: "pickMethod"; type: "PickMethod" }
@@ -1964,6 +2250,10 @@ Module {
name: "setPickResultMode"
Parameter { name: "pickResultMode"; type: "PickResultMode" }
}
+ Method {
+ name: "setFaceOrientationPickingMode"
+ Parameter { name: "faceOrientationPickingMode"; type: "FaceOrientationPickingMode" }
+ }
}
Component {
name: "Qt3DRender::QPointLight"
@@ -2054,6 +2344,42 @@ Module {
}
}
Component {
+ name: "Qt3DRender::QRenderCapture"
+ prototype: "Qt3DRender::QFrameGraphNode"
+ exports: ["Qt3D.Render/RenderCapture 2.1"]
+ exportMetaObjectRevisions: [0]
+ Method {
+ name: "requestCapture"
+ type: "Qt3DRender::QRenderCaptureReply*"
+ Parameter { name: "captureId"; type: "int" }
+ }
+ Method { name: "requestCapture"; revision: 9; type: "Qt3DRender::QRenderCaptureReply*" }
+ }
+ Component {
+ name: "Qt3DRender::QRenderCaptureReply"
+ prototype: "QObject"
+ exports: ["Qt3D.Render/RenderCaptureReply 2.1"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ Property { name: "image"; type: "QImage"; isReadonly: true }
+ Property { name: "captureId"; type: "int"; isReadonly: true }
+ Property { name: "complete"; type: "bool"; isReadonly: true }
+ Signal {
+ name: "completeChanged"
+ Parameter { name: "isComplete"; type: "bool" }
+ }
+ Signal { name: "completed" }
+ Method {
+ name: "saveImage"
+ type: "bool"
+ Parameter { name: "fileName"; type: "string" }
+ }
+ Method {
+ name: "saveToFile"
+ Parameter { name: "fileName"; type: "string" }
+ }
+ }
+ Component {
name: "Qt3DRender::QRenderPass"
prototype: "Qt3DCore::QNode"
Property { name: "shaderProgram"; type: "Qt3DRender::QShaderProgram"; isPointer: true }
@@ -2119,7 +2445,7 @@ Module {
exports: ["Qt3D.Render/RenderSurfaceSelector 2.0"]
exportMetaObjectRevisions: [0]
Property { name: "surface"; type: "QObject"; isPointer: true }
- Property { name: "externalRenderTargetSize"; type: "QSize"; isReadonly: true }
+ Property { name: "externalRenderTargetSize"; type: "QSize" }
Property { name: "surfacePixelRatio"; type: "float" }
Signal {
name: "surfaceChanged"
@@ -2141,6 +2467,10 @@ Module {
name: "setSurfacePixelRatio"
Parameter { name: "ratio"; type: "float" }
}
+ Method {
+ name: "setExternalRenderTargetSize"
+ Parameter { name: "size"; type: "QSize" }
+ }
}
Component { name: "Qt3DRender::QRenderTarget"; prototype: "Qt3DCore::QComponent" }
Component {
@@ -2176,7 +2506,7 @@ Module {
Property { name: "texture"; type: "QAbstractTexture"; isPointer: true }
Property { name: "mipLevel"; type: "int" }
Property { name: "layer"; type: "int" }
- Property { name: "face"; type: "QAbstractTexture::CubeMapFace" }
+ Property { name: "face"; type: "Qt3DRender::QAbstractTexture::CubeMapFace" }
Signal {
name: "attachmentPointChanged"
Parameter { name: "attachmentPoint"; type: "AttachmentPoint" }
@@ -2243,6 +2573,17 @@ Module {
"Error": 3
}
}
+ Enum {
+ name: "ComponentType"
+ values: {
+ "UnknownComponent": 0,
+ "GeometryRendererComponent": 1,
+ "TransformComponent": 2,
+ "MaterialComponent": 3,
+ "LightComponent": 4,
+ "CameraLensComponent": 5
+ }
+ }
Property { name: "source"; type: "QUrl" }
Property { name: "status"; type: "Status"; isReadonly: true }
Signal {
@@ -2261,6 +2602,20 @@ Module {
name: "setStatus"
Parameter { name: "status"; type: "Status" }
}
+ Method {
+ name: "entity"
+ revision: 9
+ type: "Qt3DCore::QEntity*"
+ Parameter { name: "entityName"; type: "string" }
+ }
+ Method { name: "entityNames"; revision: 9; type: "QStringList" }
+ Method {
+ name: "component"
+ revision: 9
+ type: "Qt3DCore::QComponent*"
+ Parameter { name: "entityName"; type: "string" }
+ Parameter { name: "componentType"; type: "ComponentType" }
+ }
}
Component {
name: "Qt3DRender::QScissorTest"
@@ -2333,12 +2688,22 @@ Module {
"Compute": 5
}
}
+ Enum {
+ name: "Status"
+ values: {
+ "NotReady": 0,
+ "Ready": 1,
+ "Error": 2
+ }
+ }
Property { name: "vertexShaderCode"; type: "QByteArray" }
Property { name: "tessellationControlShaderCode"; type: "QByteArray" }
Property { name: "tessellationEvaluationShaderCode"; type: "QByteArray" }
Property { name: "geometryShaderCode"; type: "QByteArray" }
Property { name: "fragmentShaderCode"; type: "QByteArray" }
Property { name: "computeShaderCode"; type: "QByteArray" }
+ Property { name: "log"; revision: 9; type: "string"; isReadonly: true }
+ Property { name: "status"; revision: 9; type: "Status"; isReadonly: true }
Signal {
name: "vertexShaderCodeChanged"
Parameter { name: "vertexShaderCode"; type: "QByteArray" }
@@ -2363,6 +2728,14 @@ Module {
name: "computeShaderCodeChanged"
Parameter { name: "computeShaderCode"; type: "QByteArray" }
}
+ Signal {
+ name: "logChanged"
+ Parameter { name: "log"; type: "string" }
+ }
+ Signal {
+ name: "statusChanged"
+ Parameter { name: "status"; type: "Status" }
+ }
Method {
name: "setVertexShaderCode"
Parameter { name: "vertexShaderCode"; type: "QByteArray" }
@@ -2701,6 +3074,7 @@ Module {
}
Property { name: "source"; type: "QUrl" }
Property { name: "status"; type: "Status"; isReadonly: true }
+ Property { name: "mirrored"; type: "bool" }
Signal {
name: "sourceChanged"
Parameter { name: "source"; type: "QUrl" }
@@ -2709,23 +3083,40 @@ Module {
name: "statusChanged"
Parameter { name: "status"; type: "Status" }
}
+ Signal {
+ name: "mirroredChanged"
+ Parameter { name: "mirrored"; type: "bool" }
+ }
Method {
name: "setSource"
Parameter { name: "source"; type: "QUrl" }
}
+ Method {
+ name: "setMirrored"
+ Parameter { name: "mirrored"; type: "bool" }
+ }
}
Component {
name: "Qt3DRender::QTextureLoader"
prototype: "Qt3DRender::QAbstractTexture"
Property { name: "source"; type: "QUrl" }
+ Property { name: "mirrored"; type: "bool" }
Signal {
name: "sourceChanged"
Parameter { name: "source"; type: "QUrl" }
}
+ Signal {
+ name: "mirroredChanged"
+ Parameter { name: "mirrored"; type: "bool" }
+ }
Method {
name: "setSource"
Parameter { name: "source"; type: "QUrl" }
}
+ Method {
+ name: "setMirrored"
+ Parameter { name: "mirrored"; type: "bool" }
+ }
}
Component { name: "Qt3DRender::QTextureRectangle"; prototype: "Qt3DRender::QAbstractTexture" }
Component {
@@ -2774,14 +3165,23 @@ Module {
name: "Qt3DRender::QViewport"
prototype: "Qt3DRender::QFrameGraphNode"
Property { name: "normalizedRect"; type: "QRectF" }
+ Property { name: "gamma"; revision: 9; type: "float" }
Signal {
name: "normalizedRectChanged"
Parameter { name: "normalizedRect"; type: "QRectF" }
}
+ Signal {
+ name: "gammaChanged"
+ Parameter { name: "gamma"; type: "float" }
+ }
Method {
name: "setNormalizedRect"
Parameter { name: "normalizedRect"; type: "QRectF" }
}
+ Method {
+ name: "setGamma"
+ Parameter { name: "gamma"; type: "float" }
+ }
}
Component {
name: "Qt3DRender::Render::Quick::Quick3DBuffer"
@@ -2790,7 +3190,16 @@ Module {
exportMetaObjectRevisions: [0]
Property { name: "data"; type: "QVariant" }
Signal { name: "bufferDataChanged" }
- Signal { name: "bufferDataChanged" }
+ Method {
+ name: "updateData"
+ Parameter { name: "offset"; type: "int" }
+ Parameter { name: "bytes"; type: "QVariant" }
+ }
+ Method {
+ name: "readBinaryFile"
+ type: "QVariant"
+ Parameter { name: "fileUrl"; type: "QUrl" }
+ }
}
Component {
name: "Qt3DRender::Render::Quick::Quick3DEffect"
@@ -2823,6 +3232,13 @@ Module {
Property { name: "parameters"; type: "Qt3DRender::QParameter"; isList: true; isReadonly: true }
}
Component {
+ name: "Qt3DRender::Render::Quick::Quick3DMemoryBarrier"
+ prototype: "Qt3DRender::QMemoryBarrier"
+ exports: ["Qt3D.Render/MemoryBarrier 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "waitFor"; type: "int" }
+ }
+ Component {
name: "Qt3DRender::Render::Quick::Quick3DParameter"
prototype: "Qt3DRender::QParameter"
exports: ["Qt3D.Render/Parameter 2.0"]
@@ -2921,7 +3337,7 @@ Module {
Component {
name: "Qt3DRender::Render::Quick::Quick3DTextureExtension"
defaultProperty: "textureImages"
- prototype: "Qt3DRender::QTextureLoader"
+ prototype: "Qt3DRender::QTextureRectangle"
exports: [
"Qt3D.Render/Texture1D 2.0",
"Qt3D.Render/Texture1DArray 2.0",
diff --git a/src/quick3d/imports/scene3d/scene3ditem.cpp b/src/quick3d/imports/scene3d/scene3ditem.cpp
index 6c285e133..c31f4aa97 100644
--- a/src/quick3d/imports/scene3d/scene3ditem.cpp
+++ b/src/quick3d/imports/scene3d/scene3ditem.cpp
@@ -223,7 +223,7 @@ void Scene3DItem::setWindowSurface(QObject *rootObject)
}
}
-void Scene3DItem::setItemArea(const QSize &area)
+void Scene3DItem::setItemArea(QSize area)
{
Qt3DRender::QRenderSurfaceSelector *surfaceSelector = Qt3DRender::QRenderSurfaceSelectorPrivate::find(m_entity);
if (surfaceSelector)
diff --git a/src/quick3d/imports/scene3d/scene3ditem_p.h b/src/quick3d/imports/scene3d/scene3ditem_p.h
index eb14645c3..e0ce3addc 100644
--- a/src/quick3d/imports/scene3d/scene3ditem_p.h
+++ b/src/quick3d/imports/scene3d/scene3ditem_p.h
@@ -88,7 +88,7 @@ public:
bool multisample() const;
void setMultisample(bool enable);
- void setItemArea(const QSize &area);
+ Q_INVOKABLE void setItemArea(QSize area);
bool isHoverEnabled() const;
enum CameraAspectRatioMode {
diff --git a/src/quick3d/imports/scene3d/scene3drenderer.cpp b/src/quick3d/imports/scene3d/scene3drenderer.cpp
index 88f3be3c1..b32191391 100644
--- a/src/quick3d/imports/scene3d/scene3drenderer.cpp
+++ b/src/quick3d/imports/scene3d/scene3drenderer.cpp
@@ -57,6 +57,17 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
+namespace {
+
+inline QMetaMethod setItemAreaMethod()
+{
+ const int idx = Scene3DItem::staticMetaObject.indexOfMethod("setItemArea(QSize)");
+ Q_ASSERT(idx != -1);
+ return Scene3DItem::staticMetaObject.method(idx);
+}
+
+} // anonymous
+
class ContextSaver
{
public:
@@ -250,8 +261,11 @@ void Scene3DRenderer::render()
const bool multisampleHasChanged = m_multisample != m_lastMultisample;
const bool forceRecreate = sizeHasChanged || multisampleHasChanged;
- if (sizeHasChanged)
- m_item->setItemArea(boundingRectSize);
+ if (sizeHasChanged) {
+ // We are in the QSGRenderThread (doing a direct call would result in a race)
+ static const QMetaMethod setItemArea = setItemAreaMethod();
+ setItemArea.invoke(m_item, Qt::QueuedConnection, Q_ARG(QSize, boundingRectSize));
+ }
// Rebuild FBO and textures if never created or a resize has occurred
if ((m_multisampledFBO.isNull() || forceRecreate) && m_multisample) {
diff --git a/src/quick3d/quick3d/qt3dquick_global.cpp b/src/quick3d/quick3d/qt3dquick_global.cpp
index ebf27e7ae..a98211991 100644
--- a/src/quick3d/quick3d/qt3dquick_global.cpp
+++ b/src/quick3d/quick3d/qt3dquick_global.cpp
@@ -659,9 +659,9 @@ public:
#undef ASSERT_VALID_SIZE
};
+static Quick3DValueTypeProvider valueTypeProvider;
static Quick3DValueTypeProvider *getValueTypeProvider()
{
- static Quick3DValueTypeProvider valueTypeProvider;
return &valueTypeProvider;
}
@@ -706,6 +706,11 @@ void Quick3D_initialize()
QQmlPrivate::qmlregister(QQmlPrivate::AutoParentRegistration, &autoparent);
}
+void Quick3D_uninitialize()
+{
+ QQml_removeValueTypeProvider(&valueTypeProvider);
+}
+
void Quick3D_registerType(const char *className, const char *quickName, int major, int minor)
{
QuickNodeFactory::instance()->registerType(className, quickName, major, minor);
diff --git a/src/quick3d/quick3d/qt3dquick_global_p.h b/src/quick3d/quick3d/qt3dquick_global_p.h
index d67209404..ffc603f91 100644
--- a/src/quick3d/quick3d/qt3dquick_global_p.h
+++ b/src/quick3d/quick3d/qt3dquick_global_p.h
@@ -62,6 +62,7 @@ namespace Qt3DCore {
namespace Quick {
QT3DQUICKSHARED_PRIVATE_EXPORT void Quick3D_initialize();
+QT3DQUICKSHARED_PRIVATE_EXPORT void Quick3D_uninitialize();
QT3DQUICKSHARED_PRIVATE_EXPORT void Quick3D_registerType(const char *className, const char *quickName, int major, int minor);
template<class T, class E> void registerExtendedType(const char *className, const char *quickName,
diff --git a/src/quick3d/quick3danimation/items/items.pri b/src/quick3d/quick3danimation/items/items.pri
index 3f19965b5..27adabbe4 100644
--- a/src/quick3d/quick3danimation/items/items.pri
+++ b/src/quick3d/quick3danimation/items/items.pri
@@ -4,7 +4,8 @@ SOURCES += \
$$PWD/quick3danimationgroup.cpp \
$$PWD/quick3dkeyframeanimation.cpp \
$$PWD/quick3dmorphinganimation.cpp \
- $$PWD/quick3dmorphtarget.cpp
+ $$PWD/quick3dmorphtarget.cpp \
+ $$PWD/quick3dvertexblendanimation.cpp
HEADERS += \
$$PWD/quick3dchannelmapper_p.h \
@@ -12,6 +13,7 @@ HEADERS += \
$$PWD/quick3danimationgroup_p.h \
$$PWD/quick3dkeyframeanimation_p.h \
$$PWD/quick3dmorphinganimation_p.h \
- $$PWD/quick3dmorphtarget_p.h
+ $$PWD/quick3dmorphtarget_p.h \
+ $$PWD/quick3dvertexblendanimation_p.h
INCLUDEPATH += $$PWD
diff --git a/src/quick3d/quick3danimation/items/quick3dvertexblendanimation.cpp b/src/quick3d/quick3danimation/items/quick3dvertexblendanimation.cpp
new file mode 100644
index 000000000..2dffb7858
--- /dev/null
+++ b/src/quick3d/quick3danimation/items/quick3dvertexblendanimation.cpp
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "quick3dvertexblendanimation_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DAnimation {
+namespace Quick {
+
+QQuick3DVertexBlendAnimation::QQuick3DVertexBlendAnimation(QObject *parent)
+ : QObject(parent)
+{
+}
+
+QQmlListProperty<Qt3DAnimation::QMorphTarget> QQuick3DVertexBlendAnimation::morphTargets()
+{
+ return QQmlListProperty<Qt3DAnimation::QMorphTarget>(this, 0,
+ &QQuick3DVertexBlendAnimation::appendMorphTarget,
+ &QQuick3DVertexBlendAnimation::morphTargetCount,
+ &QQuick3DVertexBlendAnimation::morphTargetAt,
+ &QQuick3DVertexBlendAnimation::clearMorphTargets);
+}
+
+void QQuick3DVertexBlendAnimation::appendMorphTarget(
+ QQmlListProperty<Qt3DAnimation::QMorphTarget> *list,
+ Qt3DAnimation::QMorphTarget *morphTarget)
+{
+ QQuick3DVertexBlendAnimation *animation
+ = qobject_cast<QQuick3DVertexBlendAnimation *>(list->object);
+ if (animation)
+ animation->parentVertexBlendAnimation()->addMorphTarget(morphTarget);
+}
+
+int QQuick3DVertexBlendAnimation::morphTargetCount(
+ QQmlListProperty<Qt3DAnimation::QMorphTarget> *list)
+{
+ QQuick3DVertexBlendAnimation *animation
+ = qobject_cast<QQuick3DVertexBlendAnimation *>(list->object);
+ if (animation)
+ return animation->parentVertexBlendAnimation()->morphTargetList().count();
+ return 0;
+}
+
+Qt3DAnimation::QMorphTarget *QQuick3DVertexBlendAnimation::morphTargetAt(
+ QQmlListProperty<Qt3DAnimation::QMorphTarget> *list,
+ int index)
+{
+ QQuick3DVertexBlendAnimation *animation
+ = qobject_cast<QQuick3DVertexBlendAnimation *>(list->object);
+ if (animation) {
+ return qobject_cast<Qt3DAnimation::QMorphTarget *>(
+ animation->parentVertexBlendAnimation()->morphTargetList().at(index));
+ }
+ return nullptr;
+}
+
+void QQuick3DVertexBlendAnimation::clearMorphTargets(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list)
+{
+ QQuick3DVertexBlendAnimation *animation
+ = qobject_cast<QQuick3DVertexBlendAnimation *>(list->object);
+ if (animation) {
+ QVector<Qt3DAnimation::QMorphTarget *> emptyList;
+ animation->parentVertexBlendAnimation()->setMorphTargets(emptyList);
+ }
+}
+
+} // namespace Quick
+} // namespace Qt3DAnimation
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/quick3danimation/items/quick3dvertexblendanimation_p.h b/src/quick3d/quick3danimation/items/quick3dvertexblendanimation_p.h
new file mode 100644
index 000000000..6be2d662f
--- /dev/null
+++ b/src/quick3d/quick3danimation/items/quick3dvertexblendanimation_p.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3DANIMATION_QUICK_QUICK3DVERTEXBLENDANIMATION_P_H
+#define QT3DANIMATION_QUICK_QUICK3DVERTEXBLENDANIMATION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQml/qqmllist.h>
+
+#include <Qt3DAnimation/qvertexblendanimation.h>
+
+#include <private/qt3dquickanimation_global_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DAnimation {
+namespace Quick {
+
+class QT3DQUICKANIMATIONSHARED_PRIVATE_EXPORT QQuick3DVertexBlendAnimation : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlListProperty<Qt3DAnimation::QMorphTarget> morphTargets READ morphTargets)
+
+public:
+ QQuick3DVertexBlendAnimation(QObject *parent = nullptr);
+
+ inline QVertexBlendAnimation *parentVertexBlendAnimation() const
+ {
+ return qobject_cast<QVertexBlendAnimation *>(parent());
+ }
+
+ QQmlListProperty<Qt3DAnimation::QMorphTarget> morphTargets();
+
+private:
+
+ static void appendMorphTarget(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list,
+ Qt3DAnimation::QMorphTarget *morphTarget);
+ static Qt3DAnimation::QMorphTarget *morphTargetAt(
+ QQmlListProperty<Qt3DAnimation::QMorphTarget> *list,
+ int index);
+ static int morphTargetCount(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list);
+ static void clearMorphTargets(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list);
+};
+
+} // namespace Quick
+} // namespace Qt3DAnimation
+
+QT_END_NAMESPACE
+
+#endif // QT3DANIMATION_QUICK_QUICK3DMORPHINGANIMATION_P_H
diff --git a/src/quick3d/quick3dextras/qt3dquickwindow.cpp b/src/quick3d/quick3dextras/qt3dquickwindow.cpp
index 7f32f03f0..91773bb66 100644
--- a/src/quick3d/quick3dextras/qt3dquickwindow.cpp
+++ b/src/quick3d/quick3dextras/qt3dquickwindow.cpp
@@ -49,6 +49,7 @@
****************************************************************************/
#include <Qt3DQuickExtras/qt3dquickwindow.h>
+#include "qt3dquickwindow_p.h"
#include <Qt3DQuick/QQmlAspectEngine>
#include <Qt3DQuickExtras/qt3dquickwindow.h>
#include <Qt3DInput/qinputaspect.h>
@@ -96,16 +97,21 @@ private:
} // anonymous
-Qt3DQuickWindow::Qt3DQuickWindow(QWindow *parent)
- : QWindow(parent)
- , m_engine(nullptr)
+Qt3DQuickWindowPrivate::Qt3DQuickWindowPrivate()
+ : m_engine(nullptr)
, m_renderAspect(nullptr)
, m_inputAspect(nullptr)
, m_logicAspect(nullptr)
, m_initialized(false)
- , m_cameraAspectRatioMode(AutomaticAspectRatio)
+ , m_cameraAspectRatioMode(Qt3DQuickWindow::AutomaticAspectRatio)
, m_incubationController(nullptr)
{
+}
+
+Qt3DQuickWindow::Qt3DQuickWindow(QWindow *parent)
+ : QWindow(*new Qt3DQuickWindowPrivate(), parent)
+{
+ Q_D(Qt3DQuickWindow);
setSurfaceType(QSurface::OpenGLSurface);
resize(1024, 768);
@@ -125,78 +131,87 @@ Qt3DQuickWindow::Qt3DQuickWindow(QWindow *parent)
setFormat(format);
QSurfaceFormat::setDefaultFormat(format);
- m_engine.reset(new Qt3DCore::Quick::QQmlAspectEngine);
- m_renderAspect = new Qt3DRender::QRenderAspect;
- m_inputAspect = new Qt3DInput::QInputAspect;
- m_logicAspect = new Qt3DLogic::QLogicAspect;
+ d->m_engine = new Qt3DCore::Quick::QQmlAspectEngine;
+ d->m_renderAspect = new Qt3DRender::QRenderAspect;
+ d->m_inputAspect = new Qt3DInput::QInputAspect;
+ d->m_logicAspect = new Qt3DLogic::QLogicAspect;
- m_engine->aspectEngine()->registerAspect(m_renderAspect);
- m_engine->aspectEngine()->registerAspect(m_inputAspect);
- m_engine->aspectEngine()->registerAspect(m_logicAspect);
+ d->m_engine->aspectEngine()->registerAspect(d->m_renderAspect);
+ d->m_engine->aspectEngine()->registerAspect(d->m_inputAspect);
+ d->m_engine->aspectEngine()->registerAspect(d->m_logicAspect);
}
Qt3DQuickWindow::~Qt3DQuickWindow()
{
+ Q_D(Qt3DQuickWindow);
+ delete d->m_engine;
}
void Qt3DQuickWindow::registerAspect(Qt3DCore::QAbstractAspect *aspect)
{
Q_ASSERT(!isVisible());
- m_engine->aspectEngine()->registerAspect(aspect);
+ Q_D(Qt3DQuickWindow);
+ d->m_engine->aspectEngine()->registerAspect(aspect);
}
void Qt3DQuickWindow::registerAspect(const QString &name)
{
Q_ASSERT(!isVisible());
- m_engine->aspectEngine()->registerAspect(name);
+ Q_D(Qt3DQuickWindow);
+ d->m_engine->aspectEngine()->registerAspect(name);
}
void Qt3DQuickWindow::setSource(const QUrl &source)
{
- m_source = source;
+ Q_D(Qt3DQuickWindow);
+ d->m_source = source;
}
Qt3DCore::Quick::QQmlAspectEngine *Qt3DQuickWindow::engine() const
{
- return m_engine.data();
+ Q_D(const Qt3DQuickWindow);
+ return d->m_engine;
}
void Qt3DQuickWindow::setCameraAspectRatioMode(CameraAspectRatioMode mode)
{
- if (m_cameraAspectRatioMode == mode)
+ Q_D(Qt3DQuickWindow);
+ if (d->m_cameraAspectRatioMode == mode)
return;
- m_cameraAspectRatioMode = mode;
+ d->m_cameraAspectRatioMode = mode;
setCameraAspectModeHelper();
emit cameraAspectRatioModeChanged(mode);
}
Qt3DQuickWindow::CameraAspectRatioMode Qt3DQuickWindow::cameraAspectRatioMode() const
{
- return m_cameraAspectRatioMode;
+ Q_D(const Qt3DQuickWindow);
+ return d->m_cameraAspectRatioMode;
}
void Qt3DQuickWindow::showEvent(QShowEvent *e)
{
- if (!m_initialized) {
+ Q_D(Qt3DQuickWindow);
+ if (!d->m_initialized) {
// Connect to the QQmlAspectEngine's statusChanged signal so that when the QML is loaded
// and th eobjects hav ebeen instantiated, but before we set them on the QAspectEngine we
// can swoop in and set the window surface and camera on the framegraph and ensure the camera
// respects the window's aspect ratio
- connect(m_engine.data(), &Qt3DCore::Quick::QQmlAspectEngine::sceneCreated,
+ connect(d->m_engine, &Qt3DCore::Quick::QQmlAspectEngine::sceneCreated,
this, &Qt3DQuickWindow::onSceneCreated);
- m_engine->setSource(m_source);
+ d->m_engine->setSource(d->m_source);
// Set the QQmlIncubationController on the window
// to benefit from asynchronous incubation
- if (!m_incubationController)
- m_incubationController = new Qt3DQuickWindowIncubationController(this);
+ if (!d->m_incubationController)
+ d->m_incubationController = new Qt3DQuickWindowIncubationController(this);
- m_engine->qmlEngine()->setIncubationController(m_incubationController);
+ d->m_engine->qmlEngine()->setIncubationController(d->m_incubationController);
- m_initialized = true;
+ d->m_initialized = true;
}
QWindow::showEvent(e);
}
@@ -204,17 +219,18 @@ void Qt3DQuickWindow::showEvent(QShowEvent *e)
void Qt3DQuickWindow::onSceneCreated(QObject *rootObject)
{
Q_ASSERT(rootObject);
+ Q_D(Qt3DQuickWindow);
setWindowSurface(rootObject);
- if (m_cameraAspectRatioMode == AutomaticAspectRatio) {
+ if (d->m_cameraAspectRatioMode == AutomaticAspectRatio) {
// Set aspect ratio of first camera to match the window
QList<Qt3DRender::QCamera *> cameras
= rootObject->findChildren<Qt3DRender::QCamera *>();
if (cameras.isEmpty()) {
qCDebug(QuickWindow) << "No camera found";
} else {
- m_camera = cameras.first();
+ d->m_camera = cameras.first();
setCameraAspectModeHelper();
}
}
@@ -237,7 +253,8 @@ void Qt3DQuickWindow::setWindowSurface(QObject *rootObject)
void Qt3DQuickWindow::setCameraAspectModeHelper()
{
- switch (m_cameraAspectRatioMode) {
+ Q_D(Qt3DQuickWindow);
+ switch (d->m_cameraAspectRatioMode) {
case AutomaticAspectRatio:
connect(this, &QWindow::widthChanged, this, &Qt3DQuickWindow::updateCameraAspectRatio);
connect(this, &QWindow::heightChanged, this, &Qt3DQuickWindow::updateCameraAspectRatio);
@@ -253,9 +270,10 @@ void Qt3DQuickWindow::setCameraAspectModeHelper()
void Qt3DQuickWindow::updateCameraAspectRatio()
{
- if (m_camera) {
- m_camera->setAspectRatio(static_cast<float>(width()) /
- static_cast<float>(height()));
+ Q_D(Qt3DQuickWindow);
+ if (d->m_camera) {
+ d->m_camera->setAspectRatio(static_cast<float>(width()) /
+ static_cast<float>(height()));
}
}
diff --git a/src/quick3d/quick3dextras/qt3dquickwindow.h b/src/quick3d/quick3dextras/qt3dquickwindow.h
index 1b4d3fabf..0880fc160 100644
--- a/src/quick3d/quick3dextras/qt3dquickwindow.h
+++ b/src/quick3d/quick3dextras/qt3dquickwindow.h
@@ -84,6 +84,7 @@ namespace Qt3DExtras {
namespace Quick {
+class Qt3DQuickWindowPrivate;
class QT3DQUICKEXTRASSHARED_EXPORT Qt3DQuickWindow : public QWindow
{
@@ -121,18 +122,7 @@ private:
void setCameraAspectModeHelper();
void updateCameraAspectRatio();
- QScopedPointer<Qt3DCore::Quick::QQmlAspectEngine> m_engine;
-
- // Aspects
- Qt3DRender::QRenderAspect *m_renderAspect;
- Qt3DInput::QInputAspect *m_inputAspect;
- Qt3DLogic::QLogicAspect *m_logicAspect;
-
- QUrl m_source;
- bool m_initialized;
- QPointer<Qt3DRender::QCamera> m_camera;
- CameraAspectRatioMode m_cameraAspectRatioMode;
- QQmlIncubationController *m_incubationController;
+ Q_DECLARE_PRIVATE(Qt3DQuickWindow)
};
} // Quick
diff --git a/src/quick3d/quick3dextras/qt3dquickwindow_p.h b/src/quick3d/quick3dextras/qt3dquickwindow_p.h
new file mode 100644
index 000000000..f2f8d0492
--- /dev/null
+++ b/src/quick3d/quick3dextras/qt3dquickwindow_p.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3DQUICKWINDOW_P_H
+#define QT3DQUICKWINDOW_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtGui/private/qwindow_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DExtras {
+
+namespace Quick {
+
+class Qt3DQuickWindowPrivate : public QWindowPrivate
+{
+public:
+ Qt3DQuickWindowPrivate();
+
+ Qt3DCore::Quick::QQmlAspectEngine *m_engine;
+
+ // Aspects
+ Qt3DRender::QRenderAspect *m_renderAspect;
+ Qt3DInput::QInputAspect *m_inputAspect;
+ Qt3DLogic::QLogicAspect *m_logicAspect;
+
+ QUrl m_source;
+ bool m_initialized;
+ QPointer<Qt3DRender::QCamera> m_camera;
+ Qt3DQuickWindow::CameraAspectRatioMode m_cameraAspectRatioMode;
+ QQmlIncubationController *m_incubationController;
+
+ Q_DECLARE_PUBLIC(Qt3DQuickWindow)
+};
+
+} // Quick
+
+} // Qt3DExtras
+
+QT_END_NAMESPACE
+
+#endif // QT3DQUICKWINDOW_P_H
diff --git a/src/quick3d/quick3dextras/quick3dextras.pro b/src/quick3d/quick3dextras/quick3dextras.pro
index 9044c1668..976430eba 100644
--- a/src/quick3d/quick3dextras/quick3dextras.pro
+++ b/src/quick3d/quick3dextras/quick3dextras.pro
@@ -21,6 +21,7 @@ HEADERS += \
qt3dquickextras_global.h \
qt3dquickextras_global_p.h \
qt3dquickwindow.h \
+ qt3dquickwindow_p.h \
qt3dquickwindowlogging_p.h
# otherwise mingw headers do not declare common functions like ::strcasecmp
diff --git a/src/quick3d/quick3dscene2d/items/qscene2d.cpp b/src/quick3d/quick3dscene2d/items/qscene2d.cpp
index 3470ac9d8..52e2be094 100644
--- a/src/quick3d/quick3dscene2d/items/qscene2d.cpp
+++ b/src/quick3d/quick3dscene2d/items/qscene2d.cpp
@@ -59,21 +59,75 @@ namespace Quick {
\brief This class enables rendering qml into a texture, which then can be
used as a part of 3D scene.
- The component uses QQuickRenderControl to render the given QML source into an
+ This class uses QQuickRenderControl to render the given QQuickItem into an
offscreen surface, which is attached to a texture provided by the user. This allows the
component to directly render into the texture without intermediate copy and the user to
freely specify how the texture is used in the 3D scene.
+ The entities using the QScene2D can be associated with the class to enable interaction
+ with the item; if an entity has a QObjectPicker component, the pick events from that picker
+ are sent to the QScene2D and converted to mouse events and finally sent to the item.
+
\since 5.9
*/
/*!
\qmltype Scene2D
\inqmlmodule Qt3D.Scene2D
- \since
- \ingroup
+ \since 5.9
\instantiates Qt3DRender::Quick::QScene2D
- \brief Scene2D
+
+ \brief This type enables rendering qml into a texture, which then can be
+ used as a part of 3D scene.
+
+ This object uses RenderControl to render the given Item into an
+ offscreen surface, which is attached to a texture provided by the user. This allows the
+ component to directly render into the texture without intermediate copy and the user to
+ freely specify how the texture is used in the 3D scene.
+
+ The entities using the Scene2D can be associated with the type to enable interaction
+ with the item; if an entity has an ObjectPicker component, the pick events from that picker
+ are sent to the Scene2D and converted to mouse events and finally sent to the item.
+
+ Usage:
+ \qml
+ Entity {
+ id: sceneRoot
+
+ // specify Scene2D inside the entity hierarchy
+ Scene2D {
+ // specify output
+ output: RenderTargetOutput {
+ attachmentPoint: RenderTargetOutput.Color0
+ texture: Texture2D {
+ id: textureId
+ width: 1024
+ height: 1024
+ format: Texture.RGBA8_UNorm
+ }
+ }
+ // specify entities
+ entities: [entityId]
+
+ // specify rendered content
+ Rectangle {
+ color: "red"
+ }
+ }
+
+ Entity {
+ id: entityId
+
+ property Material material: TextureMaterial {
+ texture: textureId
+ }
+ property ObjectPicker picker: ObjectPicker {
+ hoverEnabled: true
+ dragEnabled: true
+ }
+ ...
+
+ \endqml
*/
/*!
@@ -91,18 +145,34 @@ namespace Quick {
*/
/*!
- \qmlproperty QUrl Qt3D.Render::Scene2D::source
- Holds the qml source url.
- */
-
-/*!
\qmlproperty enumeration Qt3D.Render::Scene2D::renderPolicy
Holds the render policy of this Scene2D.
+
+ \list
+ \li Continuous The Scene2D is rendering continuously. This is the default render policy.
+ \li SingleShot The Scene2D renders to the texture only once after which the resources
+ allocated for rendering are released.
+ \endlist
+ */
+/*!
+ \qmlproperty Item Qt3D.Render::Scene2D::item
+ Holds the Item, which is rendered by Scene2D to the texture.
*/
/*!
- \qmlproperty bool Qt3D.Render::Scene2D::loaded
- Holds whether the source has been loaded.
+ \qmlproperty bool Qt3D.Render::Scene2D::mouseEnabled
+ Holds whether mouse events are enabled for the rendered item. The mouse events are
+ generated from object picking events of the entities added to the Scene2D.
+ Mouse is enabled by default.
+
+ \note Events sent to items are delayed by one frame due to object picking
+ happening in the backend.
+ */
+/*!
+ \qmlproperty list<Entity> Qt3D.Render::Scene2D::entities
+ Holds the list of entities which are associated with the Scene2D object. If the
+ entities have ObjectPicker, the pick events from that entity are sent to Scene2D
+ and converted to mouse events.
*/
QScene2DPrivate::QScene2DPrivate()
@@ -118,6 +188,15 @@ QScene2DPrivate::~QScene2DPrivate()
delete m_renderManager;
}
+void QScene2DPrivate::setScene(Qt3DCore::QScene *scene)
+{
+ Q_Q(QScene2D);
+ QNodePrivate::setScene(scene);
+ const auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(q->id());
+ change->setPropertyName("sceneInitialized");
+ notifyObservers(change);
+}
+
/*!
The constructor creates a new QScene2D instance with the specified \a parent.
@@ -125,58 +204,12 @@ QScene2DPrivate::~QScene2DPrivate()
QScene2D::QScene2D(Qt3DCore::QNode *parent)
: Qt3DCore::QNode(*new QScene2DPrivate, parent)
{
- Q_D(QScene2D);
- connect(d->m_renderManager, &Scene2DManager::onLoadedChanged,
- this, &QScene2D::sourceLoaded);
-}
-
-QScene2D::QScene2D(QQmlEngine *engine, Qt3DCore::QNode *parent)
- : Qt3DCore::QNode(*new QScene2DPrivate, parent)
-{
- Q_D(QScene2D);
- connect(d->m_renderManager, &Scene2DManager::onLoadedChanged,
- this, &QScene2D::sourceLoaded);
- d->m_renderManager->setEngine(engine);
-}
-
-QScene2D::~QScene2D()
-{
-}
-
-bool QScene2D::loaded() const
-{
- Q_D(const QScene2D);
- return d->m_renderManager->m_initialized;
}
/*!
- \property QScene2D::source
- \brief Specifies the url for the qml.
-
- This property specifies the url to the qml being rendered to the texture.
- The source must specify QQuickItem as a root. The item must specify width
- and height. The rendered qml is scaled to the texture size.
- The property can not be changed after the rendering has been initialized.
+ \property QScene2D::item
+ Holds the QQuickItem, which is rendered by QScene2D to the texture.
*/
-QUrl QScene2D::source() const
-{
- Q_D(const QScene2D);
- return d->m_renderManager->m_source;
-}
-
-void QScene2D::setSource(const QUrl &url)
-{
- Q_D(QScene2D);
- if (d->m_renderManager->m_initialized) {
- qWarning() << "Unable to set source after initialization.";
- return;
- }
- if (d->m_renderManager->m_source != url) {
- d->m_renderManager->setSource(url);
- emit sourceChanged(url);
- }
-}
-
QQuickItem* QScene2D::item() const
{
Q_D(const QScene2D);
@@ -250,46 +283,29 @@ Qt3DCore::QNodeCreatedChangeBasePtr QScene2D::createNodeCreationChange() const
data.output = d->m_output ? d->m_output->id() : Qt3DCore::QNodeId();
for (Qt3DCore::QEntity *e : d->m_entities)
data.entityIds.append(e->id());
+ data.mouseEnabled = d->m_renderManager->m_mouseEnabled;
return creationChange;
}
-bool QScene2D::event(QEvent *event)
-{
- Q_D(QScene2D);
- d->m_renderManager->forwardEvent(event);
- return true;
-}
-
-/*!
- Returns the qml engine used by the QScene2D.
- */
-QQmlEngine *QScene2D::engine() const
+bool QScene2D::isMouseEnabled() const
{
Q_D(const QScene2D);
- return d->m_renderManager->m_qmlEngine;
-}
-
-bool QScene2D::isGrabMouseEnabled() const
-{
- Q_D(const QScene2D);
- return d->m_renderManager->m_grabMouse;
+ return d->m_renderManager->m_mouseEnabled;
}
/*!
- \internal
+ Retrieve entities associated with the QScene2D.
*/
-void QScene2D::sourceLoaded()
-{
- emit loadedChanged(true);
-}
-
-
QVector<Qt3DCore::QEntity*> QScene2D::entities()
{
Q_D(const QScene2D);
return d->m_entities;
}
+/*!
+ Adds an \a entity to the the QScene2D object. If the entities have QObjectPicker,
+ the pick events from that entity are sent to QScene2D and converted to mouse events.
+*/
void QScene2D::addEntity(Qt3DCore::QEntity *entity)
{
Q_D(QScene2D);
@@ -306,6 +322,9 @@ void QScene2D::addEntity(Qt3DCore::QEntity *entity)
}
}
+/*!
+ Removes an \a entity from the the QScene2D object.
+*/
void QScene2D::removeEntity(Qt3DCore::QEntity *entity)
{
Q_D(QScene2D);
@@ -322,12 +341,20 @@ void QScene2D::removeEntity(Qt3DCore::QEntity *entity)
}
}
-void QScene2D::setGrabMouseEnabled(bool grab)
+/*!
+ \property QScene2D::mouseEnabled
+ Holds whether mouse events are enabled for the rendered item. The mouse events are
+ generated from object picking events of the entities added to the QScene2D.
+ Mouse is enabled by default.
+
+ \note Events are delayed by one frame due to object picking happening in the backend.
+ */
+void QScene2D::setMouseEnabled(bool enabled)
{
Q_D(QScene2D);
- if (d->m_renderManager->m_grabMouse != grab) {
- d->m_renderManager->m_grabMouse = grab;
- emit grabMouseChanged(grab);
+ if (d->m_renderManager->m_mouseEnabled != enabled) {
+ d->m_renderManager->m_mouseEnabled = enabled;
+ emit mouseEnabledChanged(enabled);
}
}
diff --git a/src/quick3d/quick3dscene2d/items/qscene2d.h b/src/quick3d/quick3dscene2d/items/qscene2d.h
index 2c982668a..73322a9e9 100644
--- a/src/quick3d/quick3dscene2d/items/qscene2d.h
+++ b/src/quick3d/quick3dscene2d/items/qscene2d.h
@@ -60,11 +60,9 @@ class QT3DQUICKSCENE2DSHARED_EXPORT QScene2D : public Qt3DCore::QNode
Q_OBJECT
Q_PROPERTY(Qt3DRender::QRenderTargetOutput *output READ output WRITE setOutput NOTIFY outputChanged)
- Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(QScene2D::RenderPolicy renderPolicy READ renderPolicy WRITE setRenderPolicy NOTIFY renderPolicyChanged)
- Q_PROPERTY(bool loaded READ loaded NOTIFY loadedChanged)
Q_PROPERTY(QQuickItem *item READ item WRITE setItem NOTIFY itemChanged)
- Q_PROPERTY(bool grabMouse READ isGrabMouseEnabled WRITE setGrabMouseEnabled NOTIFY grabMouseChanged)
+ Q_PROPERTY(bool mouseEnabled READ isMouseEnabled WRITE setMouseEnabled NOTIFY mouseEnabledChanged)
Q_CLASSINFO("DefaultProperty", "item")
@@ -77,18 +75,11 @@ public:
Q_ENUM(RenderPolicy)
explicit QScene2D(Qt3DCore::QNode *parent = nullptr);
- QScene2D(QQmlEngine *engine, Qt3DCore::QNode *parent = nullptr);
- ~QScene2D();
Qt3DRender::QRenderTargetOutput *output() const;
- QUrl source() const;
- bool loaded() const;
QScene2D::RenderPolicy renderPolicy() const;
QQuickItem *item() const;
- QQmlEngine *engine() const;
- bool isGrabMouseEnabled() const;
-
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool isMouseEnabled() const;
QVector<Qt3DCore::QEntity *> entities();
void addEntity(Qt3DCore::QEntity *entity);
@@ -96,26 +87,21 @@ public:
public Q_SLOTS:
void setOutput(Qt3DRender::QRenderTargetOutput *output);
- void setSource(const QUrl &url);
void setRenderPolicy(QScene2D::RenderPolicy policy);
void setItem(QQuickItem *item);
- void setGrabMouseEnabled(bool grab);
+ void setMouseEnabled(bool enabled);
Q_SIGNALS:
void outputChanged(Qt3DRender::QRenderTargetOutput *output);
- void sourceChanged(const QUrl &url);
- void loadedChanged(bool loaded);
void renderPolicyChanged(QScene2D::RenderPolicy policy);
void itemChanged(QQuickItem *item);
- void grabMouseChanged(bool grab);
+ void mouseEnabledChanged(bool enabled);
protected:
Q_DECLARE_PRIVATE(QScene2D)
private:
Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE;
-
- void sourceLoaded();
};
} // namespace Quick
diff --git a/src/quick3d/quick3dscene2d/items/qscene2d_p.h b/src/quick3d/quick3dscene2d/items/qscene2d_p.h
index e40d3d6a9..217058f5c 100644
--- a/src/quick3d/quick3dscene2d/items/qscene2d_p.h
+++ b/src/quick3d/quick3dscene2d/items/qscene2d_p.h
@@ -55,6 +55,10 @@
QT_BEGIN_NAMESPACE
+namespace Qt3DCore {
+class QScene;
+}
+
namespace Qt3DRender {
namespace Quick {
@@ -70,6 +74,8 @@ public:
QScene2DPrivate();
~QScene2DPrivate();
+ void setScene(Qt3DCore::QScene *scene) Q_DECL_OVERRIDE;
+
Scene2DManager *m_renderManager;
QMetaObject::Connection m_textureDestroyedConnection;
Qt3DRender::QRenderTargetOutput *m_output;
@@ -82,6 +88,7 @@ struct QScene2DData
Scene2DSharedObjectPtr sharedObject;
Qt3DCore::QNodeId output;
QVector<Qt3DCore::QNodeId> entityIds;
+ bool mouseEnabled;
};
} // namespace Quick
diff --git a/src/quick3d/quick3dscene2d/items/scene2d.cpp b/src/quick3d/quick3dscene2d/items/scene2d.cpp
index ded595b36..b0c58c6c5 100644
--- a/src/quick3d/quick3dscene2d/items/scene2d.cpp
+++ b/src/quick3d/quick3dscene2d/items/scene2d.cpp
@@ -118,6 +118,7 @@ Scene2D::Scene2D()
, m_rbo(0)
, m_initialized(false)
, m_renderInitialized(false)
+ , m_mouseEnabled(true)
, m_renderPolicy(Qt3DRender::Quick::QScene2D::Continuous)
{
renderThreadClientCount->fetchAndAddAcquire(1);
@@ -125,12 +126,7 @@ Scene2D::Scene2D()
Scene2D::~Scene2D()
{
- // this gets called from aspect thread. Wait for the render thread then delete it.
- // TODO: render thread deletion
-// if (m_renderThread) {
-// m_renderThread->wait(1000);
-// delete m_renderThread;
-// }
+ stopGrabbing();
}
void Scene2D::setOutput(Qt3DCore::QNodeId outputId)
@@ -177,6 +173,7 @@ void Scene2D::initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr &chan
setSharedObject(data.sharedObject);
setOutput(data.output);
m_entities = data.entityIds;
+ m_mouseEnabled = data.mouseEnabled;
}
void Scene2D::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e)
@@ -192,49 +189,42 @@ void Scene2D::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e)
} else if (propertyChange->propertyName() == QByteArrayLiteral("output")) {
Qt3DCore::QNodeId outputId = propertyChange->value().value<Qt3DCore::QNodeId>();
setOutput(outputId);
- } else if (propertyChange->propertyName() == QByteArrayLiteral("sharedObject")) {
- const Scene2DSharedObjectPtr sharedObject
- = propertyChange->value().value<Scene2DSharedObjectPtr>();
- setSharedObject(sharedObject);
} else if (propertyChange->propertyName() == QByteArrayLiteral("pressed")) {
QPickEventPtr ev = propertyChange->value().value<QPickEventPtr>();
handlePickEvent(QEvent::MouseButtonPress, ev);
} else if (propertyChange->propertyName() == QByteArrayLiteral("released")) {
QPickEventPtr ev = propertyChange->value().value<QPickEventPtr>();
handlePickEvent(QEvent::MouseButtonRelease, ev);
- } else if (propertyChange->propertyName() == QByteArrayLiteral("clicked")) {
- QPickEventPtr ev = propertyChange->value().value<QPickEventPtr>();
- handlePickEvent(QEvent::MouseButtonDblClick, ev);
} else if (propertyChange->propertyName() == QByteArrayLiteral("moved")) {
QPickEventPtr ev = propertyChange->value().value<QPickEventPtr>();
handlePickEvent(QEvent::MouseMove, ev);
- } else if (propertyChange->propertyName() == QByteArrayLiteral("grabMouse")) {
- if (propertyChange->value().toBool()) {
- startGrabbing();
- } else {
- stopGrabbing();
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("mouseEnabled")) {
+ m_mouseEnabled = propertyChange->value().toBool();
+ if (m_mouseEnabled && !m_cachedPickEvent.isNull()) {
+ handlePickEvent(QEvent::MouseButtonPress, m_cachedPickEvent);
+ m_cachedPickEvent.clear();
}
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("sceneInitialized")) {
+ startGrabbing();
}
- /* TODO: handle these?
- else if (propertyChange->propertyName() == QByteArrayLiteral("entered")) {
-
- } else if (propertyChange->propertyName() == QByteArrayLiteral("exited")) {
-
- }*/
break;
}
case Qt3DCore::PropertyValueAdded: {
const auto change = qSharedPointerCast<Qt3DCore::QPropertyNodeAddedChange>(e);
- if (change->propertyName() == QByteArrayLiteral("entities"))
+ if (change->propertyName() == QByteArrayLiteral("entities")) {
m_entities.push_back(change->addedNodeId());
+ registerObjectPickerEvents(change->addedNodeId());
+ }
break;
}
case Qt3DCore::PropertyValueRemoved: {
const auto change = qSharedPointerCast<Qt3DCore::QPropertyNodeRemovedChange>(e);
- if (change->propertyName() == QByteArrayLiteral("entities"))
+ if (change->propertyName() == QByteArrayLiteral("entities")) {
m_entities.removeOne(change->removedNodeId());
+ unregisterObjectPickerEvents(change->removedNodeId());
+ }
break;
}
@@ -468,46 +458,54 @@ void Scene2D::unregisterObjectPickerEvents(Qt3DCore::QNodeId entityId)
void Scene2D::handlePickEvent(int type, const Qt3DRender::QPickEventPtr &ev)
{
- QPickTriangleEvent *pickTriangle = static_cast<QPickTriangleEvent *>(ev.data());
- Entity *entity = nullptr;
- if (!resourceAccessor()->accessResource(RenderBackendResourceAccessor::EntityHandle,
- QPickEventPrivate::get(pickTriangle)->m_entity,
- (void**)&entity, nullptr)) {
+ if (!isEnabled())
return;
- }
- CoordinateReader reader(renderer()->nodeManagers());
- if (reader.setGeometry(entity->renderComponent<GeometryRenderer>(),
- QAttribute::defaultTextureCoordinateAttributeName())) {
- QVector4D c0 = reader.getCoordinate(pickTriangle->vertex1Index());
- QVector4D c1 = reader.getCoordinate(pickTriangle->vertex2Index());
- QVector4D c2 = reader.getCoordinate(pickTriangle->vertex3Index());
- QVector4D ci = c0 * pickTriangle->uvw().x()
- + c1 * pickTriangle->uvw().y() + c2 * pickTriangle->uvw().z();
- ci.setW(1.0f);
-
- const QSize size = m_sharedObject->m_quickWindow->size();
- QPointF pos = QPointF(ci.x() * size.width(), ci.y() * size.height());
- QMouseEvent *mouseEvent
- = new QMouseEvent(static_cast<QEvent::Type>(type),
- pos, pos, pos,
- static_cast<Qt::MouseButton>(pickTriangle->button()),
- static_cast<Qt::MouseButtons>(pickTriangle->buttons()),
- static_cast<Qt::KeyboardModifiers>(pickTriangle->modifiers()),
- Qt::MouseEventSynthesizedByApplication);
-
- QCoreApplication::postEvent(m_sharedObject->m_quickWindow, mouseEvent);
+ if (m_mouseEnabled) {
+ QPickTriangleEvent *pickTriangle = static_cast<QPickTriangleEvent *>(ev.data());
+ Entity *entity = nullptr;
+ if (!resourceAccessor()->accessResource(RenderBackendResourceAccessor::EntityHandle,
+ QPickEventPrivate::get(pickTriangle)->m_entity,
+ (void**)&entity, nullptr)) {
+ return;
+ }
+ CoordinateReader reader(renderer()->nodeManagers());
+ if (reader.setGeometry(entity->renderComponent<GeometryRenderer>(),
+ QAttribute::defaultTextureCoordinateAttributeName())) {
+ QVector4D c0 = reader.getCoordinate(pickTriangle->vertex1Index());
+ QVector4D c1 = reader.getCoordinate(pickTriangle->vertex2Index());
+ QVector4D c2 = reader.getCoordinate(pickTriangle->vertex3Index());
+ QVector4D ci = c0 * pickTriangle->uvw().x()
+ + c1 * pickTriangle->uvw().y() + c2 * pickTriangle->uvw().z();
+ ci.setW(1.0f);
+
+ const QSize size = m_sharedObject->m_quickWindow->size();
+ QPointF pos = QPointF(ci.x() * size.width(), (1.0f - ci.y()) * size.height());
+ QMouseEvent *mouseEvent
+ = new QMouseEvent(static_cast<QEvent::Type>(type),
+ pos, pos, pos,
+ static_cast<Qt::MouseButton>(pickTriangle->button()),
+ static_cast<Qt::MouseButtons>(pickTriangle->buttons()),
+ static_cast<Qt::KeyboardModifiers>(pickTriangle->modifiers()),
+ Qt::MouseEventSynthesizedByApplication);
+
+ QCoreApplication::postEvent(m_sharedObject->m_quickWindow, mouseEvent);
+ }
+ } else if (type == QEvent::MouseButtonPress) {
+ m_cachedPickEvent = ev;
+ } else {
+ m_cachedPickEvent.clear();
}
}
void Scene2D::startGrabbing()
{
- for (Qt3DCore::QNodeId e : m_entities)
+ for (Qt3DCore::QNodeId e : qAsConst(m_entities))
registerObjectPickerEvents(e);
}
void Scene2D::stopGrabbing()
{
- for (Qt3DCore::QNodeId e : m_entities)
+ for (Qt3DCore::QNodeId e : qAsConst(m_entities))
unregisterObjectPickerEvents(e);
}
diff --git a/src/quick3d/quick3dscene2d/items/scene2d_p.h b/src/quick3d/quick3dscene2d/items/scene2d_p.h
index d2845d847..b42089306 100644
--- a/src/quick3d/quick3dscene2d/items/scene2d_p.h
+++ b/src/quick3d/quick3dscene2d/items/scene2d_p.h
@@ -119,8 +119,10 @@ public:
bool m_initialized;
bool m_renderInitialized;
+ bool m_mouseEnabled;
Qt3DRender::Quick::QScene2D::RenderPolicy m_renderPolicy;
QVector<Qt3DCore::QNodeId> m_entities;
+ Qt3DRender::QPickEventPtr m_cachedPickEvent;
};
} // Quick
diff --git a/src/quick3d/quick3dscene2d/items/scene2dmanager.cpp b/src/quick3d/quick3dscene2d/items/scene2dmanager.cpp
index f0d6a6e34..20c080dec 100644
--- a/src/quick3d/quick3dscene2d/items/scene2dmanager.cpp
+++ b/src/quick3d/quick3dscene2d/items/scene2dmanager.cpp
@@ -72,9 +72,7 @@ QWindow *RenderControl::renderWindow(QPoint *offset)
Constructs qml render manager.
*/
Scene2DManager::Scene2DManager(QScene2DPrivate *priv)
- : m_qmlEngine(nullptr)
- , m_qmlComponent(nullptr)
- , m_rootItem(nullptr)
+ : m_rootItem(nullptr)
, m_item(nullptr)
, m_priv(priv)
, m_sharedObject(new Scene2DSharedObject(this))
@@ -83,9 +81,7 @@ Scene2DManager::Scene2DManager(QScene2DPrivate *priv)
, m_initialized(false)
, m_renderSyncRequested(false)
, m_backendInitialized(false)
- , m_noSourceMode(false)
- , m_ownEngine(false)
- , m_grabMouse(false)
+ , m_mouseEnabled(true)
{
m_sharedObject->m_surface = new QOffscreenSurface;
m_sharedObject->m_surface->setFormat(QSurfaceFormat::defaultFormat());
@@ -135,38 +131,17 @@ void Scene2DManager::requestRenderSync()
void Scene2DManager::startIfInitialized()
{
- if (!m_initialized && m_backendInitialized) {
- if (m_source.isValid() && !m_noSourceMode) {
- // Create a QML engine.
- if (!m_qmlEngine) {
- m_qmlEngine = new QQmlEngine;
- if (!m_qmlEngine->incubationController()) {
- m_qmlEngine->setIncubationController(m_sharedObject->m_quickWindow
- ->incubationController());
- }
- }
-
- // create component
- m_ownEngine = true;
- m_qmlComponent = new QQmlComponent(m_qmlEngine, m_source);
- if (m_qmlComponent->isLoading()) {
- connect(m_qmlComponent, &QQmlComponent::statusChanged,
- this, &Scene2DManager::run);
- } else {
- run();
- }
- } else if (m_item != nullptr) {
- m_rootItem = m_item;
+ if (!m_initialized && m_backendInitialized && m_item != nullptr) {
+ m_rootItem = m_item;
- // Associate root item with the window.
- m_rootItem->setParentItem(m_sharedObject->m_quickWindow->contentItem());
+ // Associate root item with the window.
+ m_rootItem->setParentItem(m_sharedObject->m_quickWindow->contentItem());
- // Update window size.
- updateSizes();
+ // Update window size.
+ updateSizes();
- m_initialized = true;
- m_sharedObject->setInitialized();
- }
+ m_initialized = true;
+ m_sharedObject->setInitialized();
}
}
@@ -177,54 +152,9 @@ void Scene2DManager::stopAndClean()
m_sharedObject->requestQuit();
m_sharedObject->wait();
m_sharedObject->cleanup();
- if (m_ownEngine) {
- QObject::disconnect(m_connection);
- delete m_qmlEngine;
- }
- delete m_qmlComponent;
- m_qmlEngine = nullptr;
- m_qmlComponent = nullptr;
}
}
-void Scene2DManager::run()
-{
- disconnect(m_qmlComponent, &QQmlComponent::statusChanged, this, &Scene2DManager::run);
-
- if (m_qmlComponent->isError()) {
- QList<QQmlError> errorList = m_qmlComponent->errors();
- for (const QQmlError &error: errorList)
- qWarning() << error.url() << error.line() << error;
- return;
- }
-
- QObject *rootObject = m_qmlComponent->create();
- if (m_qmlComponent->isError()) {
- QList<QQmlError> errorList = m_qmlComponent->errors();
- for (const QQmlError &error: errorList)
- qWarning() << error.url() << error.line() << error;
- return;
- }
-
- m_rootItem = qobject_cast<QQuickItem *>(rootObject);
- if (!m_rootItem) {
- qWarning("QScene2D: Root item is not a QQuickItem.");
- delete rootObject;
- return;
- }
-
- // The root item is ready. Associate it with the window.
- m_rootItem->setParentItem(m_sharedObject->m_quickWindow->contentItem());
-
- // Update window size.
- updateSizes();
-
- m_initialized = true;
- m_sharedObject->setInitialized();
-
- emit onLoadedChanged();
-}
-
void Scene2DManager::updateSizes()
{
const int width = m_rootItem->width();
@@ -236,15 +166,8 @@ void Scene2DManager::updateSizes()
m_sharedObject->m_quickWindow->setGeometry(0, 0, width, height);
}
-void Scene2DManager::setSource(const QUrl &url)
-{
- m_source = url;
- startIfInitialized();
-}
-
void Scene2DManager::setItem(QQuickItem *item)
{
- m_noSourceMode = true;
m_item = item;
startIfInitialized();
}
@@ -302,33 +225,6 @@ bool Scene2DManager::event(QEvent *e)
return QObject::event(e);
}
-bool Scene2DManager::forwardEvent(QEvent *event)
-{
- switch (event->type()) {
-
- case QEvent::MouseMove:
- case QEvent::MouseButtonDblClick:
- case QEvent::MouseButtonPress:
- case QEvent::MouseButtonRelease: {
- QMouseEvent* me = static_cast<QMouseEvent *>(event);
- QPointF pos = me->localPos();
- pos = QPointF(pos.x() * m_rootItem->width(), pos.y() * m_rootItem->height());
- QMouseEvent nme = QMouseEvent(me->type(), pos, pos, pos, me->button(), me->buttons(),
- me->modifiers(), Qt::MouseEventSynthesizedByApplication);
- QCoreApplication::sendEvent(m_sharedObject->m_quickWindow, &nme);
- } break;
-
- case QEvent::KeyPress:
- case QEvent::KeyRelease: {
- QCoreApplication::sendEvent(m_sharedObject->m_quickWindow, event);
- } break;
-
- default:
- break;
- }
- return false;
-}
-
void Scene2DManager::doRenderSync()
{
QMutexLocker lock(&m_sharedObject->m_mutex);
@@ -346,23 +242,6 @@ void Scene2DManager::cleanup()
stopAndClean();
}
-void Scene2DManager::setEngine(QQmlEngine *engine)
-{
- m_qmlEngine = engine;
- m_ownEngine = false;
- if (engine) {
- m_connection = QObject::connect(engine, &QObject::destroyed,
- this, &Scene2DManager::engineDestroyed);
- }
-}
-
-void Scene2DManager::engineDestroyed()
-{
- QObject::disconnect(m_connection);
- m_qmlEngine = nullptr;
- m_ownEngine = false;
-}
-
} // namespace Quick
} // namespace Qt3DRender
diff --git a/src/quick3d/quick3dscene2d/items/scene2dmanager_p.h b/src/quick3d/quick3dscene2d/items/scene2dmanager_p.h
index d3c3a60a2..821616f47 100644
--- a/src/quick3d/quick3dscene2d/items/scene2dmanager_p.h
+++ b/src/quick3d/quick3dscene2d/items/scene2dmanager_p.h
@@ -75,46 +75,33 @@ public:
Scene2DManager(QScene2DPrivate *priv);
~Scene2DManager();
- QQmlEngine *m_qmlEngine;
- QQmlComponent *m_qmlComponent;
QQuickItem *m_rootItem;
QQuickItem *m_item;
QScene2DPrivate *m_priv;
QSharedPointer<Scene2DSharedObject> m_sharedObject;
- QUrl m_source;
Qt3DCore::QNodeId m_id;
- QMetaObject::Connection m_connection;
QScene2D::RenderPolicy m_renderPolicy;
bool m_requested;
bool m_initialized;
bool m_renderSyncRequested;
bool m_backendInitialized;
- bool m_noSourceMode;
- bool m_ownEngine;
- bool m_grabMouse;
+ bool m_mouseEnabled;
void requestRender();
void requestRenderSync();
void doRenderSync();
void startIfInitialized();
void stopAndClean();
- void run();
void updateSizes();
- void setSource(const QUrl &url);
void setItem(QQuickItem *item);
bool event(QEvent *e) Q_DECL_OVERRIDE;
- bool forwardEvent(QEvent *event);
-
- Q_SIGNAL void onLoadedChanged();
void cleanup();
- void setEngine(QQmlEngine *engine);
- void engineDestroyed();
};
} // namespace Quick