summaryrefslogtreecommitdiff
path: root/src/gui/image/qimageiohandler.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-05-27 03:40:00 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-08 00:12:00 +0200
commitc9d040c1f5b0ee0ddd37e924576ec3bbd990f2ed (patch)
tree9b31abbd8e80f9d1c9b436a4a1bdcbafa52e9b4c /src/gui/image/qimageiohandler.cpp
parent21019539fb0d2cc2db3d16c069fd38dec670c177 (diff)
downloadqtbase-c9d040c1f5b0ee0ddd37e924576ec3bbd990f2ed.tar.gz
Don't inherit from QFactoryInterface for image plugins
QFactoryInterface is obsolete now that we have the new plugins loading mechanism, where we can get the keys out of the plugin without having to load it. Remove it from QImageIOHandlerFactoryInterface as a first step of getting completely rid of it. Change-Id: I856b149dd20131e1cdcdcb271c1a355c9e0da6ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/image/qimageiohandler.cpp')
-rw-r--r--src/gui/image/qimageiohandler.cpp39
1 files changed, 12 insertions, 27 deletions
diff --git a/src/gui/image/qimageiohandler.cpp b/src/gui/image/qimageiohandler.cpp
index 153412fb29..c58642988e 100644
--- a/src/gui/image/qimageiohandler.cpp
+++ b/src/gui/image/qimageiohandler.cpp
@@ -171,9 +171,9 @@
support for different image formats to Qt.
Writing an image I/O plugin is achieved by subclassing this
- base class, reimplementing the pure virtual functions capabilities(),
- create(), and keys(), and exporting the class with the
- Q_EXPORT_PLUGIN2() macro. See \l{How to Create Qt Plugins} for details.
+ base class, reimplementing the pure virtual functions capabilities()
+ and create(), and exporting the class with the
+ Q_PLUGIN_METADATA() macro. See \l{How to Create Qt Plugins} for details.
An image format plugin can support three capabilities: reading (\l
CanRead), writing (\l CanWrite) and \e incremental reading (\l
@@ -182,8 +182,15 @@
create() should create an instance of your QImageIOHandler
subclass, with the provided device and format properly set, and
- return this handler. You must also reimplement keys() so that Qt
- knows which image formats your plugin supports.
+ return this handler.
+
+ The json metadata file for the plugin needs to contain information
+ about the image formats the plugins supports. For a jpeg plugin, this
+ could e.g. look as follows:
+
+ \code
+ { "Keys": [ "jpg", "jpeg" ] }
+ \endcode
Different plugins can support different capabilities. For example,
you may have one plugin that supports reading the GIF format, and
@@ -205,17 +212,6 @@
\value CanReadIncremental The plugin can read images incrementally.
*/
-/*!
- \class QImageIOHandlerFactoryInterface
- \brief The QImageIOHandlerFactoryInterface class provides the factory
- interface for QImageIOPlugin.
- \reentrant
-
- \internal
-
- \sa QImageIOPlugin
-*/
-
#include "qimageiohandler.h"
#include <qbytearray.h>
@@ -547,17 +543,6 @@ QImageIOPlugin::~QImageIOPlugin()
*/
/*!
- \fn QImageIOPlugin::keys() const
-
- Returns the list of image keys this plugin supports.
-
- These keys are usually the names of the image formats that are implemented
- in the plugin (e.g., "jpg" or "gif").
-
- \sa capabilities()
-*/
-
-/*!
\fn QImageIOHandler *QImageIOPlugin::create(QIODevice *device, const QByteArray &format) const
Creates and returns a QImageIOHandler subclass, with \a device