aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-02-21 10:55:34 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-23 09:05:49 +0100
commitfb3889a423365b1736cae8850cdb2b3ac77b14a8 (patch)
tree65d7c1f7db7de65035ab91a16a136c4556f026bd /examples
parentdc3165178851b9bda71dd238c8a5faca4dfa7a45 (diff)
Use new plugin system in QtDeclarative.
- Use prefix "org.qt-project" for interfaces. - Use new macros, add json files. Change-Id: I53df83f95153c5c9c462098584606284470a5ae0 Reviewed-by: Martin Jones <martin.jones@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.json1
-rw-r--r--examples/declarative/painteditem/textballoons/TextBalloonPlugin/plugin.h3
-rw-r--r--examples/declarative/painteditem/textballoons/TextBalloonPlugin/textballoon.json1
-rw-r--r--examples/declarative/painteditem/textballoons/textballoons.pro2
-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
-rw-r--r--examples/tutorials/gettingStartedQml/filedialog/dialogPlugin.cpp3
-rw-r--r--examples/tutorials/gettingStartedQml/filedialog/dialogPlugin.h1
-rw-r--r--examples/tutorials/gettingStartedQml/filedialog/dialogplugin.json1
16 files changed, 22 insertions, 12 deletions
diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.cpp b/examples/declarative/cppextensions/imageprovider/imageprovider.cpp
index 94f85753ed..7fe4b72c08 100644
--- a/examples/declarative/cppextensions/imageprovider/imageprovider.cpp
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.cpp
@@ -87,6 +87,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)
{
@@ -101,7 +102,8 @@ public:
};
-#include "imageprovider.moc"
-Q_EXPORT_PLUGIN(ImageProviderExtensionPlugin);
+#define QDeclarativeExtensionInterface_iid "org.qt-project.Qt.QDeclarativeExtensionInterface"
+
+#include "imageprovider.moc"
diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.json b/examples/declarative/cppextensions/imageprovider/imageprovider.json
new file mode 100644
index 0000000000..0967ef424b
--- /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 cfa7923128..dd128d56a8 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]/qtdeclarative/declarative/imageprovider
diff --git a/examples/declarative/cppextensions/plugins/plugin.cpp b/examples/declarative/cppextensions/plugins/plugin.cpp
index 6fbf962f4e..4ba0a928eb 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 0000000000..0967ef424b
--- /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 bdcb62ca8a..a28582a07a 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.json b/examples/declarative/cppextensions/qwidgets/qwidgets.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/examples/declarative/cppextensions/qwidgets/qwidgets.json
@@ -0,0 +1 @@
+{}
diff --git a/examples/declarative/painteditem/textballoons/TextBalloonPlugin/plugin.h b/examples/declarative/painteditem/textballoons/TextBalloonPlugin/plugin.h
index 6be8611dfd..f444d31f4e 100644
--- a/examples/declarative/painteditem/textballoons/TextBalloonPlugin/plugin.h
+++ b/examples/declarative/painteditem/textballoons/TextBalloonPlugin/plugin.h
@@ -46,11 +46,10 @@
class TextBalloonPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface" FILE "textballoon.json")
public:
void registerTypes(const char *uri)
{
qmlRegisterType<TextBalloon>(uri, 1, 0, "TextBalloon");
}
};
-
-Q_EXPORT_PLUGIN2(qmltextballoonplugin, TextBalloonPlugin);
diff --git a/examples/declarative/painteditem/textballoons/TextBalloonPlugin/textballoon.json b/examples/declarative/painteditem/textballoons/TextBalloonPlugin/textballoon.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/examples/declarative/painteditem/textballoons/TextBalloonPlugin/textballoon.json
@@ -0,0 +1 @@
+{}
diff --git a/examples/declarative/painteditem/textballoons/textballoons.pro b/examples/declarative/painteditem/textballoons/textballoons.pro
index 453a00336d..e0b9404f65 100644
--- a/examples/declarative/painteditem/textballoons/textballoons.pro
+++ b/examples/declarative/painteditem/textballoons/textballoons.pro
@@ -9,6 +9,8 @@ HEADERS += TextBalloonPlugin/plugin.h \
SOURCES += textballoon.cpp
+OTHER_FILES += textballoon.json
+
DESTDIR = TextBalloonPlugin
qdeclarativesources.files += \
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp
index 9c4027de8a..d75f810964 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 bffcf000fd..863564b09c 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 0000000000..0967ef424b
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.json
@@ -0,0 +1 @@
+{}
diff --git a/examples/tutorials/gettingStartedQml/filedialog/dialogPlugin.cpp b/examples/tutorials/gettingStartedQml/filedialog/dialogPlugin.cpp
index 6bc3d4d006..626ef93adc 100644
--- a/examples/tutorials/gettingStartedQml/filedialog/dialogPlugin.cpp
+++ b/examples/tutorials/gettingStartedQml/filedialog/dialogPlugin.cpp
@@ -49,6 +49,3 @@ void DialogPlugin::registerTypes(const char *uri)
qmlRegisterType<Directory>(uri, 1, 0, "Directory");
qmlRegisterType<File>(uri,1,0,"File");
}
-
-//FileDialog is the plugin name (same as the TARGET in the project file) and DialogPlugin is the plugin classs
-Q_EXPORT_PLUGIN2(FileDialog, DialogPlugin); \ No newline at end of file
diff --git a/examples/tutorials/gettingStartedQml/filedialog/dialogPlugin.h b/examples/tutorials/gettingStartedQml/filedialog/dialogPlugin.h
index 03bdc1a6e4..7ad707f6d9 100644
--- a/examples/tutorials/gettingStartedQml/filedialog/dialogPlugin.h
+++ b/examples/tutorials/gettingStartedQml/filedialog/dialogPlugin.h
@@ -46,6 +46,7 @@
class DialogPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface" FILE "dialogplugin.json")
public:
//registerTypes is inherited from QDeclarativeExtensionPlugin
diff --git a/examples/tutorials/gettingStartedQml/filedialog/dialogplugin.json b/examples/tutorials/gettingStartedQml/filedialog/dialogplugin.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/examples/tutorials/gettingStartedQml/filedialog/dialogplugin.json
@@ -0,0 +1 @@
+{}