diff options
author | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2011-11-16 15:41:35 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-21 15:53:16 +0100 |
commit | 6f9fb98886c592060fb8c17520c49947659d0817 (patch) | |
tree | 1d4292138f70f253bfc07e7b5ad5c20aaf3e1556 /src | |
parent | 24cfb9d74833f3c0d33cba45ea9b6832bddbf03e (diff) |
Add debug stream for QAccessibleInterface.
Change-Id: I68fddac5a09bbf092c1e38c411d49dfbf640f27d
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/accessible/qaccessible.cpp | 28 | ||||
-rw-r--r-- | src/gui/accessible/qaccessible.h | 4 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index 2de60e1bd4..2aaf66973a 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -50,6 +50,7 @@ #include <private/qguiapplication_p.h> #include "qplatformaccessibility_qpa.h" +#include <QtCore/QDebug> #include <QtCore/QHash> #include <QtCore/QMetaObject> #include <QtCore/QMutex> @@ -1224,6 +1225,33 @@ QAccessible2Interface *QAccessibleInterface::cast_helper(QAccessible2::Interface return interface_cast(t); } +#ifndef QT_NO_DEBUG_STREAM +Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleInterface *iface) +{ + if (!iface) { + d << "QAccessibleInterface(null)"; + return d; + } + d.nospace(); + d << "QAccessibleInterface(" << hex << (void *) iface << dec; + d << " name=" << iface->text(QAccessible::Name) << " "; + d << "role=" << iface->role() << " "; + if (iface->childCount()) + d << "childc=" << iface->childCount() << " "; + if (iface->object()) { + d << "obj=" << iface->object(); + } + bool invisible = iface->state() & QAccessible::Invisible; + if (invisible) { + d << "invisible"; + } else { + d << "rect=" << iface->rect(); + } + d << ")"; + return d.space(); +} +#endif + QT_END_NAMESPACE #endif diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index cba50f3ac4..7b9b9e12a4 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -447,6 +447,10 @@ inline QAccessibleEvent::QAccessibleEvent(Type atype, int achild) #define QAccessibleInterface_iid "com.trolltech.Qt.QAccessibleInterface" Q_DECLARE_INTERFACE(QAccessibleInterface, QAccessibleInterface_iid) +#ifndef QT_NO_DEBUG_STREAM +Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleInterface *iface); +#endif + #endif // QT_NO_ACCESSIBILITY QT_END_NAMESPACE |