summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-02-01 05:00:28 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-02-01 05:00:28 (GMT)
commit6c51b1c9e456f39d4e75303fe74d348e7f859e1b (patch)
tree5c7bcd5a6c4fe009a6ee7b6ef625d3f643dc1347 /examples
parent7e85c6dc7ba0aaa6dfcad40dc0e9df0e2adb3741 (diff)
downloadQt-6c51b1c9e456f39d4e75303fe74d348e7f859e1b.zip
Qt-6c51b1c9e456f39d4e75303fe74d348e7f859e1b.tar.gz
Qt-6c51b1c9e456f39d4e75303fe74d348e7f859e1b.tar.bz2
Don't use statics for type definition, at least for plugin modules.
Task-number: QT-2798
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/plugins/plugin.cpp7
1 files changed, 6 insertions, 1 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<Time>("com.nokia.TimeExample", 1, 0, "Time", "Time");
+ }
};
#include "plugin.moc"