summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-05-27 04:09:13 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-08 00:12:05 +0200
commit1402660575609a5e936f7b3f656df49c60b812c4 (patch)
tree7c8d84db5155716896d2cbdd4721b7b2583f34d0 /src/gui/image
parentdcf3c95175a93cf883e14a6d434b4306df50cf37 (diff)
Remove QFactoryInterface from picture plugins
Change-Id: I7b02cbfb850d6a9fc90c1eb1e12a9950baf61e77 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qpicture.cpp2
-rw-r--r--src/gui/image/qpictureformatplugin.cpp17
-rw-r--r--src/gui/image/qpictureformatplugin.h14
3 files changed, 10 insertions, 23 deletions
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index fa5cf79bf2..eaf8f8fb1e 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -1411,7 +1411,7 @@ void qt_init_picture_plugins()
const PluginKeyMap keyMap = loader.keyMap();
const PluginKeyMapConstIterator cend = keyMap.constEnd();
for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend; ++it) {
- if (QPictureFormatInterface *format = qobject_cast<QPictureFormatInterface*>(loader.instance(it.key())))
+ if (QPictureFormatPlugin *format = qobject_cast<QPictureFormatPlugin*>(loader.instance(it.key())))
format->installIOHandler(it.value());
}
#endif
diff --git a/src/gui/image/qpictureformatplugin.cpp b/src/gui/image/qpictureformatplugin.cpp
index cb46790d69..d5cbb0c661 100644
--- a/src/gui/image/qpictureformatplugin.cpp
+++ b/src/gui/image/qpictureformatplugin.cpp
@@ -59,19 +59,18 @@ QT_BEGIN_NAMESPACE
transparently by applications.
Writing an picture format plugin is achieved by subclassing this
- base class, reimplementing the pure virtual functions keys(),
+ base class, reimplementing the pure virtual functions
loadPicture(), savePicture(), and installIOHandler(), and
- exporting the class with the Q_EXPORT_PLUGIN2() macro.
+ exporting the class with the Q_PLUGIN_METADATA() macro.
- \sa {How to Create Qt Plugins}
-*/
+ The json file containing the metadata should contain one entry
+ with the list of picture formats supported by the plugin:
-/*!
- \fn QStringList QPictureFormatPlugin::keys() const
+ \code
+ { "Keys": [ "mypictureformat" ] }
+ \endcode
- Returns the list of picture formats this plugin supports.
-
- \sa installIOHandler()
+ \sa {How to Create Qt Plugins}
*/
/*!
diff --git a/src/gui/image/qpictureformatplugin.h b/src/gui/image/qpictureformatplugin.h
index 7bcd32b4fd..40042c0d9c 100644
--- a/src/gui/image/qpictureformatplugin.h
+++ b/src/gui/image/qpictureformatplugin.h
@@ -57,27 +57,15 @@ class QImage;
class QString;
class QStringList;
-struct Q_GUI_EXPORT QPictureFormatInterface : public QFactoryInterface
-{
- virtual bool loadPicture(const QString &format, const QString &filename, QPicture *) = 0;
- virtual bool savePicture(const QString &format, const QString &filename, const QPicture &) = 0;
-
- virtual bool installIOHandler(const QString &) = 0;
-};
-
#define QPictureFormatInterface_iid "org.qt-project.Qt.QPictureFormatInterface"
-Q_DECLARE_INTERFACE(QPictureFormatInterface, QPictureFormatInterface_iid)
-
-class Q_GUI_EXPORT QPictureFormatPlugin : public QObject, public QPictureFormatInterface
+class Q_GUI_EXPORT QPictureFormatPlugin : public QObject
{
Q_OBJECT
- Q_INTERFACES(QPictureFormatInterface:QFactoryInterface)
public:
explicit QPictureFormatPlugin(QObject *parent = 0);
~QPictureFormatPlugin();
- virtual QStringList keys() const = 0;
virtual bool loadPicture(const QString &format, const QString &filename, QPicture *pic);
virtual bool savePicture(const QString &format, const QString &filename, const QPicture &pic);
virtual bool installIOHandler(const QString &format) = 0;