Remove Q_ASSERT from accessibility autotest
Instead of crashing when we can't get a QAccessibleInterface for a widget, output a useful warning and return a value that makes the test fail gracefully. Change-Id: I0b292cdd8f5a59e26bdc9b0b67cea2b58591df7d Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern (cherry picked from commit d8dc5bfdff25d72e8276c6e80080d72315abe7e0)
This commit is contained in:
parent
29851474c7
commit
6bc4d8b58f
@ -371,8 +371,9 @@ static QString stateNames(int state)
|
|||||||
QAccessible::State state(QWidget * const widget)
|
QAccessible::State state(QWidget * const widget)
|
||||||
{
|
{
|
||||||
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(widget);
|
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(widget);
|
||||||
Q_ASSERT(iface);
|
if (!iface)
|
||||||
QAccessible::State state = iface->state(0);
|
qWarning() << "Cannot get QAccessibleInterface for widget";
|
||||||
|
QAccessible::State state = (iface ? iface->state(0) : static_cast<QAccessible::State>(0));
|
||||||
delete iface;
|
delete iface;
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user