diff options
Diffstat (limited to 'examples/declarative/plugins')
-rw-r--r-- | examples/declarative/plugins/com/nokia/TimeExample/Clock.qml (renamed from examples/declarative/plugins/files/Clock.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/plugins/com/nokia/TimeExample/center.png (renamed from examples/declarative/plugins/files/center.png) | bin | 765 -> 765 bytes | |||
-rw-r--r-- | examples/declarative/plugins/com/nokia/TimeExample/clock.png (renamed from examples/declarative/plugins/files/clock.png) | bin | 20653 -> 20653 bytes | |||
-rw-r--r-- | examples/declarative/plugins/com/nokia/TimeExample/hour.png (renamed from examples/declarative/plugins/files/hour.png) | bin | 625 -> 625 bytes | |||
-rw-r--r-- | examples/declarative/plugins/com/nokia/TimeExample/minute.png (renamed from examples/declarative/plugins/files/minute.png) | bin | 625 -> 625 bytes | |||
-rw-r--r-- | examples/declarative/plugins/com/nokia/TimeExample/qmldir | 2 | ||||
-rw-r--r-- | examples/declarative/plugins/plugin.cpp | 14 | ||||
-rw-r--r-- | examples/declarative/plugins/plugins.pro | 22 | ||||
-rw-r--r-- | examples/declarative/plugins/plugins.qml | 1 |
9 files changed, 24 insertions, 15 deletions
diff --git a/examples/declarative/plugins/files/Clock.qml b/examples/declarative/plugins/com/nokia/TimeExample/Clock.qml index 01ec686..01ec686 100644 --- a/examples/declarative/plugins/files/Clock.qml +++ b/examples/declarative/plugins/com/nokia/TimeExample/Clock.qml diff --git a/examples/declarative/plugins/files/center.png b/examples/declarative/plugins/com/nokia/TimeExample/center.png Binary files differindex 7fbd802..7fbd802 100644 --- a/examples/declarative/plugins/files/center.png +++ b/examples/declarative/plugins/com/nokia/TimeExample/center.png diff --git a/examples/declarative/plugins/files/clock.png b/examples/declarative/plugins/com/nokia/TimeExample/clock.png Binary files differindex 462edac..462edac 100644 --- a/examples/declarative/plugins/files/clock.png +++ b/examples/declarative/plugins/com/nokia/TimeExample/clock.png diff --git a/examples/declarative/plugins/files/hour.png b/examples/declarative/plugins/com/nokia/TimeExample/hour.png Binary files differindex f8061a1..f8061a1 100644 --- a/examples/declarative/plugins/files/hour.png +++ b/examples/declarative/plugins/com/nokia/TimeExample/hour.png diff --git a/examples/declarative/plugins/files/minute.png b/examples/declarative/plugins/com/nokia/TimeExample/minute.png Binary files differindex 1297ec7..1297ec7 100644 --- a/examples/declarative/plugins/files/minute.png +++ b/examples/declarative/plugins/com/nokia/TimeExample/minute.png diff --git a/examples/declarative/plugins/com/nokia/TimeExample/qmldir b/examples/declarative/plugins/com/nokia/TimeExample/qmldir new file mode 100644 index 0000000..e9ef115 --- /dev/null +++ b/examples/declarative/plugins/com/nokia/TimeExample/qmldir @@ -0,0 +1,2 @@ +Clock 1.0 Clock.qml +plugin qtimeexampleqmlplugin diff --git a/examples/declarative/plugins/plugin.cpp b/examples/declarative/plugins/plugin.cpp index 820d4eb..8e21263 100644 --- a/examples/declarative/plugins/plugin.cpp +++ b/examples/declarative/plugins/plugin.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include <QtDeclarative/qmlmoduleplugin.h> +#include <QtDeclarative/QmlExtensionPlugin> #include <QtDeclarative/qml.h> #include <qdebug.h> #include <qdatetime.h> @@ -140,19 +140,15 @@ MinuteTimer *Time::timer=0; QML_DECLARE_TYPE(Time); -class QExampleQmlPlugin : public QmlModulePlugin +class QExampleQmlPlugin : public QmlExtensionPlugin { Q_OBJECT public: - QStringList keys() const - { - return QStringList() << QLatin1String("com.nokia.TimeExample"); - } - - void defineModule(const QString& uri) + void initialize(QmlEngine *engine, const char *uri) { + Q_UNUSED(engine); Q_ASSERT(uri == QLatin1String("com.nokia.TimeExample")); - qmlRegisterType<Time>("com.nokia.TimeExample", 1, 0, "Time", "Time"); + qmlRegisterType<Time>(uri, 1, 0, "Time", "Time"); } }; diff --git a/examples/declarative/plugins/plugins.pro b/examples/declarative/plugins/plugins.pro index 84ab8da..c9c9f7e 100644 --- a/examples/declarative/plugins/plugins.pro +++ b/examples/declarative/plugins/plugins.pro @@ -1,15 +1,27 @@ TEMPLATE = lib +DESTDIR = com/nokia/TimeExample TARGET = qtimeexampleqmlplugin CONFIG += qt plugin QT += declarative +VERSION = 1.0.0 SOURCES += plugin.cpp -target.path += $$[QT_INSTALL_PLUGINS]/qmlmodules -sources.files += files/Clock.qml files/qmldir files/background.png files/center.png files/clock-night.png files/clock.png files/hour.png files/minute.png -sources.path += $$[QT_INSTALL_DATA]/qml/com/nokia/TimeExample -INSTALLS += target sources +qmlsources.files += \ + com/nokia/TimeExample/qmldir \ + com/nokia/TimeExample/center.png \ + com/nokia/TimeExample/clock.png \ + com/nokia/TimeExample/Clock.qml \ + com/nokia/TimeExample/hour.png \ + com/nokia/TimeExample/minute.png +qmlsources.path += $$[QT_INSTALL_EXAMPLES]/declarative/plugins/com/nokia/TimeExample -VERSION=1.0.0 +sources.files += plugins.pro plugin.cpp plugins.qml +sources.path += $$[QT_INSTALL_EXAMPLES]/declarative/plugins +target.path += $$[QT_INSTALL_EXAMPLES]/declarative/plugins/com/nokia/TimeExample + +INSTALLS += qmlsources sources target + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/declarative/plugins/plugins.qml b/examples/declarative/plugins/plugins.qml index dbeb001..44b552b 100644 --- a/examples/declarative/plugins/plugins.qml +++ b/examples/declarative/plugins/plugins.qml @@ -1,5 +1,4 @@ import com.nokia.TimeExample 1.0 // import types from the plugin -import 'files' // import types from the 'files' directory Clock { // this class is defined in QML (files/Clock.qml) |