summaryrefslogtreecommitdiffstats
path: root/src/gui/accessible/qaccessible.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2012-01-05 13:57:33 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-10 07:14:34 +0100
commit39a052c66479c6d7bd13c4f583fecf6a895b2948 (patch)
tree13ad88a7a43482a07e97a17e8a38ee4537399ea7 /src/gui/accessible/qaccessible.cpp
parent5313c28b30c876d52df3dd4f74971832c57c6f8a (diff)
Accessiblity State as bit field.
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 <jan-arve.saether@nokia.com>
Diffstat (limited to 'src/gui/accessible/qaccessible.cpp')
-rw-r--r--src/gui/accessible/qaccessible.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 59dbcf4bef..d1397921b0 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -1197,6 +1197,11 @@ const char *qAccessibleEventString(QAccessible::Event event)
return QAccessible::staticMetaObject.enumerator(eventEnum).valueToKey(event);
}
+bool operator==(const QAccessible::State &first, const QAccessible::State &second)
+{
+ return memcmp(&first, &second, sizeof(QAccessible::State)) == 0;
+}
+
#ifndef QT_NO_DEBUG_STREAM
Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleInterface *iface)
{
@@ -1214,8 +1219,7 @@ Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleInterface *iface)
if (iface->object()) {
d << "obj=" << iface->object();
}
- bool invisible = iface->state() & QAccessible::Invisible;
- if (invisible) {
+ if (iface->state().invisible) {
d << "invisible";
} else {
d << "rect=" << iface->rect();