From 6c51b1c9e456f39d4e75303fe74d348e7f859e1b Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 1 Feb 2010 15:00:28 +1000 Subject: Don't use statics for type definition, at least for plugin modules. Task-number: QT-2798 --- examples/declarative/plugins/plugin.cpp | 7 ++++++- src/declarative/qml/qmlengine.cpp | 4 +++- src/declarative/qml/qmlmoduleplugin.cpp | 26 ++++++++++++++++++++++++-- src/declarative/qml/qmlmoduleplugin.h | 8 ++++++++ 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/examples/declarative/plugins/plugin.cpp b/examples/declarative/plugins/plugin.cpp index 9688caf..f4aa36b 100644 --- a/examples/declarative/plugins/plugin.cpp +++ b/examples/declarative/plugins/plugin.cpp @@ -138,7 +138,6 @@ MinuteTimer *Time::timer=0; QML_DECLARE_TYPE(Time); -QML_DEFINE_TYPE(com.nokia.TimeExample,1,0,Time,Time); class QExampleQmlPlugin : public QmlModulePlugin @@ -149,6 +148,12 @@ public: { return QStringList() << QLatin1String("com.nokia.TimeExample"); } + + void defineModule(const QString& uri) + { + Q_ASSERT(uri == QLatin1String("com.nokia.TimeExample")); + qmlRegisterType