Remove the QFactoryInterface dependency from accessible plugins
QFactoryInterface is not needed anymore and will get removed soon. Change-Id: Ib2806200b1a7f4a45d62e2b556380946ef68f585 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
This commit is contained in:
parent
c9d040c1f5
commit
2903db8b4c
@ -582,7 +582,7 @@ QAccessibleInterface *QAccessible::queryAccessibleInterface(QObject *object)
|
||||
return iface;
|
||||
}
|
||||
#ifndef QT_NO_LIBRARY
|
||||
if (QAccessibleInterface * iface = qLoadPlugin1<QAccessibleInterface, QAccessibleFactoryInterface>(loader(), cn, object))
|
||||
if (QAccessibleInterface * iface = qLoadPlugin1<QAccessibleInterface, QAccessiblePlugin>(loader(), cn, object))
|
||||
return iface;
|
||||
#endif
|
||||
mo = mo->superClass();
|
||||
|
@ -108,17 +108,15 @@ QT_BEGIN_NAMESPACE
|
||||
\inmodule QtWidgets
|
||||
|
||||
Writing an accessibility bridge plugin is achieved by subclassing
|
||||
this base class, reimplementing the pure virtual functions keys()
|
||||
and create(), and exporting the class with the
|
||||
Q_EXPORT_PLUGIN2() macro.
|
||||
this base class, reimplementing the pure virtual function create(),
|
||||
and exporting the class with the Q_PLUGIN_METADATA() macro.
|
||||
|
||||
\sa QAccessibleBridge, QAccessiblePlugin, {How to Create Qt Plugins}
|
||||
*/
|
||||
|
||||
/*!
|
||||
Constructs an accessibility bridge plugin with the given \a
|
||||
parent. This is invoked automatically by the Q_EXPORT_PLUGIN2()
|
||||
macro.
|
||||
parent. This is invoked automatically by the plugin loader.
|
||||
*/
|
||||
QAccessibleBridgePlugin::QAccessibleBridgePlugin(QObject *parent)
|
||||
: QObject(parent)
|
||||
@ -137,17 +135,6 @@ QAccessibleBridgePlugin::~QAccessibleBridgePlugin()
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
\fn QStringList QAccessibleBridgePlugin::keys() const
|
||||
|
||||
Returns the list of keys this plugins supports.
|
||||
|
||||
These keys must be the names of the bridges that this
|
||||
plugin provides.
|
||||
|
||||
\sa create()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QAccessibleBridge *QAccessibleBridgePlugin::create(const QString &key)
|
||||
|
||||
|
@ -63,23 +63,15 @@ public:
|
||||
virtual void notifyAccessibilityUpdate(QAccessibleEvent *event) = 0;
|
||||
};
|
||||
|
||||
struct Q_GUI_EXPORT QAccessibleBridgeFactoryInterface : public QFactoryInterface
|
||||
{
|
||||
virtual QAccessibleBridge *create(const QString& name) = 0;
|
||||
};
|
||||
|
||||
#define QAccessibleBridgeFactoryInterface_iid "org.qt-project.Qt.QAccessibleBridgeFactoryInterface"
|
||||
Q_DECLARE_INTERFACE(QAccessibleBridgeFactoryInterface, QAccessibleBridgeFactoryInterface_iid)
|
||||
|
||||
class Q_GUI_EXPORT QAccessibleBridgePlugin : public QObject, public QAccessibleBridgeFactoryInterface
|
||||
class Q_GUI_EXPORT QAccessibleBridgePlugin : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QAccessibleBridgeFactoryInterface:QFactoryInterface)
|
||||
public:
|
||||
explicit QAccessibleBridgePlugin(QObject *parent = 0);
|
||||
~QAccessibleBridgePlugin();
|
||||
|
||||
virtual QStringList keys() const = 0;
|
||||
virtual QAccessibleBridge *create(const QString &key) = 0;
|
||||
};
|
||||
|
||||
|
@ -58,16 +58,15 @@ QT_BEGIN_NAMESPACE
|
||||
\ingroup accessibility
|
||||
|
||||
Writing an accessibility plugin is achieved by subclassing this
|
||||
base class, reimplementing the pure virtual functions keys() and
|
||||
create(), and exporting the class with the Q_EXPORT_PLUGIN2()
|
||||
macro.
|
||||
base class, reimplementing the pure virtual function create(),
|
||||
and exporting the class with the Q_PLUGIN_METADATA() macro.
|
||||
|
||||
\sa QAccessibleBridgePlugin, {How to Create Qt Plugins}
|
||||
*/
|
||||
|
||||
/*!
|
||||
Constructs an accessibility plugin with the given \a parent. This
|
||||
is invoked automatically by the Q_EXPORT_PLUGIN2() macro.
|
||||
is invoked automatically by the plugin loader.
|
||||
*/
|
||||
QAccessiblePlugin::QAccessiblePlugin(QObject *parent)
|
||||
: QObject(parent)
|
||||
@ -84,17 +83,6 @@ QAccessiblePlugin::~QAccessiblePlugin()
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
\fn QStringList QAccessiblePlugin::keys() const
|
||||
|
||||
Returns the list of keys this plugin supports.
|
||||
|
||||
These keys must be the class names that this plugin provides
|
||||
an accessibility implementation for.
|
||||
|
||||
\sa create()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QAccessibleInterface *QAccessiblePlugin::create(const QString &key, QObject *object)
|
||||
|
||||
|
@ -55,25 +55,17 @@ QT_BEGIN_NAMESPACE
|
||||
class QStringList;
|
||||
class QAccessibleInterface;
|
||||
|
||||
struct Q_GUI_EXPORT QAccessibleFactoryInterface : public QFactoryInterface
|
||||
{
|
||||
virtual QAccessibleInterface* create(const QString &key, QObject *object) = 0;
|
||||
};
|
||||
|
||||
#define QAccessibleFactoryInterface_iid "org.qt-project.Qt.QAccessibleFactoryInterface"
|
||||
Q_DECLARE_INTERFACE(QAccessibleFactoryInterface, QAccessibleFactoryInterface_iid)
|
||||
|
||||
class QAccessiblePluginPrivate;
|
||||
|
||||
class Q_GUI_EXPORT QAccessiblePlugin : public QObject, public QAccessibleFactoryInterface
|
||||
class Q_GUI_EXPORT QAccessiblePlugin : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QAccessibleFactoryInterface:QFactoryInterface)
|
||||
public:
|
||||
explicit QAccessiblePlugin(QObject *parent = 0);
|
||||
~QAccessiblePlugin();
|
||||
|
||||
virtual QStringList keys() const = 0;
|
||||
virtual QAccessibleInterface *create(const QString &key, QObject *object) = 0;
|
||||
};
|
||||
|
||||
|
@ -118,13 +118,13 @@ void QPlatformAccessibility::initialize()
|
||||
typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
|
||||
|
||||
const PluginKeyMap keyMap = bridgeloader()->keyMap();
|
||||
QAccessibleBridgeFactoryInterface *factory = 0;
|
||||
QAccessibleBridgePlugin *factory = 0;
|
||||
int i = -1;
|
||||
const PluginKeyMapConstIterator cend = keyMap.constEnd();
|
||||
for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend; ++it) {
|
||||
if (it.key() != i) {
|
||||
i = it.key();
|
||||
factory = qobject_cast<QAccessibleBridgeFactoryInterface*>(bridgeloader()->instance(i));
|
||||
factory = qobject_cast<QAccessibleBridgePlugin*>(bridgeloader()->instance(i));
|
||||
}
|
||||
if (factory)
|
||||
if (QAccessibleBridge *bridge = factory->create(it.value()))
|
||||
|
@ -67,7 +67,6 @@ class AccessibleFactory : public QAccessiblePlugin
|
||||
public:
|
||||
AccessibleFactory();
|
||||
|
||||
QStringList keys() const;
|
||||
QAccessibleInterface *create(const QString &classname, QObject *object);
|
||||
};
|
||||
|
||||
@ -75,88 +74,6 @@ AccessibleFactory::AccessibleFactory()
|
||||
{
|
||||
}
|
||||
|
||||
QStringList AccessibleFactory::keys() const
|
||||
{
|
||||
QStringList list;
|
||||
#ifndef QT_NO_LINEEDIT
|
||||
list << QLatin1String("QLineEdit");
|
||||
#endif
|
||||
#ifndef QT_NO_COMBOBOX
|
||||
list << QLatin1String("QComboBox");
|
||||
#endif
|
||||
#ifndef QT_NO_SPINBOX
|
||||
list << QLatin1String("QAbstractSpinBox");
|
||||
list << QLatin1String("QSpinBox");
|
||||
list << QLatin1String("QDoubleSpinBox");
|
||||
#endif
|
||||
#ifndef QT_NO_SCROLLBAR
|
||||
list << QLatin1String("QScrollBar");
|
||||
#endif
|
||||
#ifndef QT_NO_SLIDER
|
||||
list << QLatin1String("QSlider");
|
||||
#endif
|
||||
list << QLatin1String("QAbstractSlider");
|
||||
#ifndef QT_NO_TOOLBUTTON
|
||||
list << QLatin1String("QToolButton");
|
||||
#endif
|
||||
list << QLatin1String("QCheckBox");
|
||||
list << QLatin1String("QRadioButton");
|
||||
list << QLatin1String("QPushButton");
|
||||
list << QLatin1String("QAbstractButton");
|
||||
list << QLatin1String("QDialog");
|
||||
list << QLatin1String("QMessageBox");
|
||||
list << QLatin1String("QMainWindow");
|
||||
list << QLatin1String("QLabel");
|
||||
list << QLatin1String("QLCDNumber");
|
||||
list << QLatin1String("QGroupBox");
|
||||
list << QLatin1String("QStatusBar");
|
||||
list << QLatin1String("QProgressBar");
|
||||
list << QLatin1String("QMenuBar");
|
||||
list << QLatin1String("QMenu");
|
||||
list << QLatin1String("QHeaderView");
|
||||
list << QLatin1String("QTabBar");
|
||||
list << QLatin1String("QToolBar");
|
||||
list << QLatin1String("QSizeGrip");
|
||||
list << QLatin1String("QAbstractItemView");
|
||||
list << QLatin1String("QWidget");
|
||||
#ifndef QT_NO_SPLITTER
|
||||
list << QLatin1String("QSplitter");
|
||||
list << QLatin1String("QSplitterHandle");
|
||||
#endif
|
||||
#ifndef QT_NO_TEXTEDIT
|
||||
list << QLatin1String("QTextEdit");
|
||||
#endif
|
||||
list << QLatin1String("QTipLabel");
|
||||
list << QLatin1String("QFrame");
|
||||
list << QLatin1String("QStackedWidget");
|
||||
list << QLatin1String("QToolBox");
|
||||
list << QLatin1String("QMdiArea");
|
||||
list << QLatin1String("QMdiSubWindow");
|
||||
list << QLatin1String("QDialogButtonBox");
|
||||
#ifndef QT_NO_DIAL
|
||||
list << QLatin1String("QDial");
|
||||
#endif
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
list << QLatin1String("QRubberBand");
|
||||
#endif
|
||||
#ifndef QT_NO_TEXTBROWSER
|
||||
list << QLatin1String("QTextBrowser");
|
||||
#endif
|
||||
#ifndef QT_NO_SCROLLAREA
|
||||
list << QLatin1String("QAbstractScrollArea");
|
||||
list << QLatin1String("QScrollArea");
|
||||
#endif
|
||||
#ifndef QT_NO_CALENDARWIDGET
|
||||
list << QLatin1String("QCalendarWidget");
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_DOCKWIDGET
|
||||
list << QLatin1String("QDockWidget");
|
||||
#endif
|
||||
list << QLatin1String("QAccessibleWidget");
|
||||
return list;
|
||||
}
|
||||
|
||||
QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObject *object)
|
||||
{
|
||||
QAccessibleInterface *iface = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user