Remove invokeMethod in favor of the recommended virtual_hook()

We don't remove the Method enum (yet), since there are functions in
dependent modules that still refer to it.
Unfortunately there is no way we can commit to several repos
"atomically".

Change-Id: Ia1923dc4bf0751a9ba67727d14da5a2e60bd4e74
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
bb10
Jan-Arve Saether 2012-01-10 14:44:52 +01:00 committed by Qt by Nokia
parent 1133c0dd22
commit 0fda46932d
7 changed files with 11 additions and 58 deletions

View File

@ -120,7 +120,6 @@ QT_BEGIN_NAMESPACE
\sa QAccessibleInterface
*/
/*!
\enum QAccessible::StateFlag
@ -1159,17 +1158,17 @@ QWindow *QAccessibleInterface::window() const
Returns an invalid QVariant if the object doesn't support the action.
*/
QVariant QAccessibleInterface::invokeMethod(QAccessible::Method method, const QVariantList &params)
{
Q_UNUSED(method)
Q_UNUSED(params)
return QVariant();
}
/*! \internal */
QVariant QAccessibleInterface::virtual_hook(const QVariant &)
/*!
\internal
Method to allow extending this class without breaking binary compatibility.
The actual behavior and format of \a data depends on \a id argument
which must be defined if the class is to be extended with another virtual
function.
Currently, this is unused.
*/
void QAccessibleInterface::virtual_hook(int /*id*/, void * /*data*/)
{
return QVariant();
}
/*!

View File

@ -289,10 +289,6 @@ public:
};
Q_DECLARE_FLAGS(Relation, RelationFlag)
enum Method {
ListSupportedMethods = 0
};
enum InterfaceType
{
TextInterface,
@ -334,9 +330,6 @@ private:
Q_GUI_EXPORT bool operator==(const QAccessible::State &first, const QAccessible::State &second);
Q_DECLARE_OPERATORS_FOR_FLAGS(QAccessible::Relation)
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QSet<QAccessible::Method>)
QT_BEGIN_NAMESPACE
class QAccessible2Interface;
class QAccessibleTextInterface;
@ -379,11 +372,6 @@ public:
virtual QColor foregroundColor() const;
virtual QColor backgroundColor() const;
virtual QVariant invokeMethod(QAccessible::Method method, const QVariantList &params = QVariantList());
inline QSet<QAccessible::Method> supportedMethods()
{ return qvariant_cast<QSet<QAccessible::Method> >(invokeMethod(QAccessible::ListSupportedMethods)); }
inline QAccessibleTextInterface *textInterface()
{ return reinterpret_cast<QAccessibleTextInterface *>(interface_cast(QAccessible::TextInterface)); }
@ -405,8 +393,8 @@ public:
inline QAccessibleTableCellInterface *tableCellInterface()
{ return reinterpret_cast<QAccessibleTableCellInterface *>(interface_cast(QAccessible::TableCellInterface)); }
// FIXME
virtual QVariant virtual_hook(const QVariant &data);
virtual void virtual_hook(int id, void *data);
virtual void *interface_cast(QAccessible::InterfaceType)
{ return 0; }
private:

View File

@ -387,11 +387,6 @@ QAccessibleAbstractScrollArea::QAccessibleAbstractScrollArea(QWidget *widget)
Q_ASSERT(qobject_cast<QAbstractScrollArea *>(widget));
}
QVariant QAccessibleAbstractScrollArea::invokeMethod(QAccessible::Method, const QVariantList &)
{
return QVariant();
}
QAccessibleInterface *QAccessibleAbstractScrollArea::child(int index) const
{
return QAccessible::queryAccessibleInterface(accessibleChildren().at(index));

View File

@ -75,7 +75,6 @@ public:
};
QAccessibleInterface *child(int index) const;
QVariant invokeMethod(QAccessible::Method method, const QVariantList &params);
int childCount() const;
int indexOfChild(const QAccessibleInterface *child) const;
bool isValid() const;

View File

@ -80,7 +80,6 @@ public:
int navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface **iface) const;
QAccessible::Relation relationTo(const QAccessibleInterface *other) const;
QVariant invokeMethod(QAccessible::Method, const QVariantList &) { return QVariant(); }
void *interface_cast(QAccessible::InterfaceType t);
// table interface

View File

@ -581,13 +581,6 @@ QAccessibleStackedWidget::QAccessibleStackedWidget(QWidget *widget)
Q_ASSERT(qobject_cast<QStackedWidget *>(widget));
}
QVariant QAccessibleStackedWidget::invokeMethod(QAccessible::Method, const QVariantList &params)
{
Q_UNUSED(params);
return QVariant();
}
QAccessibleInterface *QAccessibleStackedWidget::childAt(int x, int y) const
{
if (!stackedWidget()->isVisible())
@ -810,10 +803,6 @@ QAccessibleDialogButtonBox::QAccessibleDialogButtonBox(QWidget *widget)
Q_ASSERT(qobject_cast<QDialogButtonBox*>(widget));
}
QVariant QAccessibleDialogButtonBox::invokeMethod(QAccessible::Method, const QVariantList &)
{
return QVariant();
}
#endif // QT_NO_DIALOGBUTTONBOX
#ifndef QT_NO_TEXTBROWSER
@ -837,11 +826,6 @@ QAccessibleCalendarWidget::QAccessibleCalendarWidget(QWidget *widget)
Q_ASSERT(qobject_cast<QCalendarWidget *>(widget));
}
QVariant QAccessibleCalendarWidget::invokeMethod(QAccessible::Method, const QVariantList &)
{
return QVariant();
}
int QAccessibleCalendarWidget::childCount() const
{
return calendarWidget()->isNavigationBarVisible() ? 2 : 1;
@ -1173,11 +1157,6 @@ bool QAccessibleTitleBar::isValid() const
QAccessibleMainWindow::QAccessibleMainWindow(QWidget *widget)
: QAccessibleWidget(widget, QAccessible::Window) { }
QVariant QAccessibleMainWindow::invokeMethod(QAccessible::Method /*method*/, const QVariantList & /*params*/)
{
return QVariant();
}
QAccessibleInterface *QAccessibleMainWindow::child(int index) const
{
QList<QWidget*> kids = childWidgets(mainWindow(), true);

View File

@ -120,7 +120,6 @@ class QAccessibleStackedWidget : public QAccessibleWidget
public:
explicit QAccessibleStackedWidget(QWidget *widget);
QVariant invokeMethod(QAccessible::Method method, const QVariantList &params);
QAccessibleInterface *childAt(int x, int y) const;
int childCount() const;
int indexOfChild(const QAccessibleInterface *child) const;
@ -196,8 +195,6 @@ class QAccessibleDialogButtonBox : public QAccessibleWidget
{
public:
explicit QAccessibleDialogButtonBox(QWidget *widget);
QVariant invokeMethod(QAccessible::Method method, const QVariantList &params);
};
#ifndef QT_NO_TEXTBROWSER
@ -221,8 +218,6 @@ public:
QAccessibleInterface *child(int index) const;
QVariant invokeMethod(QAccessible::Method method, const QVariantList &params);
protected:
QCalendarWidget *calendarWidget() const;
@ -286,7 +281,6 @@ public:
QAccessibleInterface *childAt(int x, int y) const;
QMainWindow *mainWindow() const;
QVariant invokeMethod(QAccessible::Method method, const QVariantList &params);
};
#endif //QT_NO_MAINWINDOW