summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-03-31 12:26:13 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-04-06 07:47:26 +0200
commit59fc9cacce5eca68c9dece3c30d6f11ee7693d4e (patch)
treeabe60bc66927cfcfd0ecbbca4b2efc55f0984a9a
parent9bf40d1bed80017be065c5e9e8873b11638ac34b (diff)
Transform Qt3D.Core to declarative type registration
We already did this for the value types. As we cannot mix declarative and procedural registration, we need to do it for the object types, too. For declarative registration, the qmltypes files are generated at compile time. For procedural registration, you need to manually invoke qmlplugindump to generate them. Doing both leads to two conflicting qmltypes files for the same module. Fixes: QTBUG-92259 Pick-to: 6.1 Change-Id: Ic3d9c63410f84e04cd368ddaee3a6ff2d9a3c997 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mike Krus <mike.krus@kdab.com>
-rw-r--r--src/core/geometry/qattribute.h8
-rw-r--r--src/core/geometry/qbuffer.h2
-rw-r--r--src/core/geometry/qgeometry.h8
-rw-r--r--src/core/qt3dcore_global.h8
-rw-r--r--src/core/transforms/qtransform.h2
-rw-r--r--src/quick3d/imports/core/qmldir1
-rw-r--r--src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp36
-rw-r--r--src/quick3d/quick3d/CMakeLists.txt1
-rw-r--r--src/quick3d/quick3d/items/quick3dbuffer_p.h2
-rw-r--r--src/quick3d/quick3d/items/quick3dentityloader_p.h4
-rw-r--r--src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h2
-rw-r--r--src/quick3d/quick3d/qquaternionanimation_p.h3
-rw-r--r--src/quick3d/quick3d/qt3dquick_global_p.h4
-rw-r--r--src/quick3d/quick3d/qt3dquickforeign_p.h196
-rw-r--r--src/quick3d/quick3d/qt3dquickvaluetypes_p.h2
-rw-r--r--src/quick3d/quick3d/quick3d.pro2
16 files changed, 234 insertions, 47 deletions
diff --git a/src/core/geometry/qattribute.h b/src/core/geometry/qattribute.h
index eedb2d32c..b3aa9b2c2 100644
--- a/src/core/geometry/qattribute.h
+++ b/src/core/geometry/qattribute.h
@@ -69,11 +69,11 @@ class Q_3DCORESHARED_EXPORT QAttribute : public QNode
Q_PROPERTY(QString defaultNormalAttributeName READ defaultNormalAttributeName CONSTANT)
Q_PROPERTY(QString defaultColorAttributeName READ defaultColorAttributeName CONSTANT)
Q_PROPERTY(QString defaultTextureCoordinateAttributeName READ defaultTextureCoordinateAttributeName CONSTANT)
- Q_PROPERTY(QString defaultTextureCoordinate1AttributeName READ defaultTextureCoordinate1AttributeName CONSTANT REVISION 11)
- Q_PROPERTY(QString defaultTextureCoordinate2AttributeName READ defaultTextureCoordinate2AttributeName CONSTANT REVISION 11)
+ Q_PROPERTY(QString defaultTextureCoordinate1AttributeName READ defaultTextureCoordinate1AttributeName CONSTANT QT3D_PROPERTY_REVISION(2, 11))
+ Q_PROPERTY(QString defaultTextureCoordinate2AttributeName READ defaultTextureCoordinate2AttributeName CONSTANT QT3D_PROPERTY_REVISION(2, 11))
Q_PROPERTY(QString defaultTangentAttributeName READ defaultTangentAttributeName CONSTANT)
- Q_PROPERTY(QString defaultJointIndicesAttributeName READ defaultJointIndicesAttributeName CONSTANT REVISION 10)
- Q_PROPERTY(QString defaultJointWeightsAttributeName READ defaultJointWeightsAttributeName CONSTANT REVISION 10)
+ Q_PROPERTY(QString defaultJointIndicesAttributeName READ defaultJointIndicesAttributeName CONSTANT QT3D_PROPERTY_REVISION(2, 10))
+ Q_PROPERTY(QString defaultJointWeightsAttributeName READ defaultJointWeightsAttributeName CONSTANT QT3D_PROPERTY_REVISION(2, 10))
public:
enum AttributeType {
diff --git a/src/core/geometry/qbuffer.h b/src/core/geometry/qbuffer.h
index 341ac019d..4cbfe0b88 100644
--- a/src/core/geometry/qbuffer.h
+++ b/src/core/geometry/qbuffer.h
@@ -55,7 +55,7 @@ class Q_3DCORESHARED_EXPORT QBuffer : public Qt3DCore::QNode
{
Q_OBJECT
Q_PROPERTY(UsageType usage READ usage WRITE setUsage NOTIFY usageChanged)
- Q_PROPERTY(AccessType accessType READ accessType WRITE setAccessType NOTIFY accessTypeChanged REVISION 9)
+ Q_PROPERTY(AccessType accessType READ accessType WRITE setAccessType NOTIFY accessTypeChanged QT3D_PROPERTY_REVISION(2, 9))
public:
enum UsageType
diff --git a/src/core/geometry/qgeometry.h b/src/core/geometry/qgeometry.h
index 8f21638b2..addcb9fa6 100644
--- a/src/core/geometry/qgeometry.h
+++ b/src/core/geometry/qgeometry.h
@@ -54,8 +54,8 @@ class Q_3DCORESHARED_EXPORT QGeometry : public Qt3DCore::QNode
{
Q_OBJECT
Q_PROPERTY(Qt3DCore::QAttribute *boundingVolumePositionAttribute READ boundingVolumePositionAttribute WRITE setBoundingVolumePositionAttribute NOTIFY boundingVolumePositionAttributeChanged)
- Q_PROPERTY(QVector3D minExtent READ minExtent NOTIFY minExtentChanged REVISION 13)
- Q_PROPERTY(QVector3D maxExtent READ maxExtent NOTIFY maxExtentChanged REVISION 13)
+ Q_PROPERTY(QVector3D minExtent READ minExtent NOTIFY minExtentChanged QT3D_PROPERTY_REVISION(2, 13))
+ Q_PROPERTY(QVector3D maxExtent READ maxExtent NOTIFY maxExtentChanged QT3D_PROPERTY_REVISION(2, 13))
public:
explicit QGeometry(Qt3DCore::QNode *parent = nullptr);
~QGeometry();
@@ -73,8 +73,8 @@ public Q_SLOTS:
Q_SIGNALS:
void boundingVolumePositionAttributeChanged(QAttribute *boundingVolumePositionAttribute);
- Q_REVISION(13) void minExtentChanged(const QVector3D &minExtent);
- Q_REVISION(13) void maxExtentChanged(const QVector3D &maxExtent);
+ QT3D_REVISION(2, 13) void minExtentChanged(const QVector3D &minExtent);
+ QT3D_REVISION(2, 13) void maxExtentChanged(const QVector3D &maxExtent);
protected:
explicit QGeometry(QGeometryPrivate &dd, Qt3DCore::QNode *parent = nullptr);
diff --git a/src/core/qt3dcore_global.h b/src/core/qt3dcore_global.h
index 5d6ebac32..5a5ead35e 100644
--- a/src/core/qt3dcore_global.h
+++ b/src/core/qt3dcore_global.h
@@ -87,6 +87,14 @@ QT_BEGIN_NAMESPACE
QT3D_DECLARE_TYPEINFO_2(OuterNS, InnerNS, Class, Q_RELOCATABLE_TYPE) \
/*end*/
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+#define QT3D_REVISION(major, minor) Q_REVISION(minor)
+#define QT3D_PROPERTY_REVISION(major, minor) REVISION minor
+#else
+#define QT3D_REVISION(major, minor) Q_REVISION(major, minor)
+#define QT3D_PROPERTY_REVISION(major, minor) REVISION(major, minor)
+#endif
+
QT_END_NAMESPACE
#endif // QT3DCORE_GLOBAL_H
diff --git a/src/core/transforms/qtransform.h b/src/core/transforms/qtransform.h
index fa2d84baf..7320e43cf 100644
--- a/src/core/transforms/qtransform.h
+++ b/src/core/transforms/qtransform.h
@@ -61,7 +61,7 @@ class Q_3DCORESHARED_EXPORT QTransform : public QComponent
Q_PROPERTY(float rotationX READ rotationX WRITE setRotationX NOTIFY rotationXChanged)
Q_PROPERTY(float rotationY READ rotationY WRITE setRotationY NOTIFY rotationYChanged)
Q_PROPERTY(float rotationZ READ rotationZ WRITE setRotationZ NOTIFY rotationZChanged)
- Q_PROPERTY(QMatrix4x4 worldMatrix READ worldMatrix NOTIFY worldMatrixChanged REVISION 14)
+ Q_PROPERTY(QMatrix4x4 worldMatrix READ worldMatrix NOTIFY worldMatrixChanged QT3D_PROPERTY_REVISION(2, 14))
public:
explicit QTransform(QNode *parent = nullptr);
diff --git a/src/quick3d/imports/core/qmldir b/src/quick3d/imports/core/qmldir
index 6c58c072e..dda728138 100644
--- a/src/quick3d/imports/core/qmldir
+++ b/src/quick3d/imports/core/qmldir
@@ -1,3 +1,4 @@
module Qt3D.Core
plugin quick3dcoreplugin
classname Qt3DQuick3DCorePlugin
+typeinfo plugins.qmltypes
diff --git a/src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp b/src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp
index 264e49052..14987e764 100644
--- a/src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp
+++ b/src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp
@@ -66,41 +66,11 @@ QT_BEGIN_NAMESPACE
void Qt3DQuick3DCorePlugin::registerTypes(const char *uri)
{
+ Q_UNUSED(uri);
Qt3DCore::Quick::Quick3D_initialize();
-
- qmlRegisterUncreatableType<Qt3DCore::QComponent>(uri, 2, 0, "Component3D", QLatin1String(""));
-
- Qt3DCore::Quick::registerExtendedType<Qt3DCore::QEntity, Qt3DCore::Quick::Quick3DEntity>("QEntity", "Qt3D.Core/Entity", uri, 2, 0, "Entity");
- qmlRegisterType<Qt3DCore::Quick::Quick3DEntityLoader>(uri, 2, 0, "EntityLoader");
- qmlRegisterType<Qt3DCore::Quick::Quick3DEntityLoader, 12>(uri, 2, 12, "EntityLoader");
- qmlRegisterType<Qt3DCore::Quick::Quick3DNodeInstantiator>(uri, 2, 0, "NodeInstantiator");
- qmlRegisterType<Qt3DCore::QTransform>(uri, 2, 0, "Transform");
- qmlRegisterType<Qt3DCore::QTransform, 14>(uri, 2, 14, "Transform");
- qmlRegisterType<Qt3DCore::QArmature>(uri, 2, 10, "Armature");
- qmlRegisterUncreatableType<Qt3DCore::QAbstractSkeleton>(uri, 2, 10, "AbstractSkeleton", QStringLiteral("AbstractSkeleton is an abstract base class"));
- qmlRegisterType<Qt3DCore::QSkeletonLoader>(uri, 2, 10, "SkeletonLoader");
- qmlRegisterType<Qt3DCore::QAttribute>(uri, 2, 0, "Attribute");
- qmlRegisterType<Qt3DCore::QAttribute, 10>(uri, 2, 10, "Attribute");
- qmlRegisterType<Qt3DCore::QAttribute, 11>(uri, 2, 11, "Attribute");
- qmlRegisterUncreatableType<Qt3DCore::QBuffer>(uri, 2, 0, "BufferBase", QStringLiteral("Use Quick3DBuffer in QML"));
- qmlRegisterUncreatableType<Qt3DCore::QBuffer, 9>(uri, 2, 9, "BufferBase", QStringLiteral("Use Quick3DBuffer in QML"));
- qmlRegisterType<Qt3DCore::Quick::Quick3DBuffer>(uri, 2, 0, "Buffer");
- Qt3DCore::Quick::registerExtendedType<Qt3DCore::QGeometry, Qt3DCore::Quick::Quick3DGeometry>("QGeometry", "Qt3D.Core/Geometry", uri, 2, 0, "Geometry");
- qmlRegisterType<Qt3DCore::QGeometryView>(uri, 2, 16, "GeometryView");
- qmlRegisterType<Qt3DCore::QBoundingVolume>(uri, 2, 16, "BoundingVolume");
-
- qmlRegisterType<Qt3DCore::Quick::QQuaternionAnimation>(uri, 2, 0, "QuaternionAnimation");
+ Qt3DCore::Quick::Quick3D_registerType("QEntity", "Qt3D.Core/Entity", 2, 0);
+ Qt3DCore::Quick::Quick3D_registerType("QGeometry", "Qt3D.Core/Geometry", 2, 0);
qRegisterAnimationInterpolator<QQuaternion>(Qt3DCore::Quick::q_quaternionInterpolator);
-
- // Ideally we want to make Node an uncreatable type
- // We would need qmlRegisterUncreatableExtendedType for that
- qmlRegisterExtendedUncreatableType<Qt3DCore::QNode, Qt3DCore::Quick::Quick3DNode>(uri, 2, 0, "Node", QStringLiteral("Node is a base class"));
-
- Qt3DCore::Quick::registerExtendedType<Qt3DCore::QJoint, Qt3DCore::Quick::Quick3DJoint>("QJoint", "Qt3D.Core/Joint", uri, 2, 10, "Joint");
-
- // The minor version used to be the current Qt 5 minor. For compatibility it is the last
- // Qt 5 release.
- qmlRegisterModule(uri, 2, 15);
}
Qt3DQuick3DCorePlugin::~Qt3DQuick3DCorePlugin()
diff --git a/src/quick3d/quick3d/CMakeLists.txt b/src/quick3d/quick3d/CMakeLists.txt
index ccb9271fd..8c9872852 100644
--- a/src/quick3d/quick3d/CMakeLists.txt
+++ b/src/quick3d/quick3d/CMakeLists.txt
@@ -17,6 +17,7 @@ qt_internal_add_module(3DQuick
qqmlaspectengine.cpp qqmlaspectengine.h qqmlaspectengine_p.h
qquaternionanimation.cpp qquaternionanimation_p.h
qt3dquick_global.cpp qt3dquick_global.h qt3dquick_global_p.h
+ qt3dquickforeign_p.h
qt3dquicknodefactory.cpp qt3dquicknodefactory_p.h
qt3dquickvaluetypes.cpp qt3dquickvaluetypes_p.h
INCLUDE_DIRECTORIES
diff --git a/src/quick3d/quick3d/items/quick3dbuffer_p.h b/src/quick3d/quick3d/items/quick3dbuffer_p.h
index b75164e4c..6f6bf89f1 100644
--- a/src/quick3d/quick3d/items/quick3dbuffer_p.h
+++ b/src/quick3d/quick3d/items/quick3dbuffer_p.h
@@ -72,6 +72,8 @@ class Q_3DQUICKSHARED_PRIVATE_EXPORT Quick3DBuffer : public Qt3DCore::QBuffer
{
Q_OBJECT
Q_PROPERTY(QVariant data READ bufferData WRITE setBufferData NOTIFY bufferDataChanged)
+ QML_NAMED_ELEMENT(Buffer)
+ QML_ADDED_IN_VERSION(2, 0)
public:
explicit Quick3DBuffer(Qt3DCore::QNode *parent = nullptr);
diff --git a/src/quick3d/quick3d/items/quick3dentityloader_p.h b/src/quick3d/quick3d/items/quick3dentityloader_p.h
index 9d3a70147..a14c27f2f 100644
--- a/src/quick3d/quick3d/items/quick3dentityloader_p.h
+++ b/src/quick3d/quick3d/items/quick3dentityloader_p.h
@@ -76,7 +76,9 @@ class Q_3DQUICKSHARED_PRIVATE_EXPORT Quick3DEntityLoader : public QEntity
Q_PROPERTY(QObject *entity READ entity NOTIFY entityChanged)
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
- Q_PROPERTY(QQmlComponent *sourceComponent READ sourceComponent WRITE setSourceComponent NOTIFY sourceComponentChanged REVISION 12)
+ Q_PROPERTY(QQmlComponent *sourceComponent READ sourceComponent WRITE setSourceComponent NOTIFY sourceComponentChanged QT3D_PROPERTY_REVISION(2, 12))
+ QML_NAMED_ELEMENT(EntityLoader)
+ QML_ADDED_IN_VERSION(2, 0)
public:
enum Status {
Null = 0,
diff --git a/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h b/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h
index ac888e0cb..70da8012e 100644
--- a/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h
+++ b/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h
@@ -78,6 +78,8 @@ class Q_3DQUICKSHARED_PRIVATE_EXPORT Quick3DNodeInstantiator : public QNode, pub
Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
Q_PROPERTY(QObject *object READ object NOTIFY objectChanged)
Q_CLASSINFO("DefaultProperty", "delegate")
+ QML_NAMED_ELEMENT(NodeInstantiator)
+ QML_ADDED_IN_VERSION(2, 0)
public:
Quick3DNodeInstantiator(QNode *parent = 0);
diff --git a/src/quick3d/quick3d/qquaternionanimation_p.h b/src/quick3d/quick3d/qquaternionanimation_p.h
index 7fb49f670..1fca27d71 100644
--- a/src/quick3d/quick3d/qquaternionanimation_p.h
+++ b/src/quick3d/quick3d/qquaternionanimation_p.h
@@ -79,6 +79,9 @@ class Q_3DQUICKSHARED_PRIVATE_EXPORT QQuaternionAnimation : public QQuickPropert
Q_PROPERTY(float toYRotation READ toYRotation WRITE setToYRotation NOTIFY toYRotationChanged)
Q_PROPERTY(float toZRotation READ toZRotation WRITE setToZRotation NOTIFY toZRotationChanged)
+ QML_NAMED_ELEMENT(QuaternionAnimation)
+ QML_ADDED_IN_VERSION(2, 0)
+
public:
enum Type {
Slerp = 0,
diff --git a/src/quick3d/quick3d/qt3dquick_global_p.h b/src/quick3d/quick3d/qt3dquick_global_p.h
index 01f4657a7..bd313a49c 100644
--- a/src/quick3d/quick3d/qt3dquick_global_p.h
+++ b/src/quick3d/quick3d/qt3dquick_global_p.h
@@ -61,6 +61,10 @@
#define Q_3DQUICKSHARED_PRIVATE_EXPORT Q_3DQUICKSHARED_EXPORT
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+#define QML_ADDED_IN_VERSION(major, minor) QML_ADDED_IN_MINOR_VERSION(minor)
+#endif
+
QT_BEGIN_NAMESPACE
namespace Qt3DCore {
diff --git a/src/quick3d/quick3d/qt3dquickforeign_p.h b/src/quick3d/quick3d/qt3dquickforeign_p.h
new file mode 100644
index 000000000..f944b6e7e
--- /dev/null
+++ b/src/quick3d/quick3d/qt3dquickforeign_p.h
@@ -0,0 +1,196 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 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:LGPL$
+** 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 https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3D_QUICK_FOREIGN_P_H
+#define QT3D_QUICK_FOREIGN_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/qqml.h>
+#include <Qt3DCore/qcomponent.h>
+#include <Qt3DCore/qtransform.h>
+#include <Qt3DCore/qarmature.h>
+#include <Qt3DCore/qabstractskeleton.h>
+#include <Qt3DCore/qskeletonloader.h>
+#include <Qt3DCore/qattribute.h>
+#include <Qt3DCore/qbuffer.h>
+#include <Qt3DCore/qgeometry.h>
+#include <Qt3DCore/qgeometryview.h>
+#include <Qt3DCore/qboundingvolume.h>
+#include <Qt3DCore/qnode.h>
+#include <Qt3DCore/qjoint.h>
+
+#include <private/quick3dentity_p.h>
+#include <private/quick3dgeometry_p.h>
+#include <private/quick3dnode_p.h>
+#include <private/quick3djoint_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DCore {
+namespace Quick {
+
+struct QComponentForeign
+{
+ Q_GADGET
+ QML_NAMED_ELEMENT(Component3D)
+ QML_ADDED_IN_VERSION(2, 0);
+ QML_FOREIGN(Qt3DCore::QComponent)
+};
+
+struct QEntityForeign
+{
+ Q_GADGET
+ QML_NAMED_ELEMENT(Entity)
+ QML_ADDED_IN_VERSION(2, 0)
+ QML_FOREIGN(Qt3DCore::QEntity)
+ QML_EXTENDED(Qt3DCore::Quick::Quick3DEntity)
+};
+
+struct QTransformForeign
+{
+ Q_GADGET
+ QML_NAMED_ELEMENT(Transform)
+ QML_ADDED_IN_VERSION(2, 0)
+ QML_FOREIGN(Qt3DCore::QTransform)
+};
+
+struct QArmatureForeign
+{
+ Q_GADGET
+ QML_NAMED_ELEMENT(Armature)
+ QML_ADDED_IN_VERSION(2, 0)
+ QML_FOREIGN(Qt3DCore::QArmature)
+};
+
+struct QAbstractSkeletonForeign
+{
+ Q_GADGET
+ QML_NAMED_ELEMENT(AbstractSkeleton)
+ QML_ADDED_IN_VERSION(2, 10)
+ QML_FOREIGN(Qt3DCore::QAbstractSkeleton)
+ QML_UNCREATABLE("AbstractSkeleton is an abstract base class")
+};
+
+struct QSkeletonLoaderForeign
+{
+ Q_GADGET
+ QML_NAMED_ELEMENT(SkeletonLoader)
+ QML_ADDED_IN_VERSION(2, 10)
+ QML_FOREIGN(Qt3DCore::QSkeletonLoader)
+};
+
+struct QAttributeForeign
+{
+ Q_GADGET
+ QML_NAMED_ELEMENT(Attribute)
+ QML_ADDED_IN_VERSION(2, 0)
+ QML_FOREIGN(Qt3DCore::QAttribute)
+};
+
+struct QBufferForeign
+{
+ Q_GADGET
+ QML_NAMED_ELEMENT(BufferBase)
+ QML_ADDED_IN_VERSION(2, 0)
+ QML_FOREIGN(Qt3DCore::QBuffer)
+ QML_UNCREATABLE("Use Quick3DBuffer in QML")
+};
+
+struct QGeometryForeign
+{
+ Q_GADGET
+ QML_NAMED_ELEMENT(Geometry)
+ QML_ADDED_IN_VERSION(2, 0)
+ QML_FOREIGN(Qt3DCore::QGeometry)
+ QML_EXTENDED(Qt3DCore::Quick::Quick3DGeometry)
+};
+
+struct QGeometryViewForeign
+{
+ Q_GADGET
+ QML_NAMED_ELEMENT(GeometryView)
+ QML_ADDED_IN_VERSION(2, 16)
+ QML_FOREIGN(Qt3DCore::QGeometryView)
+};
+
+struct QBoundingVolumeForeign
+{
+ Q_GADGET
+ QML_NAMED_ELEMENT(BoundingVolume)
+ QML_ADDED_IN_VERSION(2, 16)
+ QML_FOREIGN(Qt3DCore::QBoundingVolume)
+};
+
+// Ideally we want to make Node an uncreatable type
+// TODO: We can do that in a civilized way now: QML_UNCREATABLE("foo bar")
+// It might cause some incompatibility, though.
+struct QNodeForeign
+{
+ Q_GADGET
+ QML_NAMED_ELEMENT(Node)
+ QML_ADDED_IN_VERSION(2, 0)
+ QML_FOREIGN(Qt3DCore::QNode)
+ QML_EXTENDED(Qt3DCore::Quick::Quick3DNode)
+};
+
+struct QJointForeign
+{
+ Q_GADGET
+ QML_NAMED_ELEMENT(Joint)
+ QML_ADDED_IN_VERSION(2, 0)
+ QML_FOREIGN(Qt3DCore::QJoint)
+ QML_EXTENDED(Qt3DCore::Quick::Quick3DJoint)
+};
+
+} // namespace Quick
+} // namespace Qt3DCore
+
+QT_END_NAMESPACE
+
+#endif // QT3D_QUICK_FOREIGN_P_H
diff --git a/src/quick3d/quick3d/qt3dquickvaluetypes_p.h b/src/quick3d/quick3d/qt3dquickvaluetypes_p.h
index 6c9e7ac97..bf98bdd1d 100644
--- a/src/quick3d/quick3d/qt3dquickvaluetypes_p.h
+++ b/src/quick3d/quick3d/qt3dquickvaluetypes_p.h
@@ -68,7 +68,6 @@ namespace Qt3DCore {
namespace Quick {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-#define QML_ADDED_IN_VERSION(major, minor) QML_ADDED_IN_MINOR_VERSION(minor)
#define QML_VALUE_TYPE(v)
#endif
@@ -357,7 +356,6 @@ public:
};
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-#undef QML_ADDED_IN_VERSION
#undef QML_VALUE_TYPE
#endif
diff --git a/src/quick3d/quick3d/quick3d.pro b/src/quick3d/quick3d/quick3d.pro
index 1a9705b72..a177ee5b1 100644
--- a/src/quick3d/quick3d/quick3d.pro
+++ b/src/quick3d/quick3d/quick3d.pro
@@ -2,7 +2,7 @@ TARGET = Qt3DQuick
MODULE = 3dquick
QT += core-private gui-private qml qml-private quick quick-private 3dcore 3dcore-private
-CONFIG += c++17
+CONFIG += c++17 qmltypes qmltypes_install
gcov {
QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage