diff options
| author | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2011-10-22 22:38:14 +0200 |
|---|---|---|
| committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-23 14:54:01 +0100 |
| commit | beb72b2fbf17a20b4a9d51d75d79f9c3c69bb357 (patch) | |
| tree | c972c0a408ea912faaa67d4508ba5d855a1cb582 /src/plugins/accessible/widgets/complexwidgets.cpp | |
| parent | e739ca0071df28adf767d148ba5095d846e898f3 (diff) | |
Remove virtual child integers.
This makes the accessibility apis much
simpler and less error prone.
Disable the itemviews implementation that is in complex widgets.
The itemviews will use the new code from itemviews.h/cpp everywhere now.
QToolBox was broken before, now at least it simply exposes all its children.
The children are the buttons (tabs of the toolbox) and their contents.
Change-Id: I45e218f49f02aebbd678ddfe29f94c2a112a2125
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Diffstat (limited to 'src/plugins/accessible/widgets/complexwidgets.cpp')
| -rw-r--r-- | src/plugins/accessible/widgets/complexwidgets.cpp | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/plugins/accessible/widgets/complexwidgets.cpp b/src/plugins/accessible/widgets/complexwidgets.cpp index 5f144b69527..766d18dbfff 100644 --- a/src/plugins/accessible/widgets/complexwidgets.cpp +++ b/src/plugins/accessible/widgets/complexwidgets.cpp @@ -68,6 +68,7 @@ QT_BEGIN_NAMESPACE QString Q_GUI_EXPORT qt_accStripAmp(const QString &text); +#if 0 #ifndef QT_NO_ITEMVIEWS /* The MSDN article "Exposing Data Tables through Microsoft Active Accessibility" explains @@ -425,7 +426,7 @@ int QAccessibleItemRow::childCount() const int QAccessibleItemRow::indexOfChild(const QAccessibleInterface *iface) const { - if (!iface || iface->role(0) != Row) + if (!iface || iface->role() != Row) return -1; //### meaningless code? @@ -1437,6 +1438,7 @@ QAccessible::State QAccessibleHeader::state(int child) const return state; } #endif // QT_NO_ITEMVIEWS +#endif // 0 #ifndef QT_NO_TABBAR /*! @@ -1456,14 +1458,14 @@ public: {} QObject *object() const { return 0; } - Role role(int child) const { Q_ASSERT(child == 0); return QAccessible::PageTab; } - State state(int) const { + Role role() const { return QAccessible::PageTab; } + State state() const { QAccessibleInterface *parentInterface = parent(); State state = parentInterface->state(); delete parentInterface; return state; } - QRect rect(int) const { + QRect rect() const { if (!isValid()) return QRect(); @@ -1479,8 +1481,8 @@ public: int childCount() const { return 0; } int indexOfChild(const QAccessibleInterface *) const { return -1; } - QString text(Text, int) const { return qt_accStripAmp(m_parent->tabText(m_index)); } - void setText(Text, int, const QString &) {} + QString text(Text) const { return qt_accStripAmp(m_parent->tabText(m_index)); } + void setText(Text, const QString &) {} QAccessibleInterface *parent() const { return QAccessible::queryAccessibleInterface(m_parent); @@ -1494,17 +1496,12 @@ public: } return -1; } - Relation relationTo(int, const QAccessibleInterface *, int) const + Relation relationTo(const QAccessibleInterface *) const { return QAccessible::Unrelated; } // action interface - int actionCount() { - return 1; - } - - QStringList actionNames() const { return QStringList(pressAction()); @@ -1587,9 +1584,8 @@ int QAccessibleTabBar::childCount() const return tabBar()->count() + 2; } -QString QAccessibleTabBar::text(Text t, int child) const +QString QAccessibleTabBar::text(Text t) const { - Q_ASSERT(child == 0); if (t == QAccessible::Name) { return qt_accStripAmp(tabBar()->tabText(tabBar()->currentIndex())); } @@ -1694,14 +1690,14 @@ int QAccessibleComboBox::indexOfChild(const QAccessibleInterface *child) const } /*! \reimp */ -QString QAccessibleComboBox::text(Text t, int) const +QString QAccessibleComboBox::text(Text t) const { QString str; switch (t) { case Name: #ifndef Q_OS_UNIX // on Linux we use relations for this, name is text (fall through to Value) - str = QAccessibleWidget::text(t, 0); + str = QAccessibleWidget::text(t); break; #endif case Value: @@ -1719,7 +1715,7 @@ QString QAccessibleComboBox::text(Text t, int) const break; } if (str.isEmpty()) - str = QAccessibleWidget::text(t, 0); + str = QAccessibleWidget::text(t); return str; } |
