From 3fb191bbeb0e8a2d49c5107df07c5457872357b3 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 23 Feb 2010 09:46:34 +0100 Subject: Get rid of QmlModulePlugin. --- .../plugins/com/nokia/TimeExample/Clock.qml | 50 ++++++++++ .../plugins/com/nokia/TimeExample/center.png | Bin 0 -> 765 bytes .../plugins/com/nokia/TimeExample/clock.png | Bin 0 -> 20653 bytes .../plugins/com/nokia/TimeExample/hour.png | Bin 0 -> 625 bytes .../plugins/com/nokia/TimeExample/minute.png | Bin 0 -> 625 bytes examples/declarative/plugins/files/Clock.qml | 50 ---------- examples/declarative/plugins/files/center.png | Bin 765 -> 0 bytes examples/declarative/plugins/files/clock.png | Bin 20653 -> 0 bytes examples/declarative/plugins/files/hour.png | Bin 625 -> 0 bytes examples/declarative/plugins/files/minute.png | Bin 625 -> 0 bytes examples/declarative/plugins/plugin.cpp | 14 +-- examples/declarative/plugins/plugins.pro | 13 ++- src/declarative/qml/qml.pri | 2 - src/declarative/qml/qmlengine.cpp | 1 - src/declarative/qml/qmlmoduleplugin.cpp | 111 --------------------- src/declarative/qml/qmlmoduleplugin.h | 86 ---------------- src/multimedia/qml/qml.cpp | 10 +- src/multimedia/qml/qml.h | 4 +- src/plugins/qmlmodules/multimedia/multimedia.cpp | 16 +-- 19 files changed, 79 insertions(+), 278 deletions(-) create mode 100644 examples/declarative/plugins/com/nokia/TimeExample/Clock.qml create mode 100644 examples/declarative/plugins/com/nokia/TimeExample/center.png create mode 100644 examples/declarative/plugins/com/nokia/TimeExample/clock.png create mode 100644 examples/declarative/plugins/com/nokia/TimeExample/hour.png create mode 100644 examples/declarative/plugins/com/nokia/TimeExample/minute.png delete mode 100644 examples/declarative/plugins/files/Clock.qml delete mode 100644 examples/declarative/plugins/files/center.png delete mode 100644 examples/declarative/plugins/files/clock.png delete mode 100644 examples/declarative/plugins/files/hour.png delete mode 100644 examples/declarative/plugins/files/minute.png delete mode 100644 src/declarative/qml/qmlmoduleplugin.cpp delete mode 100644 src/declarative/qml/qmlmoduleplugin.h diff --git a/examples/declarative/plugins/com/nokia/TimeExample/Clock.qml b/examples/declarative/plugins/com/nokia/TimeExample/Clock.qml new file mode 100644 index 0000000..01ec686 --- /dev/null +++ b/examples/declarative/plugins/com/nokia/TimeExample/Clock.qml @@ -0,0 +1,50 @@ +import Qt 4.6 + +Item { + id: clock + width: 200; height: 200 + + property alias city: cityLabel.text + property var hours + property var minutes + property var shift : 0 + + Image { id: background; source: "clock.png" } + + Image { + x: 92.5; y: 27 + source: "hour.png" + smooth: true + transform: Rotation { + id: hourRotation + origin.x: 7.5; origin.y: 73; angle: 0 + angle: SpringFollow { + spring: 2; damping: 0.2; modulus: 360 + source: (clock.hours * 30) + (clock.minutes * 0.5) + } + } + } + + Image { + x: 93.5; y: 17 + source: "minute.png" + smooth: true + transform: Rotation { + id: minuteRotation + origin.x: 6.5; origin.y: 83; angle: 0 + angle: SpringFollow { + spring: 2; damping: 0.2; modulus: 360 + source: clock.minutes * 6 + } + } + } + + Image { + anchors.centerIn: background; source: "center.png" + } + + Text { + id: cityLabel; font.bold: true; font.pixelSize: 14; y:200; color: "white" + anchors.horizontalCenter: parent.horizontalCenter + } +} diff --git a/examples/declarative/plugins/com/nokia/TimeExample/center.png b/examples/declarative/plugins/com/nokia/TimeExample/center.png new file mode 100644 index 0000000..7fbd802 Binary files /dev/null and b/examples/declarative/plugins/com/nokia/TimeExample/center.png differ diff --git a/examples/declarative/plugins/com/nokia/TimeExample/clock.png b/examples/declarative/plugins/com/nokia/TimeExample/clock.png new file mode 100644 index 0000000..462edac Binary files /dev/null and b/examples/declarative/plugins/com/nokia/TimeExample/clock.png differ diff --git a/examples/declarative/plugins/com/nokia/TimeExample/hour.png b/examples/declarative/plugins/com/nokia/TimeExample/hour.png new file mode 100644 index 0000000..f8061a1 Binary files /dev/null and b/examples/declarative/plugins/com/nokia/TimeExample/hour.png differ diff --git a/examples/declarative/plugins/com/nokia/TimeExample/minute.png b/examples/declarative/plugins/com/nokia/TimeExample/minute.png new file mode 100644 index 0000000..1297ec7 Binary files /dev/null and b/examples/declarative/plugins/com/nokia/TimeExample/minute.png differ diff --git a/examples/declarative/plugins/files/Clock.qml b/examples/declarative/plugins/files/Clock.qml deleted file mode 100644 index 01ec686..0000000 --- a/examples/declarative/plugins/files/Clock.qml +++ /dev/null @@ -1,50 +0,0 @@ -import Qt 4.6 - -Item { - id: clock - width: 200; height: 200 - - property alias city: cityLabel.text - property var hours - property var minutes - property var shift : 0 - - Image { id: background; source: "clock.png" } - - Image { - x: 92.5; y: 27 - source: "hour.png" - smooth: true - transform: Rotation { - id: hourRotation - origin.x: 7.5; origin.y: 73; angle: 0 - angle: SpringFollow { - spring: 2; damping: 0.2; modulus: 360 - source: (clock.hours * 30) + (clock.minutes * 0.5) - } - } - } - - Image { - x: 93.5; y: 17 - source: "minute.png" - smooth: true - transform: Rotation { - id: minuteRotation - origin.x: 6.5; origin.y: 83; angle: 0 - angle: SpringFollow { - spring: 2; damping: 0.2; modulus: 360 - source: clock.minutes * 6 - } - } - } - - Image { - anchors.centerIn: background; source: "center.png" - } - - Text { - id: cityLabel; font.bold: true; font.pixelSize: 14; y:200; color: "white" - anchors.horizontalCenter: parent.horizontalCenter - } -} diff --git a/examples/declarative/plugins/files/center.png b/examples/declarative/plugins/files/center.png deleted file mode 100644 index 7fbd802..0000000 Binary files a/examples/declarative/plugins/files/center.png and /dev/null differ diff --git a/examples/declarative/plugins/files/clock.png b/examples/declarative/plugins/files/clock.png deleted file mode 100644 index 462edac..0000000 Binary files a/examples/declarative/plugins/files/clock.png and /dev/null differ diff --git a/examples/declarative/plugins/files/hour.png b/examples/declarative/plugins/files/hour.png deleted file mode 100644 index f8061a1..0000000 Binary files a/examples/declarative/plugins/files/hour.png and /dev/null differ diff --git a/examples/declarative/plugins/files/minute.png b/examples/declarative/plugins/files/minute.png deleted file mode 100644 index 1297ec7..0000000 Binary files a/examples/declarative/plugins/files/minute.png and /dev/null 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 +#include #include #include #include @@ -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