diff options
author | Liang Qi <liang.qi@qt.io> | 2017-09-22 12:32:08 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-09-22 12:32:08 +0200 |
commit | c9eac1f67bda96bd8ff5205027bbfb70ad2807d7 (patch) | |
tree | ce6080c5f9cf59e8aa3d2c16f12fa05950a03bb3 /src/quick3d | |
parent | 5e13bb3f093627af02f86602ab02f98bbf3648a2 (diff) | |
parent | b9a2aee4115a73cfa220349a3100a559006bb2fa (diff) |
Merge remote-tracking branch 'origin/5.10' into dev
Change-Id: Ifdf71e3c33a7d1a6c100bba65722625ea19e0b81
Diffstat (limited to 'src/quick3d')
17 files changed, 38 insertions, 48 deletions
diff --git a/src/quick3d/imports/animation/qt3dquick3danimationplugin.cpp b/src/quick3d/imports/animation/qt3dquick3danimationplugin.cpp index eb9a32109..017e2a453 100644 --- a/src/quick3d/imports/animation/qt3dquick3danimationplugin.cpp +++ b/src/quick3d/imports/animation/qt3dquick3danimationplugin.cpp @@ -45,11 +45,11 @@ #include <Qt3DAnimation/qblendedclipanimator.h> #include <Qt3DAnimation/qclipanimator.h> #include <Qt3DAnimation/qchannelmapping.h> +#include <Qt3DAnimation/qskeletonmapping.h> #include <Qt3DAnimation/qlerpclipblend.h> #include <Qt3DAnimation/qadditiveclipblend.h> #include <Qt3DAnimation/qclipblendvalue.h> #include <Qt3DAnimation/qclock.h> - #include <Qt3DAnimation/qkeyframeanimation.h> #include <Qt3DAnimation/qanimationcontroller.h> #include <Qt3DAnimation/qabstractanimation.h> @@ -97,6 +97,9 @@ void Qt3DQuick3DAnimationPlugin::registerTypes(const char *uri) 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"); + + qmlRegisterUncreatableType<Qt3DAnimation::QAbstractChannelMapping>(uri, 2, 10, "AbstractChannelMapping", QStringLiteral("QAbstractChannelMapping is abstract")); + qmlRegisterType<Qt3DAnimation::QSkeletonMapping>(uri, 2, 10, "SkeletonMapping"); } QT_END_NAMESPACE diff --git a/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp b/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp index bdafca64c..61d27444a 100644 --- a/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp +++ b/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp @@ -69,8 +69,8 @@ #include <Qt3DExtras/qspritegrid.h> #include <Qt3DExtras/qspritesheetitem.h> #include <Qt3DExtras/qtext2dentity.h> -#include <Qt3DExtras/qtexturedmetalroughmaterial.h> #include <Qt3DExtras/qtexturematerial.h> +#include <Qt3DExtras/qtexturedmetalroughmaterial.h> #include <Qt3DExtras/qtorusgeometry.h> #include <Qt3DExtras/qtorusmesh.h> @@ -109,6 +109,7 @@ void Qt3DQuick3DExtrasPlugin::registerTypes(const char *uri) qmlRegisterType<Qt3DExtras::QTextureMaterial>(uri, 2, 0, "TextureMaterial"); qmlRegisterRevision<Qt3DExtras::QTextureMaterial, 10>(uri, 2, 10); qmlRegisterType<Qt3DExtras::QMetalRoughMaterial>(uri, 2, 9, "MetalRoughMaterial"); + qmlRegisterRevision<Qt3DExtras::QMetalRoughMaterial, 10>(uri, 2, 10); qmlRegisterType<Qt3DExtras::QTexturedMetalRoughMaterial>(uri, 2, 9, "TexturedMetalRoughMaterial"); qmlRegisterType<Qt3DExtras::QMorphPhongMaterial>(uri, 2, 9, "MorphPhongMaterial"); diff --git a/src/quick3d/quick3d/qt3dquicknodefactory.cpp b/src/quick3d/quick3d/qt3dquicknodefactory.cpp index 4d399d8f4..1a37f9acc 100644 --- a/src/quick3d/quick3d/qt3dquicknodefactory.cpp +++ b/src/quick3d/quick3d/qt3dquicknodefactory.cpp @@ -39,8 +39,6 @@ #include "qt3dquicknodefactory_p.h" -#include <QtQml/private/qqmlmetatype_p.h> - QT_BEGIN_NAMESPACE namespace Qt3DCore { @@ -66,12 +64,10 @@ QNode *QuickNodeFactory::createNode(const char *type) if (!typeInfo.resolved) { typeInfo.resolved = true; -#if 0 typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), typeInfo.version.first, typeInfo.version.second); -#endif } - return typeInfo.t ? qobject_cast<QNode *>(typeInfo.t->create()) : nullptr; + return typeInfo.t.isValid() ? qobject_cast<QNode *>(typeInfo.t.create()) : nullptr; } } // namespace Qt3DCore diff --git a/src/quick3d/quick3d/qt3dquicknodefactory_p.h b/src/quick3d/quick3d/qt3dquicknodefactory_p.h index 3cfbb6cc8..a6029cb37 100644 --- a/src/quick3d/quick3d/qt3dquicknodefactory_p.h +++ b/src/quick3d/quick3d/qt3dquicknodefactory_p.h @@ -77,7 +77,7 @@ private: : quickName(quickName), version(major, minor), t(nullptr), resolved(false) { } QByteArray quickName; QPair<int, int> version; - QQmlType *t; + QQmlType t; bool resolved; }; QHash<QByteArray, Type> m_types; diff --git a/src/quick3d/quick3danimation/items/quick3dchannelmapper.cpp b/src/quick3d/quick3danimation/items/quick3dchannelmapper.cpp index 55eb04be1..66ee7faef 100644 --- a/src/quick3d/quick3danimation/items/quick3dchannelmapper.cpp +++ b/src/quick3d/quick3danimation/items/quick3dchannelmapper.cpp @@ -50,38 +50,38 @@ Quick3DChannelMapper::Quick3DChannelMapper(QObject *parent) { } -QQmlListProperty<QChannelMapping> Quick3DChannelMapper::qmlMappings() +QQmlListProperty<QAbstractChannelMapping> Quick3DChannelMapper::qmlMappings() { - return QQmlListProperty<QChannelMapping>(this, 0, - &Quick3DChannelMapper::appendMapping, - &Quick3DChannelMapper::mappingCount, - &Quick3DChannelMapper::mappingAt, - &Quick3DChannelMapper::clearMappings); + return QQmlListProperty<QAbstractChannelMapping>(this, 0, + &Quick3DChannelMapper::appendMapping, + &Quick3DChannelMapper::mappingCount, + &Quick3DChannelMapper::mappingAt, + &Quick3DChannelMapper::clearMappings); } -void Quick3DChannelMapper::appendMapping(QQmlListProperty<QChannelMapping> *list, QChannelMapping *mapping) +void Quick3DChannelMapper::appendMapping(QQmlListProperty<QAbstractChannelMapping> *list, QAbstractChannelMapping *mapping) { Quick3DChannelMapper *extension = qobject_cast<Quick3DChannelMapper *>(list->object); extension->parentMapper()->addMapping(mapping); } -QChannelMapping *Quick3DChannelMapper::mappingAt(QQmlListProperty<QChannelMapping> *list, int index) +QAbstractChannelMapping *Quick3DChannelMapper::mappingAt(QQmlListProperty<QAbstractChannelMapping> *list, int index) { Quick3DChannelMapper *extension = qobject_cast<Quick3DChannelMapper *>(list->object); return extension->parentMapper()->mappings().at(index); } -int Quick3DChannelMapper::mappingCount(QQmlListProperty<QChannelMapping> *list) +int Quick3DChannelMapper::mappingCount(QQmlListProperty<QAbstractChannelMapping> *list) { Quick3DChannelMapper *extension = qobject_cast<Quick3DChannelMapper *>(list->object); return extension->parentMapper()->mappings().count(); } -void Quick3DChannelMapper::clearMappings(QQmlListProperty<QChannelMapping> *list) +void Quick3DChannelMapper::clearMappings(QQmlListProperty<QAbstractChannelMapping> *list) { Quick3DChannelMapper *extension = qobject_cast<Quick3DChannelMapper *>(list->object); const auto mappings = extension->parentMapper()->mappings(); - for (QChannelMapping *mapping : mappings) + for (QAbstractChannelMapping *mapping : mappings) extension->parentMapper()->removeMapping(mapping); } diff --git a/src/quick3d/quick3danimation/items/quick3dchannelmapper_p.h b/src/quick3d/quick3danimation/items/quick3dchannelmapper_p.h index e44efad68..c3ec577a2 100644 --- a/src/quick3d/quick3danimation/items/quick3dchannelmapper_p.h +++ b/src/quick3d/quick3danimation/items/quick3dchannelmapper_p.h @@ -52,7 +52,7 @@ // #include <Qt3DQuickAnimation/private/qt3dquickanimation_global_p.h> -#include <Qt3DAnimation/qchannelmapping.h> +#include <Qt3DAnimation/qabstractchannelmapping.h> #include <Qt3DAnimation/qchannelmapper.h> #include <QQmlListProperty> @@ -65,20 +65,20 @@ namespace Quick { class QT3DQUICKANIMATIONSHARED_PRIVATE_EXPORT Quick3DChannelMapper : public QObject { Q_OBJECT - Q_PROPERTY(QQmlListProperty<Qt3DAnimation::QChannelMapping> mappings READ qmlMappings CONSTANT) + Q_PROPERTY(QQmlListProperty<Qt3DAnimation::QAbstractChannelMapping> mappings READ qmlMappings CONSTANT) Q_CLASSINFO("DefaultProperty", "mappings") public: explicit Quick3DChannelMapper(QObject *parent = nullptr); inline QChannelMapper *parentMapper() const { return qobject_cast<QChannelMapper *>(parent()); } - QQmlListProperty<QChannelMapping> qmlMappings(); + QQmlListProperty<QAbstractChannelMapping> qmlMappings(); private: - static void appendMapping(QQmlListProperty<QChannelMapping> *list, QChannelMapping *mapping); - static QChannelMapping *mappingAt(QQmlListProperty<QChannelMapping> *list, int index); - static int mappingCount(QQmlListProperty<QChannelMapping> *list); - static void clearMappings(QQmlListProperty<QChannelMapping> *list); + static void appendMapping(QQmlListProperty<QAbstractChannelMapping> *list, QAbstractChannelMapping *mapping); + static QAbstractChannelMapping *mappingAt(QQmlListProperty<QAbstractChannelMapping> *list, int index); + static int mappingCount(QQmlListProperty<QAbstractChannelMapping> *list); + static void clearMappings(QQmlListProperty<QAbstractChannelMapping> *list); }; } // namespace Quick diff --git a/src/quick3d/quick3danimation/qt3dquickanimationnodefactory.cpp b/src/quick3d/quick3danimation/qt3dquickanimationnodefactory.cpp index 8dbc501b9..879389bd9 100644 --- a/src/quick3d/quick3danimation/qt3dquickanimationnodefactory.cpp +++ b/src/quick3d/quick3danimation/qt3dquickanimationnodefactory.cpp @@ -64,12 +64,10 @@ Qt3DCore::QNode *QuickAnimationNodeFactory::createNode(const char *type) if (!typeInfo.resolved) { typeInfo.resolved = true; -#if 0 typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), typeInfo.version.first, typeInfo.version.second); -#endif } - return typeInfo.t ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t->create()) : nullptr; + return typeInfo.t.isValid() ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t.create()) : nullptr; } } // namespace Qt3DAnimation diff --git a/src/quick3d/quick3danimation/qt3dquickanimationnodefactory_p.h b/src/quick3d/quick3danimation/qt3dquickanimationnodefactory_p.h index 5b1dd831b..ca10c874f 100644 --- a/src/quick3d/quick3danimation/qt3dquickanimationnodefactory_p.h +++ b/src/quick3d/quick3danimation/qt3dquickanimationnodefactory_p.h @@ -77,7 +77,7 @@ private: : quickName(quickName), version(major, minor), t(nullptr), resolved(false) { } QByteArray quickName; QPair<int, int> version; - QQmlType *t; + QQmlType t; bool resolved; }; QHash<QByteArray, Type> m_types; diff --git a/src/quick3d/quick3dextras/qt3dquickextrasnodefactory.cpp b/src/quick3d/quick3dextras/qt3dquickextrasnodefactory.cpp index be7dec52a..2e1f993f9 100644 --- a/src/quick3d/quick3dextras/qt3dquickextrasnodefactory.cpp +++ b/src/quick3d/quick3dextras/qt3dquickextrasnodefactory.cpp @@ -38,7 +38,6 @@ ****************************************************************************/ #include "qt3dquickextrasnodefactory_p.h" -#include <private/qqmlmetatype_p.h> QT_BEGIN_NAMESPACE @@ -65,12 +64,10 @@ Qt3DCore::QNode *QuickExtrasNodeFactory::createNode(const char *type) if (!typeInfo.resolved) { typeInfo.resolved = true; -#if 0 typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), typeInfo.version.first, typeInfo.version.second); -#endif } - return typeInfo.t ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t->create()) : nullptr; + return typeInfo.t.isValid() ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t.create()) : nullptr; } } // namespace Qt3DExtras diff --git a/src/quick3d/quick3dextras/qt3dquickextrasnodefactory_p.h b/src/quick3d/quick3dextras/qt3dquickextrasnodefactory_p.h index 03769c397..43172952c 100644 --- a/src/quick3d/quick3dextras/qt3dquickextrasnodefactory_p.h +++ b/src/quick3d/quick3dextras/qt3dquickextrasnodefactory_p.h @@ -53,6 +53,7 @@ #include <private/qabstractnodefactory_p.h> #include <QtCore/qhash.h> +#include <QtQml/private/qqmlmetatype_p.h> QT_BEGIN_NAMESPACE @@ -76,7 +77,7 @@ private: : quickName(quickName), version(major, minor), t(nullptr), resolved(false) { } QByteArray quickName; QPair<int, int> version; - QQmlType *t; + QQmlType t; bool resolved; }; QHash<QByteArray, Type> m_types; diff --git a/src/quick3d/quick3dextras/qt3dquickwindow.cpp b/src/quick3d/quick3dextras/qt3dquickwindow.cpp index 91773bb66..e41754f42 100644 --- a/src/quick3d/quick3dextras/qt3dquickwindow.cpp +++ b/src/quick3d/quick3dextras/qt3dquickwindow.cpp @@ -131,10 +131,10 @@ Qt3DQuickWindow::Qt3DQuickWindow(QWindow *parent) setFormat(format); QSurfaceFormat::setDefaultFormat(format); - 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; + d->m_engine = new Qt3DCore::Quick::QQmlAspectEngine; d->m_engine->aspectEngine()->registerAspect(d->m_renderAspect); d->m_engine->aspectEngine()->registerAspect(d->m_inputAspect); diff --git a/src/quick3d/quick3dinput/qt3dquickinputnodefactory.cpp b/src/quick3d/quick3dinput/qt3dquickinputnodefactory.cpp index 11bb3b55b..0692b15d6 100644 --- a/src/quick3d/quick3dinput/qt3dquickinputnodefactory.cpp +++ b/src/quick3d/quick3dinput/qt3dquickinputnodefactory.cpp @@ -64,12 +64,10 @@ Qt3DCore::QNode *QuickInputNodeFactory::createNode(const char *type) if (!typeInfo.resolved) { typeInfo.resolved = true; -#if 0 typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), typeInfo.version.first, typeInfo.version.second); -#endif } - return typeInfo.t ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t->create()) : nullptr; + return typeInfo.t.isValid() ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t.create()) : nullptr; } } // namespace Qt3DInput diff --git a/src/quick3d/quick3dinput/qt3dquickinputnodefactory_p.h b/src/quick3d/quick3dinput/qt3dquickinputnodefactory_p.h index 7aa6c85d9..e9d28dafe 100644 --- a/src/quick3d/quick3dinput/qt3dquickinputnodefactory_p.h +++ b/src/quick3d/quick3dinput/qt3dquickinputnodefactory_p.h @@ -77,7 +77,7 @@ private: : quickName(quickName), version(major, minor), t(nullptr), resolved(false) { } QByteArray quickName; QPair<int, int> version; - QQmlType *t; + QQmlType t; bool resolved; }; QHash<QByteArray, Type> m_types; diff --git a/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp b/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp index 82025c046..a4f786a76 100644 --- a/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp +++ b/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp @@ -64,12 +64,10 @@ Qt3DCore::QNode *QuickRenderNodeFactory::createNode(const char *type) if (!typeInfo.resolved) { typeInfo.resolved = true; -#if 0 typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), typeInfo.version.first, typeInfo.version.second); -#endif } - return typeInfo.t ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t->create()) : nullptr; + return typeInfo.t.isValid() ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t.create()) : nullptr; } } // namespace Qt3DRender diff --git a/src/quick3d/quick3drender/qt3dquickrendernodefactory_p.h b/src/quick3d/quick3drender/qt3dquickrendernodefactory_p.h index cc19eb656..dd3788878 100644 --- a/src/quick3d/quick3drender/qt3dquickrendernodefactory_p.h +++ b/src/quick3d/quick3drender/qt3dquickrendernodefactory_p.h @@ -77,7 +77,7 @@ private: : quickName(quickName), version(major, minor), t(nullptr), resolved(false) { } QByteArray quickName; QPair<int, int> version; - QQmlType *t; + QQmlType t; bool resolved; }; QHash<QByteArray, Type> m_types; diff --git a/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory.cpp b/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory.cpp index 0724bca5e..417b28ea0 100644 --- a/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory.cpp +++ b/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory.cpp @@ -76,13 +76,11 @@ Qt3DCore::QNode *QuickScene2DNodeFactory::createNode(const char *type) if (!typeInfo.resolved) { typeInfo.resolved = true; -#if 0 typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), typeInfo.version.first, typeInfo.version.second); -#endif } - return typeInfo.t ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t->create()) : nullptr; + return typeInfo.t.isValid() ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t.create()) : nullptr; } } // namespace Qt3DRender diff --git a/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory_p.h b/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory_p.h index 81ee5ee5b..9166c6ec2 100644 --- a/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory_p.h +++ b/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory_p.h @@ -77,7 +77,7 @@ private: : quickName(quickName), version(major, minor), t(nullptr), resolved(false) { } QByteArray quickName; QPair<int, int> version; - QQmlType *t; + QQmlType t; bool resolved; }; QHash<QByteArray, Type> m_types; |