summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-02-21 09:53:27 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-21 15:34:38 +0100
commit650a8ccc21f8e65730afb195b05790e3b3f9985f (patch)
tree6d2ba7166b86d2a87a2a934733becaaeb6cd7d26 /examples
parent4f3300b7ce5c3138421a21ec83615a536c9fd316 (diff)
Use new plugin system in QtQuick1.
- Use prefix "org.qt-project" for interfaces. - Use new macros, add json files. Change-Id: I157206ad883be16fb85b9b6bffca7200532561e4 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider.cpp6
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider.json1
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider.pro2
-rw-r--r--examples/declarative/cppextensions/plugins/plugin.cpp6
-rw-r--r--examples/declarative/cppextensions/plugins/plugin.json1
-rw-r--r--examples/declarative/cppextensions/plugins/plugins.pro2
-rw-r--r--examples/declarative/cppextensions/qwidgets/qwidgets.cpp4
-rw-r--r--examples/declarative/cppextensions/qwidgets/qwidgets.json1
-rw-r--r--examples/declarative/cppextensions/qwidgets/qwidgets.pro2
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro6
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp1
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h2
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.json1
13 files changed, 23 insertions, 12 deletions
diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.cpp b/examples/declarative/cppextensions/imageprovider/imageprovider.cpp
index bd12dd42..1048828d 100644
--- a/examples/declarative/cppextensions/imageprovider/imageprovider.cpp
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.cpp
@@ -90,6 +90,7 @@ public:
class ImageProviderExtensionPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface" FILE "imageprovider.json")
public:
void registerTypes(const char *uri)
{
@@ -104,7 +105,10 @@ public:
};
+
+#define QDeclarativeExtensionInterface_iid "org.qt-project.Qt.QDeclarativeExtensionInterface"
+
+
#include "imageprovider.moc"
-Q_EXPORT_PLUGIN(ImageProviderExtensionPlugin);
diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.json b/examples/declarative/cppextensions/imageprovider/imageprovider.json
new file mode 100644
index 00000000..0967ef42
--- /dev/null
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.json
@@ -0,0 +1 @@
+{}
diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.pro b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
index 84044f4f..5c542189 100644
--- a/examples/declarative/cppextensions/imageprovider/imageprovider.pro
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
@@ -7,6 +7,8 @@ TARGET = qmlimageproviderplugin
SOURCES += imageprovider.cpp
+OTHER_FILES += imageprovider.json
+
sources.files = $$SOURCES imageprovider.qml imageprovider.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/imageprovider
diff --git a/examples/declarative/cppextensions/plugins/plugin.cpp b/examples/declarative/cppextensions/plugins/plugin.cpp
index a5734189..acd1660d 100644
--- a/examples/declarative/cppextensions/plugins/plugin.cpp
+++ b/examples/declarative/cppextensions/plugins/plugin.cpp
@@ -141,6 +141,8 @@ MinuteTimer *TimeModel::timer=0;
class QExampleQmlPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface" FILE "plugin.json")
+
public:
void registerTypes(const char *uri)
{
@@ -151,7 +153,3 @@ public:
//![plugin]
#include "plugin.moc"
-
-//![export]
-Q_EXPORT_PLUGIN2(qmlqtimeexampleplugin, QExampleQmlPlugin);
-//![export]
diff --git a/examples/declarative/cppextensions/plugins/plugin.json b/examples/declarative/cppextensions/plugins/plugin.json
new file mode 100644
index 00000000..0967ef42
--- /dev/null
+++ b/examples/declarative/cppextensions/plugins/plugin.json
@@ -0,0 +1 @@
+{}
diff --git a/examples/declarative/cppextensions/plugins/plugins.pro b/examples/declarative/cppextensions/plugins/plugins.pro
index a29d3efe..36d0fffb 100644
--- a/examples/declarative/cppextensions/plugins/plugins.pro
+++ b/examples/declarative/cppextensions/plugins/plugins.pro
@@ -7,6 +7,8 @@ TARGET = qmlqtimeexampleplugin
SOURCES += plugin.cpp
+OTHER_FILES += "plugin.json"
+
qdeclarativesources.files += \
com/nokia/TimeExample/qmldir \
com/nokia/TimeExample/center.png \
diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.cpp b/examples/declarative/cppextensions/qwidgets/qwidgets.cpp
index eb6b6427..b697eca9 100644
--- a/examples/declarative/cppextensions/qwidgets/qwidgets.cpp
+++ b/examples/declarative/cppextensions/qwidgets/qwidgets.cpp
@@ -84,6 +84,8 @@ private:
class QWidgetsPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface" FILE "qwidgets.json")
+
public:
void registerTypes(const char *uri)
{
@@ -92,5 +94,3 @@ public:
};
#include "qwidgets.moc"
-
-Q_EXPORT_PLUGIN2(qmlqwidgetsplugin, QWidgetsPlugin);
diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.json b/examples/declarative/cppextensions/qwidgets/qwidgets.json
new file mode 100644
index 00000000..0967ef42
--- /dev/null
+++ b/examples/declarative/cppextensions/qwidgets/qwidgets.json
@@ -0,0 +1 @@
+{}
diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.pro b/examples/declarative/cppextensions/qwidgets/qwidgets.pro
index 750c864b..3cb4dd3e 100644
--- a/examples/declarative/cppextensions/qwidgets/qwidgets.pro
+++ b/examples/declarative/cppextensions/qwidgets/qwidgets.pro
@@ -7,6 +7,8 @@ TARGET = qmlqwidgetsplugin
SOURCES += qwidgets.cpp
+OTHER_FILES += qwidgets.json
+
sources.files += qwidgets.pro qwidgets.cpp qwidgets.qml
sources.path += $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/plugins
target.path += $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/plugins
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro b/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
index 70d4cb47..c2d277f5 100644
--- a/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
@@ -14,8 +14,6 @@ SOURCES += piechart.cpp \
pieslice.cpp \
chartsplugin.cpp
-symbian {
- include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
- TARGET.EPOCALLOWDLLDATA = 1
-}
+OTHER_FILES += chartsplugin.json
+
maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp
index 9c4027de..d75f8109 100644
--- a/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp
@@ -49,6 +49,5 @@ void ChartsPlugin::registerTypes(const char *uri)
qmlRegisterType<PieSlice>(uri, 1, 0, "PieSlice");
}
-Q_EXPORT_PLUGIN2(chartsplugin, ChartsPlugin);
//![0]
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h
index bffcf000..863564b0 100644
--- a/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h
@@ -46,6 +46,8 @@
class ChartsPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface" FILE "chartsplugin.json")
+
public:
void registerTypes(const char *uri);
};
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.json b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.json
new file mode 100644
index 00000000..0967ef42
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.json
@@ -0,0 +1 @@
+{}