From ec550e28d2b8fa1c6a4e4103f33df1b339862b28 Mon Sep 17 00:00:00 2001 From: Jan-Arve Saether Date: Wed, 18 Jan 2012 14:42:13 +0100 Subject: [PATCH] Remove all references to QAccessible::Self navigate() to Self does not make any sense (its basically a clone). It seems that its not that useful to return Self from relationTo(), since it was only one place where relationTo() was called where it checked for the Self flag. This was in the windows bridge, and we could easily work around that. If it really turns out that Self is useful, we can always add that enum value back later. Change-Id: I9ebb60da059a843de5e6fcab9e815b919afc6f2a Reviewed-by: Frederik Gladhorn --- src/gui/accessible/qaccessible.h | 1 - src/gui/accessible/qaccessibleobject.cpp | 4 ---- src/plugins/platforms/windows/qwindowsaccessibility.cpp | 4 ++-- src/widgets/accessible/qaccessiblewidget.cpp | 3 --- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index 8903628..2e50291 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -306,7 +306,6 @@ public: enum RelationFlag { Unrelated = 0x00000000, - Self = 0x00000001, FocusChild = 0x00010000, Label = 0x00020000, Labelled = 0x00040000, diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp index c9b01c7..313bff3 100644 --- a/src/gui/accessible/qaccessibleobject.cpp +++ b/src/gui/accessible/qaccessibleobject.cpp @@ -231,10 +231,6 @@ QAccessible::Relation QAccessibleApplication::relationTo(const QAccessibleInterf if (!o) return QAccessible::Unrelated; - if(o == object()) { - return QAccessible::Self; - } - return QAccessible::Unrelated; } diff --git a/src/plugins/platforms/windows/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/qwindowsaccessibility.cpp index fdf6c91..4cc08c7 100644 --- a/src/plugins/platforms/windows/qwindowsaccessibility.cpp +++ b/src/plugins/platforms/windows/qwindowsaccessibility.cpp @@ -694,7 +694,7 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::accNavigate(long navDir, VARIANT v case NAVDIR_LEFT: case NAVDIR_RIGHT: if (QAccessibleInterface *pIface = accessible->parent()) { - + const int indexOfOurself = pIface->indexOfChild(accessible); QRect startg = accessible->rect(); QPoint startc = startg.center(); QAccessibleInterface *candidate = 0; @@ -704,7 +704,7 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::accNavigate(long navDir, VARIANT v QAccessibleInterface *sibling = 0; sibling = pIface->child(i); Q_ASSERT(sibling); - if ((accessible->relationTo(sibling) & QAccessible::Self) || sibling->state().invisible) { + if (i == indexOfOurself || sibling->state().invisible) { //ignore ourself and invisible siblings delete sibling; continue; diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp index f4b73b5..67b9f17 100644 --- a/src/widgets/accessible/qaccessiblewidget.cpp +++ b/src/widgets/accessible/qaccessiblewidget.cpp @@ -361,9 +361,6 @@ QAccessible::Relation QAccessibleWidget::relationTo(const QAccessibleInterface * if (inverse & QAccessible::Label) relation |= QAccessible::Labelled; - if(o == object()) - relation |= QAccessible::Self; - return relation; } -- 2.7.4