From 64b9e63f4f9162c1af299b1355e84b0e616ad768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Tue, 20 Jul 2010 11:40:48 +0200 Subject: Do not crash due to a infinite recursion when using voiceover on MacOS The reason for the infinite recursion was that QAccessibleTitleBar::object() returned the titlebar's dockwidget. This could lead to a problem when the AT client tried to traverse the accessibility hierarchy: As a response to QAXChildrenAttribute (retrieve children) on a dock widget node, it would register it's children in the hierarchy manager. In this case, the object registered for the titlebar interface was the QDockWidget. In order to do further traversal, the bridge could call queryAccessibleInterface on the list of retrieved children to get the QAccessibleInterface for those objects, however, that would return the QAccessibleDockWidget interface that we just had traversed,.... Task-number: QTBUG-6843 Reviewed-by: Carlos Manuel Duclos Vergara --- src/plugins/accessible/widgets/qaccessiblewidgets.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp index 499eb1d..662663d 100644 --- a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp +++ b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp @@ -984,7 +984,7 @@ int QAccessibleDockWidget::childCount() const int QAccessibleDockWidget::indexOfChild(const QAccessibleInterface *child) const { if (child) { - if (qobject_cast(child->object()) == dockWidget() && child->role(0) == TitleBar) { + if (child->role(0) == TitleBar) { return 1; } else { return 2; //### @@ -1214,7 +1214,7 @@ int QAccessibleTitleBar::childAt(int x, int y) const QObject *QAccessibleTitleBar::object() const { - return m_dockWidget; + return 0; } QDockWidgetLayout *QAccessibleTitleBar::dockWidgetLayout() const -- cgit v0.12