From 39a052c66479c6d7bd13c4f583fecf6a895b2948 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 5 Jan 2012 13:57:33 +0100 Subject: Accessiblity State as bit field. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We would like to add more flags that will be over the 32 bit boundary. On Windows enums don't seem to digest values >32 bit. This patch changes the state flags to be a bit field instead. The windows part of the patch was written by Jan-Arve Sæther. Change-Id: I2d1d87807f920ce4d4a5c7bfea8b1122ed44eb08 Reviewed-by: Jan-Arve Sæther --- src/widgets/accessible/qaccessiblewidget.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp index 5498e70744..d9734f8d11 100644 --- a/src/widgets/accessible/qaccessiblewidget.cpp +++ b/src/widgets/accessible/qaccessiblewidget.cpp @@ -373,7 +373,7 @@ QAccessible::Relation QAccessibleWidget::relationTo(const QAccessibleInterface * if (wg.intersects(sg)) { QAccessibleInterface *pIface = 0; pIface = sibIface->parent(); - if (pIface && !((sibIface->state() | state()) & QAccessible::Invisible)) { + if (pIface && !(sibIface->state().invisible | state().invisible)) { int wi = pIface->indexOfChild(this); int si = pIface->indexOfChild(sibIface); @@ -430,7 +430,7 @@ int QAccessibleWidget::navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface *sibling = 0; for (int i = pIface->indexOfChild(this) + 1; i <= sibCount && entry; ++i) { sibling = pIface->child(i - 1); - if (!sibling || (sibling->state() & QAccessible::Invisible)) { + if (!sibling || (sibling->state().invisible)) { delete sibling; sibling = 0; continue; @@ -460,7 +460,7 @@ int QAccessibleWidget::navigate(QAccessible::RelationFlag relation, int entry, for (int i = 1; i < index && entry; ++i) { sibling = pIface->child(i - 1); Q_ASSERT(sibling); - if (!sibling || (sibling->state() & QAccessible::Invisible)) { + if (!sibling || (sibling->state().invisible)) { delete sibling; sibling = 0; continue; @@ -690,22 +690,22 @@ QAccessible::Role QAccessibleWidget::role() const /*! \reimp */ QAccessible::State QAccessibleWidget::state() const { - QAccessible::State state = QAccessible::Normal; + QAccessible::State state; QWidget *w = widget(); if (w->testAttribute(Qt::WA_WState_Visible) == false) - state |= QAccessible::Invisible; + state.invisible = true; if (w->focusPolicy() != Qt::NoFocus && w->isActiveWindow()) - state |= QAccessible::Focusable; + state.focusable = true; if (w->hasFocus()) - state |= QAccessible::Focused; + state.focused = true; if (!w->isEnabled()) - state |= QAccessible::Unavailable; + state.unavailable = true; if (w->isWindow()) { if (w->windowFlags() & Qt::WindowSystemMenuHint) - state |= QAccessible::Movable; + state.movable = true; if (w->minimumSize() != w->maximumSize()) - state |= QAccessible::Sizeable; + state.sizeable = true; } return state; -- cgit v1.2.3