Skip to content

Commit

Permalink
Make sure that QAccessibleWindowContainer::childCount is valid
Browse files Browse the repository at this point in the history
When embedding foreign windows, we won't be able to return a valid child
accessible interface, so do not report it at all.
Supporting foreign windows properly is platform specific and something
to consider, but at least we shouldn't crash.

Task-number: QTBUG-63451
Change-Id: I19350cf97dc8d0c3f3052411eba0eee5f750dbab
Reviewed-by: Jan Arve Sæther <[email protected]>
  • Loading branch information
gladhorn authored and liangqi committed Oct 25, 2017
1 parent 5eb508a commit 7a26582
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/widgets/accessible/simplewidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ QAccessibleWindowContainer::QAccessibleWindowContainer(QWidget *w)

int QAccessibleWindowContainer::childCount() const
{
if (container()->containedWindow())
if (container()->containedWindow() && QAccessible::queryAccessibleInterface(container()->containedWindow()))
return 1;
return 0;
}
Expand Down

0 comments on commit 7a26582

Please sign in to comment.