summaryrefslogtreecommitdiffstats
path: root/examples/tools
diff options
context:
space:
mode:
Diffstat (limited to 'examples/tools')
-rw-r--r--examples/tools/echoplugin/echowindow/echointerface.h6
-rw-r--r--examples/tools/echoplugin/plugin/echoplugin.cpp4
-rw-r--r--examples/tools/echoplugin/plugin/echoplugin.h2
-rw-r--r--examples/tools/echoplugin/plugin/echoplugin.json1
-rw-r--r--examples/tools/echoplugin/plugin/plugin.pro1
-rw-r--r--examples/tools/plugandpaint/interfaces.h16
-rw-r--r--examples/tools/plugandpaint/main.cpp4
-rw-r--r--examples/tools/plugandpaintplugins/basictools/basictools.json1
-rw-r--r--examples/tools/plugandpaintplugins/basictools/basictools.pro1
-rw-r--r--examples/tools/plugandpaintplugins/basictools/basictoolsplugin.cpp6
-rw-r--r--examples/tools/plugandpaintplugins/basictools/basictoolsplugin.h2
-rw-r--r--examples/tools/plugandpaintplugins/extrafilters/extrafilters.json1
-rw-r--r--examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro1
-rw-r--r--examples/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.cpp2
-rw-r--r--examples/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.h2
-rw-r--r--examples/tools/styleplugin/plugin/plugin.pro1
-rw-r--r--examples/tools/styleplugin/plugin/simplestyle.json3
-rw-r--r--examples/tools/styleplugin/plugin/simplestyleplugin.cpp4
-rw-r--r--examples/tools/styleplugin/plugin/simplestyleplugin.h3
19 files changed, 33 insertions, 28 deletions
diff --git a/examples/tools/echoplugin/echowindow/echointerface.h b/examples/tools/echoplugin/echowindow/echointerface.h
index 412e37b7d2..13494c8d28 100644
--- a/examples/tools/echoplugin/echowindow/echointerface.h
+++ b/examples/tools/echoplugin/echowindow/echointerface.h
@@ -53,8 +53,10 @@ public:
QT_BEGIN_NAMESPACE
-Q_DECLARE_INTERFACE(EchoInterface,
- "com.trolltech.Plugin.EchoInterface/1.0");
+
+#define EchoInterface_iid "org.qt-project.Qt.Examples.EchoInterface"
+
+Q_DECLARE_INTERFACE(EchoInterface, EchoInterface_iid)
QT_END_NAMESPACE
//! [0]
diff --git a/examples/tools/echoplugin/plugin/echoplugin.cpp b/examples/tools/echoplugin/plugin/echoplugin.cpp
index d22e7ead23..07520899f5 100644
--- a/examples/tools/echoplugin/plugin/echoplugin.cpp
+++ b/examples/tools/echoplugin/plugin/echoplugin.cpp
@@ -48,7 +48,3 @@ QString EchoPlugin::echo(const QString &message)
return message;
}
//! [0]
-
-//! [1]
-Q_EXPORT_PLUGIN2(echoplugin, EchoPlugin);
-//! [1]
diff --git a/examples/tools/echoplugin/plugin/echoplugin.h b/examples/tools/echoplugin/plugin/echoplugin.h
index d5e24b3b76..47373fc8cb 100644
--- a/examples/tools/echoplugin/plugin/echoplugin.h
+++ b/examples/tools/echoplugin/plugin/echoplugin.h
@@ -42,6 +42,7 @@
#define ECHOPLUGIN_H
#include <QObject>
+#include <QtPlugin>
#include "echoplugin.h"
#include "echointerface.h"
@@ -49,6 +50,7 @@
class EchoPlugin : public QObject, EchoInterface
{
Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.EchoInterface" FILE "echoplugin.json")
Q_INTERFACES(EchoInterface)
public:
diff --git a/examples/tools/echoplugin/plugin/echoplugin.json b/examples/tools/echoplugin/plugin/echoplugin.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/examples/tools/echoplugin/plugin/echoplugin.json
@@ -0,0 +1 @@
+{}
diff --git a/examples/tools/echoplugin/plugin/plugin.pro b/examples/tools/echoplugin/plugin/plugin.pro
index 2be6de80d1..308c1b8236 100644
--- a/examples/tools/echoplugin/plugin/plugin.pro
+++ b/examples/tools/echoplugin/plugin/plugin.pro
@@ -4,6 +4,7 @@ CONFIG += plugin
INCLUDEPATH += ../echowindow
HEADERS = echoplugin.h
SOURCES = echoplugin.cpp
+OTHER_FILES += echoplugin.json
TARGET = $$qtLibraryTarget(echoplugin)
DESTDIR = ../plugins
#! [0]
diff --git a/examples/tools/plugandpaint/interfaces.h b/examples/tools/plugandpaint/interfaces.h
index e48683cf68..5c1e0c302d 100644
--- a/examples/tools/plugandpaint/interfaces.h
+++ b/examples/tools/plugandpaint/interfaces.h
@@ -96,14 +96,18 @@ public:
QT_BEGIN_NAMESPACE
//! [3] //! [4]
-Q_DECLARE_INTERFACE(BrushInterface,
- "com.trolltech.PlugAndPaint.BrushInterface/1.0")
+#define BrushInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.BrushInterface"
+
+Q_DECLARE_INTERFACE(BrushInterface, BrushInterface_iid)
//! [3]
-Q_DECLARE_INTERFACE(ShapeInterface,
- "com.trolltech.PlugAndPaint.ShapeInterface/1.0")
+
+#define ShapeInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.ShapeInterface"
+
+Q_DECLARE_INTERFACE(ShapeInterface, ShapeInterface_iid)
//! [5]
-Q_DECLARE_INTERFACE(FilterInterface,
- "com.trolltech.PlugAndPaint.FilterInterface/1.0")
+#define FilterInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.FilterInterface"
+
+Q_DECLARE_INTERFACE(FilterInterface, FilterInterface_iid)
//! [4] //! [5]
QT_END_NAMESPACE
diff --git a/examples/tools/plugandpaint/main.cpp b/examples/tools/plugandpaint/main.cpp
index 841d5b417b..3c3693ec0b 100644
--- a/examples/tools/plugandpaint/main.cpp
+++ b/examples/tools/plugandpaint/main.cpp
@@ -43,9 +43,7 @@
#include <QtPlugin>
#include <QApplication>
-QT_BEGIN_NAMESPACE
-Q_IMPORT_PLUGIN(pnp_basictools)
-QT_END_NAMESPACE
+Q_IMPORT_PLUGIN(BasicToolsPlugin)
int main(int argc, char *argv[])
{
diff --git a/examples/tools/plugandpaintplugins/basictools/basictools.json b/examples/tools/plugandpaintplugins/basictools/basictools.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/examples/tools/plugandpaintplugins/basictools/basictools.json
@@ -0,0 +1 @@
+{}
diff --git a/examples/tools/plugandpaintplugins/basictools/basictools.pro b/examples/tools/plugandpaintplugins/basictools/basictools.pro
index 6175de34a3..89023d19cc 100644
--- a/examples/tools/plugandpaintplugins/basictools/basictools.pro
+++ b/examples/tools/plugandpaintplugins/basictools/basictools.pro
@@ -4,6 +4,7 @@ CONFIG += plugin static
INCLUDEPATH += ../..
HEADERS = basictoolsplugin.h
SOURCES = basictoolsplugin.cpp
+OTHER_FILES += basictools.json
TARGET = $$qtLibraryTarget(pnp_basictools)
DESTDIR = ../../plugandpaint/plugins
#! [0]
diff --git a/examples/tools/plugandpaintplugins/basictools/basictoolsplugin.cpp b/examples/tools/plugandpaintplugins/basictools/basictoolsplugin.cpp
index d55048dc0c..bbcae608fa 100644
--- a/examples/tools/plugandpaintplugins/basictools/basictoolsplugin.cpp
+++ b/examples/tools/plugandpaintplugins/basictools/basictoolsplugin.cpp
@@ -189,9 +189,3 @@ QImage BasicToolsPlugin::filterImage(const QString &filter, const QImage &image,
return result;
}
//! [8]
-
-QT_BEGIN_NAMESPACE
-//! [9]
-Q_EXPORT_PLUGIN2(pnp_basictools, BasicToolsPlugin)
-//! [9]
-QT_END_NAMESPACE
diff --git a/examples/tools/plugandpaintplugins/basictools/basictoolsplugin.h b/examples/tools/plugandpaintplugins/basictools/basictoolsplugin.h
index c857e4c7a0..a895b60a18 100644
--- a/examples/tools/plugandpaintplugins/basictools/basictoolsplugin.h
+++ b/examples/tools/plugandpaintplugins/basictools/basictoolsplugin.h
@@ -43,6 +43,7 @@
#include <QRect>
#include <QObject>
+#include <QtPlugin>
#include <QStringList>
#include <QPainterPath>
#include <QImage>
@@ -57,6 +58,7 @@ class BasicToolsPlugin : public QObject,
public FilterInterface
{
Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.PlugAndPaint.BrushInterface" FILE "basictools.json")
Q_INTERFACES(BrushInterface ShapeInterface FilterInterface)
//! [0]
diff --git a/examples/tools/plugandpaintplugins/extrafilters/extrafilters.json b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.json
@@ -0,0 +1 @@
+{}
diff --git a/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro
index 70e7c42c76..89acbabb23 100644
--- a/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro
+++ b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro
@@ -4,6 +4,7 @@ CONFIG += plugin
INCLUDEPATH += ../..
HEADERS = extrafiltersplugin.h
SOURCES = extrafiltersplugin.cpp
+OTHER_FILES += extrafilters.json
TARGET = $$qtLibraryTarget(pnp_extrafilters)
DESTDIR = ../../plugandpaint/plugins
diff --git a/examples/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.cpp b/examples/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.cpp
index 9303fbb6a6..186f364b77 100644
--- a/examples/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.cpp
+++ b/examples/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.cpp
@@ -120,5 +120,3 @@ QImage ExtraFiltersPlugin::filterImage(const QString &filter,
}
return result;
}
-
-Q_EXPORT_PLUGIN2(pnp_extrafilters, ExtraFiltersPlugin)
diff --git a/examples/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.h b/examples/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.h
index b88febe347..6693287294 100644
--- a/examples/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.h
+++ b/examples/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.h
@@ -43,6 +43,7 @@
//! [0]
#include <QObject>
+#include <QtPlugin>
#include <QStringList>
#include <QImage>
@@ -51,6 +52,7 @@
class ExtraFiltersPlugin : public QObject, public FilterInterface
{
Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.PlugAndPaint.FilterInterface" FILE "extrafilters.json")
Q_INTERFACES(FilterInterface)
public:
diff --git a/examples/tools/styleplugin/plugin/plugin.pro b/examples/tools/styleplugin/plugin/plugin.pro
index e5cdbe072b..b0dd871b7b 100644
--- a/examples/tools/styleplugin/plugin/plugin.pro
+++ b/examples/tools/styleplugin/plugin/plugin.pro
@@ -5,6 +5,7 @@ HEADERS = simplestyle.h \
simplestyleplugin.h
SOURCES = simplestyle.cpp \
simplestyleplugin.cpp
+OTHER_FILES += simplestyle.json
TARGET = simplestyleplugin
#! [0]
win32 {
diff --git a/examples/tools/styleplugin/plugin/simplestyle.json b/examples/tools/styleplugin/plugin/simplestyle.json
new file mode 100644
index 0000000000..a708e2aafe
--- /dev/null
+++ b/examples/tools/styleplugin/plugin/simplestyle.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "simplestyle" ]
+}
diff --git a/examples/tools/styleplugin/plugin/simplestyleplugin.cpp b/examples/tools/styleplugin/plugin/simplestyleplugin.cpp
index caf3e01dcf..4b37b2adf2 100644
--- a/examples/tools/styleplugin/plugin/simplestyleplugin.cpp
+++ b/examples/tools/styleplugin/plugin/simplestyleplugin.cpp
@@ -58,7 +58,3 @@ QStyle *SimpleStylePlugin::create(const QString &key)
return 0;
}
//! [1]
-
-QT_BEGIN_NAMESPACE
-Q_EXPORT_PLUGIN2(simplestyleplugin, SimpleStylePlugin)
-QT_END_NAMESPACE
diff --git a/examples/tools/styleplugin/plugin/simplestyleplugin.h b/examples/tools/styleplugin/plugin/simplestyleplugin.h
index 873ac59a67..eb2cdedfed 100644
--- a/examples/tools/styleplugin/plugin/simplestyleplugin.h
+++ b/examples/tools/styleplugin/plugin/simplestyleplugin.h
@@ -52,9 +52,10 @@ QT_END_NAMESPACE
class SimpleStylePlugin : public QStylePlugin
{
Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "simplestyle.json")
public:
- SimpleStylePlugin() {};
+ SimpleStylePlugin() {}
QStringList keys() const;
QStyle *create(const QString &key);