Remove invokeMethod in favor of the recommended virtual_hook()
authorJan-Arve Saether <jan-arve.saether@nokia.com>
Tue, 10 Jan 2012 13:44:52 +0000 (14:44 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 12 Jan 2012 14:15:30 +0000 (15:15 +0100)
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>
src/gui/accessible/qaccessible.cpp
src/gui/accessible/qaccessible.h
src/plugins/accessible/widgets/complexwidgets.cpp
src/plugins/accessible/widgets/complexwidgets.h
src/plugins/accessible/widgets/itemviews.h
src/plugins/accessible/widgets/qaccessiblewidgets.cpp
src/plugins/accessible/widgets/qaccessiblewidgets.h

index 41382c4..edd4616 100644 (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();
 }
 
 /*!
index e41898f..38f52fb 100644 (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:
index a8f477e..2c1330f 100644 (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));
index 3145c52..c596e0b 100644 (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;
index 5ba75ce..c30ef17 100644 (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
index 1d6638e..bb74423 100644 (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);
index c1c1cbb..82fdd3b 100644 (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