diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-05-27 04:51:45 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-08 00:12:09 +0200 |
commit | d173da37eedf8229518da7998249c47f364566b4 (patch) | |
tree | 611c90bc23075acce1772d43746a685e54b78354 /src/gui/kernel | |
parent | 1402660575609a5e936f7b3f656df49c60b812c4 (diff) |
Remove QFactoryInterface from the generic plugins
Change-Id: I5a4351ca4b6605f9628496701bb8c6063cf36c78
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qgenericplugin_qpa.cpp | 18 | ||||
-rw-r--r-- | src/gui/kernel/qgenericplugin_qpa.h | 10 | ||||
-rw-r--r-- | src/gui/kernel/qgenericpluginfactory_qpa.cpp | 2 |
3 files changed, 8 insertions, 22 deletions
diff --git a/src/gui/kernel/qgenericplugin_qpa.cpp b/src/gui/kernel/qgenericplugin_qpa.cpp index 493fc770b5..ef57ab8a9e 100644 --- a/src/gui/kernel/qgenericplugin_qpa.cpp +++ b/src/gui/kernel/qgenericplugin_qpa.cpp @@ -56,23 +56,17 @@ QT_BEGIN_NAMESPACE Note that this class is only available in Qt QPA. A mouse plugin can be created by subclassing - QGenericPlugin and reimplementing the pure virtual keys() and - create() functions. By exporting the derived class using the - Q_EXPORT_PLUGIN2() macro, The default implementation of the + QGenericPlugin and reimplementing the pure virtual create() + function. By exporting the derived class using the + Q_PLUGIN_METADATA() macro, The default implementation of the QGenericPluginFactory class will automatically detect the plugin and load the driver into the server application at run-time. See \l {How to Create Qt Plugins} for details. - \sa QGenericPluginFactory -*/ - -/*! - \fn QStringList QGenericPlugin::keys() const - - Implement this function to return the list of valid keys, i.e. the - drivers supported by this plugin. + The json metadata file should contain a list of keys supported by this + plugin. - \sa create() + \sa QGenericPluginFactory */ /*! diff --git a/src/gui/kernel/qgenericplugin_qpa.h b/src/gui/kernel/qgenericplugin_qpa.h index 4cba1988ef..2724a8c9e6 100644 --- a/src/gui/kernel/qgenericplugin_qpa.h +++ b/src/gui/kernel/qgenericplugin_qpa.h @@ -52,23 +52,15 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_LIBRARY -struct Q_GUI_EXPORT QGenericPluginFactoryInterface : public QFactoryInterface -{ - virtual QObject* create(const QString &name, const QString &spec) = 0; -}; - #define QGenericPluginFactoryInterface_iid "org.qt-project.Qt.QGenericPluginFactoryInterface" -Q_DECLARE_INTERFACE(QGenericPluginFactoryInterface, QGenericPluginFactoryInterface_iid) -class Q_GUI_EXPORT QGenericPlugin : public QObject, public QGenericPluginFactoryInterface +class Q_GUI_EXPORT QGenericPlugin : public QObject { Q_OBJECT - Q_INTERFACES(QGenericPluginFactoryInterface:QFactoryInterface) public: explicit QGenericPlugin(QObject *parent = 0); ~QGenericPlugin(); - virtual QStringList keys() const = 0; virtual QObject* create(const QString& name, const QString &spec) = 0; }; diff --git a/src/gui/kernel/qgenericpluginfactory_qpa.cpp b/src/gui/kernel/qgenericpluginfactory_qpa.cpp index 90da16f868..663b88e10d 100644 --- a/src/gui/kernel/qgenericpluginfactory_qpa.cpp +++ b/src/gui/kernel/qgenericpluginfactory_qpa.cpp @@ -83,7 +83,7 @@ QObject *QGenericPluginFactory::create(const QString& key, const QString &specif #if !defined(Q_OS_WIN32) || defined(QT_MAKEDLL) #ifndef QT_NO_LIBRARY - if (QObject *object = qLoadPlugin1<QObject, QGenericPluginFactoryInterface>(loader(), driver, specification)) + if (QObject *object = qLoadPlugin1<QObject, QGenericPlugin>(loader(), driver, specification)) return object; #endif #endif |