diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-02-25 10:41:42 (GMT) |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-02-25 10:47:05 (GMT) |
commit | 8df48c2c402873b55c037fb150594c6529e8f146 (patch) | |
tree | 7ba8bccacfcd924163ae88573e629beefe8f4425 /src/plugins | |
parent | f5bb807d6938fbd39ea1f99ed45c817d538e4287 (diff) | |
download | Qt-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 'src/plugins')
-rw-r--r-- | src/plugins/qdeclarativemodules/multimedia/multimedia.cpp | 4 | ||||
-rw-r--r-- | src/plugins/qdeclarativemodules/widgets/widgets.cpp | 9 |
2 files changed, 3 insertions, 10 deletions
diff --git a/src/plugins/qdeclarativemodules/multimedia/multimedia.cpp b/src/plugins/qdeclarativemodules/multimedia/multimedia.cpp index e27dd8d..8becbf3 100644 --- a/src/plugins/qdeclarativemodules/multimedia/multimedia.cpp +++ b/src/plugins/qdeclarativemodules/multimedia/multimedia.cpp @@ -49,9 +49,9 @@ class QMultimediaQmlModule : public QDeclarativeExtensionPlugin { Q_OBJECT public: - virtual void initialize(QDeclarativeEngine *engine, const char *uri) + virtual void registerTypes(const char *uri) { - QtMultimedia::qRegisterDeclarativeElements(engine, uri); + QtMultimedia::qRegisterDeclarativeElements(uri); } }; diff --git a/src/plugins/qdeclarativemodules/widgets/widgets.cpp b/src/plugins/qdeclarativemodules/widgets/widgets.cpp index 7229d88..ec21cc4 100644 --- a/src/plugins/qdeclarativemodules/widgets/widgets.cpp +++ b/src/plugins/qdeclarativemodules/widgets/widgets.cpp @@ -114,15 +114,8 @@ class QWidgetsQmlModule : public QDeclarativeExtensionPlugin { Q_OBJECT public: - QStringList keys() const + virtual void registerTypes(const char *uri) { - return QStringList() << QLatin1String("Qt.widgets"); - } - - virtual void initialize(QDeclarativeEngine *engine, const char *uri) - { - Q_UNUSED(engine); - Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.widgets")); QML_REGISTER_INTERFACE(QGraphicsLayoutItem); |