Remove QFactoryInterface from the generic plugins
Change-Id: I5a4351ca4b6605f9628496701bb8c6063cf36c78 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
1402660575
commit
d173da37ee
@ -56,25 +56,19 @@ 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.
|
||||
|
||||
The json metadata file should contain a list of keys supported by this
|
||||
plugin.
|
||||
|
||||
\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.
|
||||
|
||||
\sa create()
|
||||
*/
|
||||
|
||||
/*!
|
||||
Constructs a plugin with the given \a parent.
|
||||
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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
|
||||
|
@ -52,7 +52,6 @@ class QEvdevKeyboardPlugin : public QGenericPlugin
|
||||
public:
|
||||
QEvdevKeyboardPlugin();
|
||||
|
||||
QStringList keys() const;
|
||||
QObject* create(const QString &key, const QString &specification);
|
||||
};
|
||||
|
||||
@ -61,11 +60,6 @@ QEvdevKeyboardPlugin::QEvdevKeyboardPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
QStringList QEvdevKeyboardPlugin::keys() const
|
||||
{
|
||||
return QStringList(QLatin1String("EvdevKeyboard"));
|
||||
}
|
||||
|
||||
QObject* QEvdevKeyboardPlugin::create(const QString &key,
|
||||
const QString &specification)
|
||||
{
|
||||
|
@ -52,7 +52,6 @@ class QEvdevMousePlugin : public QGenericPlugin
|
||||
public:
|
||||
QEvdevMousePlugin();
|
||||
|
||||
QStringList keys() const;
|
||||
QObject* create(const QString &key, const QString &specification);
|
||||
};
|
||||
|
||||
@ -61,12 +60,6 @@ QEvdevMousePlugin::QEvdevMousePlugin()
|
||||
{
|
||||
}
|
||||
|
||||
QStringList QEvdevMousePlugin::keys() const
|
||||
{
|
||||
return (QStringList()
|
||||
<< QLatin1String("EvdevMouse"));
|
||||
}
|
||||
|
||||
QObject* QEvdevMousePlugin::create(const QString &key,
|
||||
const QString &specification)
|
||||
{
|
||||
|
@ -52,7 +52,6 @@ class QEvdevTouchScreenPlugin : public QGenericPlugin
|
||||
public:
|
||||
QEvdevTouchScreenPlugin();
|
||||
|
||||
QStringList keys() const;
|
||||
QObject* create(const QString &key, const QString &specification);
|
||||
};
|
||||
|
||||
@ -60,11 +59,6 @@ QEvdevTouchScreenPlugin::QEvdevTouchScreenPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
QStringList QEvdevTouchScreenPlugin::keys() const
|
||||
{
|
||||
return QStringList() << "EvdevTouch";
|
||||
}
|
||||
|
||||
QObject* QEvdevTouchScreenPlugin::create(const QString &key,
|
||||
const QString &spec)
|
||||
{
|
||||
|
@ -49,7 +49,6 @@ class QMeeGoIntegrationPlugin : public QGenericPlugin
|
||||
public:
|
||||
QMeeGoIntegrationPlugin();
|
||||
|
||||
QStringList keys() const;
|
||||
QObject* create(const QString &key, const QString &specification);
|
||||
};
|
||||
|
||||
@ -58,11 +57,6 @@ QMeeGoIntegrationPlugin::QMeeGoIntegrationPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
QStringList QMeeGoIntegrationPlugin::keys() const
|
||||
{
|
||||
return QStringList() << QLatin1String("MeeGoIntegration");
|
||||
}
|
||||
|
||||
QObject* QMeeGoIntegrationPlugin::create(const QString &key, const QString &specification)
|
||||
{
|
||||
if (!key.compare(QLatin1String("MeeGoIntegration"), Qt::CaseInsensitive))
|
||||
|
@ -52,7 +52,6 @@ class QTsLibPlugin : public QGenericPlugin
|
||||
public:
|
||||
QTsLibPlugin();
|
||||
|
||||
QStringList keys() const;
|
||||
QObject* create(const QString &key, const QString &specification);
|
||||
};
|
||||
|
||||
@ -61,13 +60,6 @@ QTsLibPlugin::QTsLibPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
QStringList QTsLibPlugin::keys() const
|
||||
{
|
||||
return (QStringList()
|
||||
<< QLatin1String("Tslib")
|
||||
<< QLatin1String("TslibRaw"));
|
||||
}
|
||||
|
||||
QObject* QTsLibPlugin::create(const QString &key,
|
||||
const QString &specification)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user