#ifndef QT_NO_ACCESSIBILITY
-#define QTEST_ACCESSIBILITY
-
#define QVERIFY_EVENT(object, child, event) \
QVERIFY(QTestAccessibility::verifyEvent(object, child, (int)event))
if (object) {
QApplication* app = qobject_cast<QApplication*>(object);
if ( !app )
- qWarning("QTEST_ACCESSIBILITY: root Object is not a QApplication!");
+ qWarning("%s: root Object is not a QApplication!", Q_FUNC_INFO);
} else {
- qWarning("QTEST_ACCESSIBILITY: root Object called with 0 pointer");
+ qWarning("%s: root Object called with 0 pointer", Q_FUNC_INFO);
}
}
void tst_QAccessibility::applicationTest()
{
-#ifdef QTEST_ACCESSIBILITY
QLatin1String name = QLatin1String("My Name");
qApp->setApplicationName(name);
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(qApp);
QCOMPARE(interface->text(QAccessible::Name, 0), name);
QCOMPARE(interface->role(0), QAccessible::Application);
delete interface;
-#else
- QSKIP("Test needs accessibility support.", SkipAll);
-#endif
}
void tst_QAccessibility::mainWindowTest()
{
-#ifdef QTEST_ACCESSIBILITY
QMainWindow mw;
mw.resize(300, 200);
mw.show(); // triggers layout
QCOMPARE(interface->text(QAccessible::Name, 0), name);
QCOMPARE(interface->role(0), QAccessible::Window);
delete interface;
-
-#else
- QSKIP("Test needs accessibility support.", SkipAll);
-#endif
}
class CounterButton : public QPushButton {
void tst_QAccessibility::tabWidgetTest()
{
-#ifdef QTEST_ACCESSIBILITY
QTabWidget *tabWidget = new QTabWidget();
tabWidget->show();
delete interface;
delete tabWidget;
QTestAccessibility::clearEvents();
-#else
- QSKIP("Test needs accessibility support.", SkipAll);
-#endif
}
void tst_QAccessibility::menuTest()