summaryrefslogtreecommitdiffstats
path: root/src/quick3d/quick3d/qt3dquick_global.cpp
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2014-12-30 13:00:39 +0000
committerSean Harmer <sean.harmer@kdab.com>2014-12-30 19:01:49 +0100
commit1675b5968365b927e795e239a322c1351fcc5677 (patch)
tree23861696bfea1f8067cb78b79e004a13058eacbd /src/quick3d/quick3d/qt3dquick_global.cpp
parent6306fc6a75481334c9fb1cbc7a81f4303ecddc59 (diff)
Fix compilation of Qt3D following fa3cf15e in qtdecalrative
The commit fa3cf15e0577fe382ac577456422ad78325a3977 in qtdeclarative changed the way QML value types are implemented. This commit fixes compilation of Qt3D by using the new approach for value types. Also fixed omission of Digia copyright (copy/paste error when originally adding these files). Change-Id: I9c186b792f8d2dca6cf48e619a57d50b8705ade6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/quick3d/quick3d/qt3dquick_global.cpp')
-rw-r--r--src/quick3d/quick3d/qt3dquick_global.cpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/quick3d/quick3d/qt3dquick_global.cpp b/src/quick3d/quick3d/qt3dquick_global.cpp
index 5ce361cf6..3d4450897 100644
--- a/src/quick3d/quick3d/qt3dquick_global.cpp
+++ b/src/quick3d/quick3d/qt3dquick_global.cpp
@@ -288,33 +288,26 @@ public:
return QMatrix4x4(matVals);
}
- template<typename T>
- bool typedCreate(QQmlValueType *&v)
- {
- v = new T;
- return true;
- }
-
- bool create(int type, QQmlValueType *&v)
+ const QMetaObject *getMetaObjectForMetaType(int type)
{
switch (type) {
case QMetaType::QColor:
- return typedCreate<Quick3DColorValueType>(v);
+ return &Quick3DColorValueType::staticMetaObject;
case QMetaType::QVector2D:
- return typedCreate<Quick3DVector2DValueType>(v);
+ return &Quick3DVector2DValueType::staticMetaObject;
case QMetaType::QVector3D:
- return typedCreate<Quick3DVector3DValueType>(v);
+ return &Quick3DVector3DValueType::staticMetaObject;
case QMetaType::QVector4D:
- return typedCreate<Quick3DVector4DValueType>(v);
+ return &Quick3DVector4DValueType::staticMetaObject;
case QMetaType::QQuaternion:
- return typedCreate<Quick3DQuaternionValueType>(v);
+ return &Quick3DQuaternionValueType::staticMetaObject;
case QMetaType::QMatrix4x4:
- return typedCreate<Quick3DMatrix4x4ValueType>(v);
+ return &Quick3DMatrix4x4ValueType::staticMetaObject;
default:
break;
}
- return false;
+ return Q_NULLPTR;
}
template<typename T>