summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2010-02-25 10:41:42 (GMT)
committerRoberto Raggi <roberto.raggi@nokia.com>2010-02-25 10:47:05 (GMT)
commit8df48c2c402873b55c037fb150594c6529e8f146 (patch)
tree7ba8bccacfcd924163ae88573e629beefe8f4425 /examples
parentf5bb807d6938fbd39ea1f99ed45c817d538e4287 (diff)
downloadQt-8df48c2c402873b55c037fb150594c6529e8f146.zip
Qt-8df48c2c402873b55c037fb150594c6529e8f146.tar.gz
Qt-8df48c2c402873b55c037fb150594c6529e8f146.tar.bz2
Introduced QDeclarativeExtensionPlugin::registerTypes(uri).
Now, you have to reimplement registerTypes(uri) to expose native QML types, and initializeEngine(engine,uri) to add instances to the QML engine's root context.
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/plugins/plugin.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/declarative/plugins/plugin.cpp b/examples/declarative/plugins/plugin.cpp
index f6385d0..741f68a 100644
--- a/examples/declarative/plugins/plugin.cpp
+++ b/examples/declarative/plugins/plugin.cpp
@@ -144,11 +144,10 @@ class QExampleQmlPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
public:
- void initialize(QDeclarativeEngine *engine, const char *uri)
+ void registerTypes(const char *uri)
{
- Q_UNUSED(engine);
Q_ASSERT(uri == QLatin1String("com.nokia.TimeExample"));
- qmlRegisterType<Time>(uri, 1, 0, "Time", "Time");
+ qmlRegisterType<Time>(uri, 1, 0, "Time");
}
};