From beb72b2fbf17a20b4a9d51d75d79f9c3c69bb357 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Sat, 22 Oct 2011 22:38:14 +0200 Subject: Remove virtual child integers. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/gui/accessible/qaccessibleobject.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src/gui/accessible/qaccessibleobject.cpp') diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp index da68579809..695c66654e 100644 --- a/src/gui/accessible/qaccessibleobject.cpp +++ b/src/gui/accessible/qaccessibleobject.cpp @@ -144,13 +144,13 @@ bool QAccessibleObject::isValid() const } /*! \reimp */ -QRect QAccessibleObject::rect(int) const +QRect QAccessibleObject::rect() const { return QRect(); } /*! \reimp */ -void QAccessibleObject::setText(Text, int, const QString &) +void QAccessibleObject::setText(Text, const QString &) { } @@ -227,20 +227,14 @@ int QAccessibleApplication::childAt(int x, int y) const } /*! \reimp */ -QAccessible::Relation QAccessibleApplication::relationTo(int child, const - QAccessibleInterface *other, int otherChild) const +QAccessible::Relation QAccessibleApplication::relationTo(const QAccessibleInterface *other) const { QObject *o = other ? other->object() : 0; if (!o) return Unrelated; if(o == object()) { - if (child && !otherChild) - return Child; - if (!child && otherChild) - return Ancestor; - if (!child && !otherChild) - return Self; + return Self; } return Unrelated; @@ -290,7 +284,7 @@ int QAccessibleApplication::navigate(RelationFlag relation, int, } /*! \reimp */ -QString QAccessibleApplication::text(Text t, int) const +QString QAccessibleApplication::text(Text t) const { switch (t) { case Name: @@ -304,13 +298,13 @@ QString QAccessibleApplication::text(Text t, int) const } /*! \reimp */ -QAccessible::Role QAccessibleApplication::role(int) const +QAccessible::Role QAccessibleApplication::role() const { return Application; } /*! \reimp */ -QAccessible::State QAccessibleApplication::state(int) const +QAccessible::State QAccessibleApplication::state() const { return QGuiApplication::activeWindow() ? Focused : Normal; } -- cgit v1.2.3