diff options
Diffstat (limited to 'src/widgets/styles/qstylehelper.cpp')
-rw-r--r-- | src/widgets/styles/qstylehelper.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp index e23db2b637..8d67683eae 100644 --- a/src/widgets/styles/qstylehelper.cpp +++ b/src/widgets/styles/qstylehelper.cpp @@ -86,6 +86,23 @@ qreal dpiScaled(qreal value) #endif } +// Searches for an ancestor of a particular accessible role +bool hasAncestor(QObject *obj, QAccessible::Role role) +{ + bool found = false; +#ifndef QT_NO_ACCESSIBILITY + QObject *parent = obj ? obj->parent() : 0; + while (parent && !found) { + QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(parent); + if (iface && iface->role() == role) + found = true; + delete iface; + parent = parent->parent(); + } +#endif // QT_NO_ACCESSIBILITY + return found; +} + #ifndef QT_NO_DIAL |