summaryrefslogtreecommitdiffstats
path: root/examples/declarative/plugins
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2010-02-23 08:46:34 (GMT)
committerRoberto Raggi <roberto.raggi@nokia.com>2010-02-23 13:47:21 (GMT)
commit3fb191bbeb0e8a2d49c5107df07c5457872357b3 (patch)
tree44e5f820242d40d2c1f80a8f2608b2ab6fbb8d08 /examples/declarative/plugins
parent5eb3c2fc8f90509cb368ab56f14364d6e17844f1 (diff)
downloadQt-3fb191bbeb0e8a2d49c5107df07c5457872357b3.zip
Qt-3fb191bbeb0e8a2d49c5107df07c5457872357b3.tar.gz
Qt-3fb191bbeb0e8a2d49c5107df07c5457872357b3.tar.bz2
Get rid of QmlModulePlugin.
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)bin765 -> 765 bytes
-rw-r--r--examples/declarative/plugins/com/nokia/TimeExample/clock.png (renamed from examples/declarative/plugins/files/clock.png)bin20653 -> 20653 bytes
-rw-r--r--examples/declarative/plugins/com/nokia/TimeExample/hour.png (renamed from examples/declarative/plugins/files/hour.png)bin625 -> 625 bytes
-rw-r--r--examples/declarative/plugins/com/nokia/TimeExample/minute.png (renamed from examples/declarative/plugins/files/minute.png)bin625 -> 625 bytes
-rw-r--r--examples/declarative/plugins/plugin.cpp14
-rw-r--r--examples/declarative/plugins/plugins.pro13
7 files changed, 16 insertions, 11 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
index 7fbd802..7fbd802 100644
--- a/examples/declarative/plugins/files/center.png
+++ b/examples/declarative/plugins/com/nokia/TimeExample/center.png
Binary files differ
diff --git a/examples/declarative/plugins/files/clock.png b/examples/declarative/plugins/com/nokia/TimeExample/clock.png
index 462edac..462edac 100644
--- a/examples/declarative/plugins/files/clock.png
+++ b/examples/declarative/plugins/com/nokia/TimeExample/clock.png
Binary files differ
diff --git a/examples/declarative/plugins/files/hour.png b/examples/declarative/plugins/com/nokia/TimeExample/hour.png
index f8061a1..f8061a1 100644
--- a/examples/declarative/plugins/files/hour.png
+++ b/examples/declarative/plugins/com/nokia/TimeExample/hour.png
Binary files differ
diff --git a/examples/declarative/plugins/files/minute.png b/examples/declarative/plugins/com/nokia/TimeExample/minute.png
index 1297ec7..1297ec7 100644
--- a/examples/declarative/plugins/files/minute.png
+++ b/examples/declarative/plugins/com/nokia/TimeExample/minute.png
Binary files differ
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..d932b01 100644
--- a/examples/declarative/plugins/plugins.pro
+++ b/examples/declarative/plugins/plugins.pro
@@ -1,4 +1,5 @@
TEMPLATE = lib
+DESTDIR = com/nokia/TimeExample
TARGET = qtimeexampleqmlplugin
CONFIG += qt plugin
QT += declarative
@@ -6,10 +7,18 @@ QT += declarative
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.files += \
+ $$PWD/com/nokia/TimeExample/qmldir \
+ $$PWD/com/nokia/TimeExample/center.png \
+ $$PWD/com/nokia/TimeExample/clock.png \
+ $$PWD/com/nokia/TimeExample/Clock.qml \
+ $$PWD/com/nokia/TimeExample/hour.png \
+ $$PWD/com/nokia/TimeExample/minute.png
+
sources.path += $$[QT_INSTALL_DATA]/qml/com/nokia/TimeExample
-INSTALLS += target sources
+INSTALLS += target sources
VERSION=1.0.0