Accessibility: Ignore negative child indices in main window

Change-Id: I6b3d0b066bf20a09b43d6d80255fb8d428d38df1
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
This commit is contained in:
Frederik Gladhorn 2013-04-22 15:50:13 +02:00 committed by The Qt Project
parent 93aa83e074
commit 9c47a273ff

View File

@ -1127,7 +1127,7 @@ QAccessibleMainWindow::QAccessibleMainWindow(QWidget *widget)
QAccessibleInterface *QAccessibleMainWindow::child(int index) const
{
QList<QWidget*> kids = childWidgets(mainWindow(), true);
if (index < kids.count()) {
if (index >= 0 && index < kids.count()) {
return QAccessible::queryAccessibleInterface(kids.at(index));
}
return 0;