summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtest.h
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-05-29 07:40:32 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-05-29 07:47:12 (GMT)
commitd4a8cb47cb106ad642e908763787407774619aac (patch)
tree871d15380006c52bca8a57ca966bd90fa192a284 /src/testlib/qtest.h
parentdcf5d568aba893d690eedbe1e18148b504de2abb (diff)
downloadQt-d4a8cb47cb106ad642e908763787407774619aac.zip
Qt-d4a8cb47cb106ad642e908763787407774619aac.tar.gz
Qt-d4a8cb47cb106ad642e908763787407774619aac.tar.bz2
Disable keypad navigation for the autotests and document it.
On Symbian keypad navigation is enabled by default since there is no reliable way to detect the presence of touch or not. Enabling this feature though causes problems for many of Qt's autotests since they were not written with this in mind. Many tests send QTest::key*() events to a widget and subsequently test the state of the widget, but with keypad navigation enabled, the behavior changes because the widget does not have edit focus by default. Reviewed-by: axis <qt-info@nokia.com>
Diffstat (limited to 'src/testlib/qtest.h')
-rw-r--r--src/testlib/qtest.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h
index 6ea38f7..15319ce 100644
--- a/src/testlib/qtest.h
+++ b/src/testlib/qtest.h
@@ -226,10 +226,17 @@ int main(int argc, char *argv[]) \
#include <QtTest/qtest_gui.h>
+#ifdef QT_KEYPAD_NAVIGATION
+# define QTEST_DISABLE_KEYPAD_NAVIGATION QApplication::setKeypadNavigationEnabled(false);
+#else
+# define QTEST_DISABLE_KEYPAD_NAVIGATION
+#endif
+
#define QTEST_MAIN(TestObject) \
int main(int argc, char *argv[]) \
{ \
QApplication app(argc, argv); \
+ QTEST_DISABLE_KEYPAD_NAVIGATION \
TestObject tc; \
return QTest::qExec(&tc, argc, argv); \
}