@@ -39,6 +39,20 | |||||
39 | // Some bamboo clients have trouble passing mouse events to the test application. |
|
39 | // Some bamboo clients have trouble passing mouse events to the test application. | |
40 | // This can be used to skip those tests so that they don't show up as a failure |
|
40 | // This can be used to skip those tests so that they don't show up as a failure | |
41 | // in the test report. |
|
41 | // in the test report. | |
|
42 | #ifdef QT5_QUICK_1 | |||
|
43 | #define SKIP_IF_CANNOT_TEST_MOUSE_EVENTS() { \ | |||
|
44 | do { \ | |||
|
45 | QPushButton b; \ | |||
|
46 | b.resize(100, 100); \ | |||
|
47 | b.show(); \ | |||
|
48 | QTest::qWaitForWindowShown(&b); \ | |||
|
49 | QSignalSpy spy(&b, SIGNAL(clicked())); \ | |||
|
50 | QTest::mouseClick(&b, Qt::LeftButton, 0, b.rect().center()); \ | |||
|
51 | if (spy.count() == 0) \ | |||
|
52 | QSKIP("Cannot test mouse events in this environment"); \ | |||
|
53 | } while (0); \ | |||
|
54 | } | |||
|
55 | #else | |||
42 | #define SKIP_IF_CANNOT_TEST_MOUSE_EVENTS() { \ |
|
56 | #define SKIP_IF_CANNOT_TEST_MOUSE_EVENTS() { \ | |
43 | do { \ |
|
57 | do { \ | |
44 | QPushButton b; \ |
|
58 | QPushButton b; \ | |
@@ -51,5 +65,6 | |||||
51 | QSKIP("Cannot test mouse events in this environment", SkipAll); \ |
|
65 | QSKIP("Cannot test mouse events in this environment", SkipAll); \ | |
52 | } while (0); \ |
|
66 | } while (0); \ | |
53 | } |
|
67 | } | |
|
68 | #endif | |||
54 |
|
69 | |||
55 | #endif // TST_DEFINITIONS_H |
|
70 | #endif // TST_DEFINITIONS_H |
General Comments 0
You need to be logged in to leave comments.
Login now