summaryrefslogtreecommitdiffstats
path: root/src/quick3d/quick3d/qt3dquick_global_p.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-08-10 10:17:53 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-08-20 11:59:11 +0000
commit14bb6fb6d8e1fbde317111b57e42e3a380927d8b (patch)
treea7d85dd83aa8b72528c053733245df4a5fd5a723 /src/quick3d/quick3d/qt3dquick_global_p.h
parent9bf2094621e3fba71710f47d7121f1182c3f3337 (diff)
Create proper Quick extended classes in scene loaders
This allows exploring the loaded subtrees from QML/Javascript code. The C++ classes are not suitable for this as they lack properties that involve QML specifics. The assimp (QML) example is updated to show how to do this (with the help of some C++ code). Say hello to the pulsating torus and the rotating monkey! Change-Id: I60401272105df5d72f4b7afebe26a3271e92f19e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/quick3d/quick3d/qt3dquick_global_p.h')
-rw-r--r--src/quick3d/quick3d/qt3dquick_global_p.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/quick3d/quick3d/qt3dquick_global_p.h b/src/quick3d/quick3d/qt3dquick_global_p.h
index dee85dbb2..6e4446082 100644
--- a/src/quick3d/quick3d/qt3dquick_global_p.h
+++ b/src/quick3d/quick3d/qt3dquick_global_p.h
@@ -38,6 +38,7 @@
#define QT3DQUICK_GLOBAL_P_H
#include <Qt3DQuick/qt3dquick_global.h>
+#include <QtQml/qqml.h>
#define QT3DQUICKSHARED_PRIVATE_EXPORT QT3DQUICKSHARED_EXPORT
@@ -47,7 +48,15 @@ namespace Qt3D {
namespace Quick {
-QT3DQUICKSHARED_PRIVATE_EXPORT void Quick3D_initializeProviders();
+QT3DQUICKSHARED_PRIVATE_EXPORT void Quick3D_initialize();
+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,
+ const char *uri, int major, int minor, const char *name)
+{
+ qmlRegisterExtendedType<T, E>(uri, major, minor, name);
+ Quick3D_registerType(className, quickName, major, minor);
+}
} // Quick