summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.qdoc
blob: 973899e4d36fe10e41dbcf981b128d69b2b52035 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
   \namespace QTest
   \inmodule QtTest

   \brief The QTest namespace contains all the functions and
   declarations that are related to Qt Test.

   See the \l{Qt Test Overview} for information about how to write unit tests.
*/

/*! \macro QVERIFY(condition)

   \relates QTest

   The QVERIFY() macro checks whether the \a condition is true or not. If it is
   true, execution continues. If not, a failure is recorded in the test log
   and the test won't be executed further.

   You can use \l QVERIFY2() when it is practical and valuable to put additional
   information into the test failure report.

//! [macro-usage-limitation]
   \note This macro can only be used in a test function that is invoked
   by the test framework.
//! [macro-usage-limitation]

   For example, the following code shows this macro being used to verify that a
   \l QSignalSpy object is valid:

   \snippet code/src_qtestlib_qtestcase_snippet.cpp 0

   For more information about the failure, use \c QCOMPARE(x, y) instead of
   \c QVERIFY(x == y), because it reports both the expected and actual value
   when the comparison fails.

   \sa QCOMPARE(), QTRY_VERIFY(), QSignalSpy, QEXPECT_FAIL(), QCOMPARE_EQ(),
       QCOMPARE_NE(), QCOMPARE_LT(), QCOMPARE_LE(), QCOMPARE_GT(), QCOMPARE_GE()
*/

/*! \macro QVERIFY2(condition, message)

    \relates QTest

    The QVERIFY2() macro behaves exactly like QVERIFY(), except that it reports
    a \a message when \a condition is false. The \a message is a plain C string.

    The message can also be obtained from a function call that produces a plain
    C string, such as qPrintable() applied to a QString, which may be built in
    any of its usual ways, including applying \c {.args()} to format some data.

    Example:
    \snippet code/src_qtestlib_qtestcase.cpp 1

    For example, if you have a file object and you are testing its \c open()
    function, you might write a test with a statement like:

    \snippet code/src_qtestlib_qtestcase.cpp 32

    If this test fails, it will give no clue as to why the file failed to open:

    \c {FAIL! : tst_QFile::open_write() 'opened' returned FALSE. ()}

    If there is a more informative error message you could construct from the
    values being tested, you can use \c QVERIFY2() to pass that message along
    with your test condition, to provide a more informative message on failure:

    \snippet code/src_qtestlib_qtestcase.cpp 33

    If this branch is being tested in the Qt CI system, the above detailed
    failure message will be inserted into the summary posted to the code-review
    system:

    \c {FAIL! : tst_QFile::open_write() 'opened' returned FALSE.
        (open /tmp/qt.a3B42Cd: No space left on device)}

    \sa QVERIFY(), QCOMPARE(), QEXPECT_FAIL(), QCOMPARE_EQ(), QCOMPARE_NE(),
        QCOMPARE_LT(), QCOMPARE_LE(), QCOMPARE_GT(), QCOMPARE_GE()
*/

/*! \macro QCOMPARE(actual, expected)

   \relates QTest

   The QCOMPARE() macro compares an \a actual value to an \a expected value
   using the equality operator. If \a actual and \a expected match, execution
   continues. If not, a failure is recorded in the test log and the test
   function returns without attempting any later checks.

   Always respect QCOMPARE() parameter semantics. The first parameter passed to
   it should always be the actual value produced by the code-under-test, while
   the second parameter should always be the expected value. When the values
   don't match, QCOMPARE() prints them with the labels \e Actual and \e
   Expected.  If the parameter order is swapped, debugging a failing test can be
   confusing and tests expecting zero may fail due to rounding errors.

   QCOMPARE() tries to output the contents of the values if the comparison fails,
   so it is visible from the test log why the comparison failed.

   Example:
   \snippet code/src_qtestlib_qtestcase.cpp 2

   When comparing floating-point types (\c float, \c double, and \c qfloat16),
   \l {qFuzzyCompare()} is used for finite values. If \l {<QtNumeric>::}{qFuzzyIsNull()}
   is true for both values, they are also considered equal. Infinities
   match if they have the same sign, and any NaN as actual value matches
   with any NaN as expected value (even though NaN != NaN, even when
   they're identical).

   When comparing QList, arrays and initializer lists of the value type
   can be passed as expected value:
   \snippet code/src_qtestlib_qtestcase.cpp 34

   Note that using initializer lists requires defining a helper macro
   to prevent the preprocessor from interpreting the commas as macro argument
   delimiters:
   \snippet code/src_qtestlib_qtestcase.cpp 35

   \include qtestcase.qdoc macro-usage-limitation

//! [to-string-overload-desc]
   For your own classes, you can overload \l QTest::toString() to format values
   for output into the test log.
//! [to-string-overload-desc]

   Example:
   \snippet code/src_qtestlib_qtestcase_snippet.cpp 34

   The return from \c toString() must be a \c {new char []}. That is, it shall
   be released with \c delete[] (rather than \c free() or plain \c delete) once
   the calling code is done with it.

   \sa QVERIFY(), QTRY_COMPARE(), QTest::toString(), QEXPECT_FAIL(),
       QCOMPARE_EQ(), QCOMPARE_NE(), QCOMPARE_LT(), QCOMPARE_LE(),
       QCOMPARE_GT(), QCOMPARE_GE()
*/

/*! \macro QCOMPARE_EQ(computed, baseline)
    \since 6.4

    \relates QTest

    The QCOMPARE_EQ() macro checks that \a computed is equal to \a baseline using
    the equality operator. If that is true, execution continues. If not, a
    failure is recorded in the test log and the test function returns without
    attempting any later checks.

    It is generally similar to calling \c {QVERIFY(computed == baseline);}
    but prints a formatted error message reporting \a computed and \a baseline argument
    expressions and values in case of failure.

    \include qtestcase.qdoc macro-usage-limitation

    \include qtestcase.qdoc to-string-overload-desc

    \note Unlike QCOMPARE(), this macro does not provide overloads for custom
    types and pointers. So passing e.g. two \c {const char *} values as
    parameters will compare \e pointers, while QCOMPARE() does a comparison of
    C-style strings.

    \sa QCOMPARE(), QCOMPARE_NE(), QCOMPARE_LT(), QCOMPARE_LE(), QCOMPARE_GT(),
        QCOMPARE_GE()
*/

/*! \macro QCOMPARE_NE(computed, baseline)
    \since 6.4

    \relates QTest

    The QCOMPARE_NE() macro checks that \a computed is not equal to \a baseline using
    the inequality operator. If that is true, execution continues. If not, a
    failure is recorded in the test log and the test function returns without
    attempting any later checks.

    It is generally similar to calling \c {QVERIFY(computed != baseline);}
    but prints a formatted error message reporting \a computed and \a baseline argument
    expressions and values in case of failure.

    \include qtestcase.qdoc macro-usage-limitation

    \include qtestcase.qdoc to-string-overload-desc

    \sa QCOMPARE_EQ(), QCOMPARE_LT(), QCOMPARE_LE(), QCOMPARE_GT(), QCOMPARE_GE()
*/

/*! \macro QCOMPARE_LT(computed, baseline)
    \since 6.4

    \relates QTest

    The QCOMPARE_LT() macro checks that \a computed is less than \a baseline using the
    less-than operator. If that is true, execution continues. If not, a failure
    is recorded in the test log and the test function returns without attempting
    any later checks.

    It is generally similar to calling \c {QVERIFY(computed < baseline);}
    but prints a formatted error message reporting \a computed and \a baseline argument
    expressions and values in case of failure.

    \include qtestcase.qdoc macro-usage-limitation

    \include qtestcase.qdoc to-string-overload-desc

    \sa QCOMPARE_EQ(), QCOMPARE_NE(), QCOMPARE_LE(), QCOMPARE_GT(), QCOMPARE_GE()
*/

/*! \macro QCOMPARE_LE(computed, baseline)
    \since 6.4

    \relates QTest

    The QCOMPARE_LE() macro checks that \a computed is at most \a baseline using the
    less-than-or-equal-to operator. If that is true, execution continues. If
    not, a failure is recorded in the test log and the test function returns
    without attempting any later checks.

    It is generally similar to calling \c {QVERIFY(computed <= baseline);}
    but prints a formatted error message reporting \a computed and \a baseline argument
    expressions and values in case of failure.

    \include qtestcase.qdoc macro-usage-limitation

    \include qtestcase.qdoc to-string-overload-desc

    \sa QCOMPARE_EQ(), QCOMPARE_NE(), QCOMPARE_LT(), QCOMPARE_GT(), QCOMPARE_GE()
*/

/*! \macro QCOMPARE_GT(computed, baseline)
    \since 6.4

    \relates QTest

    The QCOMPARE_GT() macro checks that \a computed is greater than \a baseline using
    the greater-than operator. If that is true, execution continues. If not, a
    failure is recorded in the test log and the test function returns without
    attempting any later checks.

    It is generally similar to calling \c {QVERIFY(computed > baseline);}
    but prints a formatted error message reporting \a computed and \a baseline argument
    expressions and values in case of failure.

    \include qtestcase.qdoc macro-usage-limitation

    \include qtestcase.qdoc to-string-overload-desc

    \sa QCOMPARE_EQ(), QCOMPARE_NE(), QCOMPARE_LT(), QCOMPARE_LE(), QCOMPARE_GE()
*/

/*! \macro QCOMPARE_GE(computed, baseline)
    \since 6.4

    \relates QTest

    The QCOMPARE_GE() macro checks that \a computed is at least \a baseline using the
    greater-than-or-equal-to operator. If that is true, execution continues. If
    not, a failure is recorded in the test log and the test function returns
    without attempting any later checks.

    It is generally similar to calling \c {QVERIFY(computed >= baseline);}
    but prints a formatted error message reporting \a computed and \a baseline argument
    expressions and values in case of failure.

    \include qtestcase.qdoc macro-usage-limitation

    \include qtestcase.qdoc to-string-overload-desc

    \sa QCOMPARE_EQ(), QCOMPARE_NE(), QCOMPARE_LT(), QCOMPARE_LE(), QCOMPARE_GT()
*/

/*! \macro QVERIFY_EXCEPTION_THROWN(expression, exceptiontype)
   \since 5.3

   \relates QTest
   \deprecated [6.3] Use \c{QVERIFY_THROWS_EXCEPTION(exceptiontype, expression)} instead.
*/

/*!
   \macro QVERIFY_THROWS_EXCEPTION(exceptiontype, ...)
   \relates QTest
   \since 6.3

   The QVERIFY_THROWS_EXCEPTION macro executes the expression given in the variadic
   argument and expects to catch an exception thrown from the expression.

   There are several possible outcomes:

   \list
   \li If the expression throws an exception that is either the same as
   \a exceptiontype or derived from \a exceptiontype, then execution will continue.

   \li Otherwise, if the expression throws no exception, or the
   exception thrown derives from \c{std::exception}, then a failure
   will be recorded in the test log and the macro returns early
   (from enclosing function).

   \li If the thrown exception derives neither from \c{std::exception} nor from
   \a exceptiontype, a failure will be recorded in the test log, and the exception is
   re-thrown. This avoids problems with e.g. pthread cancellation exceptions.
   \endlist

   The macro uses variadic arguments so the expression can contain commas that the
   preprocessor considers argument separators, e.g. as in
   \code
   QVERIFY_THROWS_EXCEPTION(std::bad_alloc,
   // macro arguments:      ^ exceptiontype
                            std::vector<std::pair<int, long>>{42'000'000'000, {42, 42L}});
   // macro arguments:      \---------- 1 ----------/  \-------- 2 --------/  \3/  \ 4 /
   //                       \----------------------- expression -----------------------/
   \endcode

   \note This macro can only be used in a test function that is invoked
   by the test framework.
*/

/*!
   \macro QVERIFY_THROWS_NO_EXCEPTION(...)
   \since 6.3

   \relates QTest

   The QVERIFY_THROWS_NO_EXCEPTION macro executes the expression given in its
   variadic argument and tries to catch any exception thrown from the expression.

   There are several different outcomes:

   \list
   \li If the expression does not throw an exception, then execution will continue.

   \li Otherwise, if an exception derived from \c{std::exception} is caught, a failure
   will be recorded in the test log and the macro returns early (implicit return from
   enclosing function).

   \li If an exception not derived from \c{std::exception} is caught, a failure will be
   recorded in the test log and the exception will be re-thrown. This avoids problems
   with e.g. pthread cancellation exceptions.
   \endlist

   The macro uses variadic arguments so the expression can contain commas that the
   preprocessor considers argument separators, e.g. as in
   \code
   QVERIFY_THROWS_NO_EXCEPTION(std::pair<int, long>{42, 42L});
   // macro arguments:         \---- 1 ----/  \-- 2 -/  \3 /
   \endcode

   \note This macro can only be used in a test function that is invoked
   by the test framework.
*/

/*! \macro QTRY_VERIFY_WITH_TIMEOUT(condition, timeout)
   \since 5.0

   \relates QTest

   The QTRY_VERIFY_WITH_TIMEOUT() macro is similar to QVERIFY(), but checks the \a condition
   repeatedly, until either the condition becomes true or the \a timeout (in milliseconds) is
   reached.  Between each evaluation, events will be processed.  If the timeout
   is reached, a failure is recorded in the test log and the test won't be
   executed further.

   //![chrono-timeout]
   Since Qt 6.8, the \a timeout can also be a \c{std::chrono} literal such as \c{2s}.
   //![chrono-timeout]

   \note This macro can only be used in a test function that is invoked
   by the test framework.

   \sa QTRY_VERIFY(), QTRY_VERIFY2_WITH_TIMEOUT(), QVERIFY(), QCOMPARE(), QTRY_COMPARE(),
   QEXPECT_FAIL()
*/


/*! \macro QTRY_VERIFY(condition)
   \since 5.0

   \relates QTest

   Checks the \a condition by invoking QTRY_VERIFY_WITH_TIMEOUT() with a timeout of five seconds.

   \note This macro can only be used in a test function that is invoked
   by the test framework.

   \sa QTRY_VERIFY_WITH_TIMEOUT(), QTRY_VERIFY2(), QVERIFY(), QCOMPARE(), QTRY_COMPARE(),
   QEXPECT_FAIL()
*/

/*! \macro QTRY_VERIFY2_WITH_TIMEOUT(condition, message, timeout)
   \since 5.6

   \relates QTest

   The QTRY_VERIFY2_WITH_TIMEOUT macro is similar to QTRY_VERIFY_WITH_TIMEOUT()
   except that it outputs a verbose \a message when \a condition is still false
   after the specified \a timeout (in milliseconds). The \a message is a plain C string.

   \include qtestcase.qdoc chrono-timeout

   Example:
   \code
   QTRY_VERIFY2_WITH_TIMEOUT(list.size() > 2, QByteArray::number(list.size()).constData(), 10s);
   \endcode

   \note This macro can only be used in a test function that is invoked
   by the test framework.

   \sa QTRY_VERIFY(), QTRY_VERIFY_WITH_TIMEOUT(), QVERIFY(), QCOMPARE(), QTRY_COMPARE(),
   QEXPECT_FAIL()
*/

/*! \macro QTRY_VERIFY2(condition, message)
   \since 5.6

   \relates QTest

   Checks the \a condition by invoking QTRY_VERIFY2_WITH_TIMEOUT() with a timeout
   of five seconds. If \a condition is then still false, \a message is output.
   The \a message is a plain C string.

   Example:
   \code
   QTRY_VERIFY2(list.size() > 2, QByteArray::number(list.size()).constData());
   \endcode

   \note This macro can only be used in a test function that is invoked
   by the test framework.

   \sa QTRY_VERIFY2_WITH_TIMEOUT(), QTRY_VERIFY2(), QVERIFY(), QCOMPARE(), QTRY_COMPARE(),
   QEXPECT_FAIL()
*/

/*! \macro QTRY_COMPARE_WITH_TIMEOUT(actual, expected, timeout)
   \since 5.0

   \relates QTest

   The QTRY_COMPARE_WITH_TIMEOUT() macro is similar to QCOMPARE(), but performs the comparison
   of the \a actual and \a expected values repeatedly, until either the two values
   are equal or the \a timeout (in milliseconds) is reached.  Between each comparison, events
   will be processed.  If the timeout is reached, a failure is recorded in the
   test log and the test won't be executed further.

   \include qtestcase.qdoc chrono-timeout

   \note This macro can only be used in a test function that is invoked
   by the test framework.

   \sa QTRY_COMPARE(), QCOMPARE(), QVERIFY(), QTRY_VERIFY(), QEXPECT_FAIL()
*/

/*! \macro QTRY_COMPARE(actual, expected)
   \since 5.0

   \relates QTest

   Performs a comparison of the \a actual and \a expected values by
   invoking QTRY_COMPARE_WITH_TIMEOUT() with a timeout of five seconds.

   \note This macro can only be used in a test function that is invoked
   by the test framework.

   \sa QTRY_COMPARE_WITH_TIMEOUT(), QCOMPARE(), QVERIFY(), QTRY_VERIFY(),
   QEXPECT_FAIL()
*/

/*! \macro QTRY_COMPARE_EQ_WITH_TIMEOUT(computed, baseline, timeout)
    \since 6.4
    \relates QTest

    This macro is similar to QCOMPARE_EQ(), but performs the comparison of the
    \a computed and \a baseline values repeatedly, until either the comparison returns
    \c true or the \a timeout (in milliseconds) is reached. Between each
    comparison, events will be processed. If the timeout is reached, a failure
    is recorded in the test log and the test won't be executed further.

    \include qtestcase.qdoc chrono-timeout

    \include qtestcase.qdoc macro-usage-limitation

    \sa QCOMPARE_EQ(), QTRY_COMPARE_EQ()
*/

/*! \macro QTRY_COMPARE_EQ(computed, baseline)
    \since 6.4
    \relates QTest

    Performs comparison of \a computed and \a baseline values by invoking
    QTRY_COMPARE_EQ_WITH_TIMEOUT with a timeout of five seconds.

    \include qtestcase.qdoc macro-usage-limitation

    \sa QCOMPARE_EQ(), QTRY_COMPARE_EQ_WITH_TIMEOUT()
*/

/*! \macro QTRY_COMPARE_NE_WITH_TIMEOUT(computed, baseline, timeout)
    \since 6.4
    \relates QTest

    This macro is similar to QCOMPARE_NE(), but performs the comparison of the
    \a computed and \a baseline values repeatedly, until either the comparison returns
    \c true or the \a timeout (in milliseconds) is reached. Between each
    comparison, events will be processed. If the timeout is reached, a failure
    is recorded in the test log and the test won't be executed further.

    \include qtestcase.qdoc chrono-timeout

    \include qtestcase.qdoc macro-usage-limitation

    \sa QCOMPARE_NE(), QTRY_COMPARE_NE()
*/

/*! \macro QTRY_COMPARE_NE(computed, baseline)
    \since 6.4
    \relates QTest

    Performs comparison of \a computed and \a baseline values by invoking
    QTRY_COMPARE_NE_WITH_TIMEOUT with a timeout of five seconds.

    \include qtestcase.qdoc macro-usage-limitation

    \sa QCOMPARE_NE(), QTRY_COMPARE_NE_WITH_TIMEOUT()
*/

/*! \macro QTRY_COMPARE_LT_WITH_TIMEOUT(computed, baseline, timeout)
    \since 6.4
    \relates QTest

    This macro is similar to QCOMPARE_LT(), but performs the comparison of the
    \a computed and \a baseline values repeatedly, until either the comparison returns
    \c true or the \a timeout (in milliseconds) is reached. Between each
    comparison, events will be processed. If the timeout is reached, a failure
    is recorded in the test log and the test won't be executed further.

    \include qtestcase.qdoc chrono-timeout

    \include qtestcase.qdoc macro-usage-limitation

    \sa QCOMPARE_LT(), QTRY_COMPARE_LT()
*/

/*! \macro QTRY_COMPARE_LT(computed, baseline)
    \since 6.4
    \relates QTest

    Performs comparison of \a computed and \a baseline values by invoking
    QTRY_COMPARE_LT_WITH_TIMEOUT with a timeout of five seconds.

    \include qtestcase.qdoc macro-usage-limitation

    \sa QCOMPARE_LT(), QTRY_COMPARE_LT_WITH_TIMEOUT()
*/

/*! \macro QTRY_COMPARE_LE_WITH_TIMEOUT(computed, baseline, timeout)
    \since 6.4
    \relates QTest

    This macro is similar to QCOMPARE_LE(), but performs the comparison of the
    \a computed and \a baseline values repeatedly, until either the comparison returns
    \c true or the \a timeout (in milliseconds) is reached. Between each
    comparison, events will be processed. If the timeout is reached, a failure
    is recorded in the test log and the test won't be executed further.

    \include qtestcase.qdoc chrono-timeout

    \include qtestcase.qdoc macro-usage-limitation

    \sa QCOMPARE_LE(), QTRY_COMPARE_LE()
*/

/*! \macro QTRY_COMPARE_LE(computed, baseline)
    \since 6.4
    \relates QTest

    Performs comparison of \a computed and \a baseline values by invoking
    QTRY_COMPARE_LE_WITH_TIMEOUT with a timeout of five seconds.

    \include qtestcase.qdoc macro-usage-limitation

    \sa QCOMPARE_LE(), QTRY_COMPARE_LE_WITH_TIMEOUT()
*/

/*! \macro QTRY_COMPARE_GT_WITH_TIMEOUT(computed, baseline, timeout)
    \since 6.4
    \relates QTest

    This macro is similar to QCOMPARE_GT(), but performs the comparison of the
    \a computed and \a baseline values repeatedly, until either the comparison returns
    \c true or the \a timeout (in milliseconds) is reached. Between each
    comparison, events will be processed. If the timeout is reached, a failure
    is recorded in the test log and the test won't be executed further.

    \include qtestcase.qdoc chrono-timeout

    \include qtestcase.qdoc macro-usage-limitation

    \sa QCOMPARE_GT(), QTRY_COMPARE_GT()
*/

/*! \macro QTRY_COMPARE_GT(computed, baseline)
    \since 6.4
    \relates QTest

    Performs comparison of \a computed and \a baseline values by invoking
    QTRY_COMPARE_GT_WITH_TIMEOUT with a timeout of five seconds.

    \include qtestcase.qdoc macro-usage-limitation

    \sa QCOMPARE_GT(), QTRY_COMPARE_GT_WITH_TIMEOUT()
*/

/*! \macro QTRY_COMPARE_GE_WITH_TIMEOUT(computed, baseline, timeout)
    \since 6.4
    \relates QTest

    This macro is similar to QCOMPARE_GE(), but performs the comparison of the
    \a computed and \a baseline values repeatedly, until either the comparison returns
    \c true or the \a timeout (in milliseconds) is reached. Between each
    comparison, events will be processed. If the timeout is reached, a failure
    is recorded in the test log and the test won't be executed further.

    \include qtestcase.qdoc chrono-timeout

    \include qtestcase.qdoc macro-usage-limitation

    \sa QCOMPARE_GE(), QTRY_COMPARE_GE()
*/

/*! \macro QTRY_COMPARE_GE(computed, baseline)
    \since 6.4
    \relates QTest

    Performs comparison of \a computed and \a baseline values by invoking
    QTRY_COMPARE_GE_WITH_TIMEOUT with a timeout of five seconds.

    \include qtestcase.qdoc macro-usage-limitation

    \sa QCOMPARE_GE(), QTRY_COMPARE_GE_WITH_TIMEOUT()
*/

/*! \macro QFETCH(type, name)

   \relates QTest

   The fetch macro creates a local variable named \a name with the type \a type
   on the stack. The \a name and \a type must match a column from the test's
   data table. This is asserted and the test will abort if the assertion fails.

   Assuming a test has the following data:

   \snippet code/src_qtestlib_qtestcase.cpp 3

   The test data has two elements, a QString called \c aString and an integer
   called \c expected. To fetch these values in the actual test:

   \snippet code/src_qtestlib_qtestcase.cpp 4

   \c aString and \c expected are variables on the stack that are initialized with
   the current test data.

   \note This macro can only be used in a test function that is invoked
   by the test framework. The test function must have a _data function.
*/

/*! \macro QFETCH_GLOBAL(type, name)

   \relates QTest

   This macro fetches a variable named \a name with the type \a type from
   a row in the global data table. The \a name and \a type must match a
   column in the global data table. This is asserted and the test will abort
   if the assertion fails.

   Assuming a test has the following data:

   \snippet code/src_qtestlib_qtestcase_snippet.cpp 30

   The test's own data is a single number per row. In this case,
   \c initTestCase_data() also supplies a locale per row. Therefore,
   this test will be run with every combination of locale from the
   latter and number from the former. Thus, with four rows in the
   global table and three in the local, the test function is run for
   12 distinct test-cases (4 * 3 = 12).

   \snippet code/src_qtestlib_qtestcase_snippet.cpp 31

   The locale is read from the global data table using QFETCH_GLOBAL(),
   and the number is read from the local data table using QFETCH().

   \note This macro can only be used in test methods of a class with an
   \c initTestCase_data() method.
*/

/*! \macro QWARN(message)

   \relates QTest
   \threadsafe
   \deprecated Use qWarning() instead.

   Appends \a message as a warning to the test log. This macro can be used anywhere
   in your tests.
*/

/*! \macro QFAIL(message)

   \relates QTest

   This macro can be used to force a test failure. The test stops
   executing and the failure \a message is appended to the test log.

   \note This macro can only be used in a test function that is invoked
   by the test framework.

   Example:

   \snippet code/src_qtestlib_qtestcase.cpp 5
*/

/*! \macro QTEST(actual, testElement)

   \relates QTest

   QTEST() is a convenience macro for \l QCOMPARE() that compares
   the value \a actual with the element \a testElement from the test's data.
   If there is no such element, the test asserts.

   Apart from that, QTEST() behaves exactly as \l QCOMPARE().

   Instead of writing:

   \snippet code/src_qtestlib_qtestcase.cpp 6

   you can write:

   \snippet code/src_qtestlib_qtestcase.cpp 7

   \sa QCOMPARE()
*/

/*! \macro QSKIP(description)

   \relates QTest

   If called from a test function, the QSKIP() macro stops execution of the test
   without adding a failure to the test log. You can use it to skip tests that
   wouldn't make sense in the current configuration. For example, a test of font
   rendering may call QSKIP() if the needed fonts are not installed on the test
   system.

   The text \a description is appended to the test log and should contain an
   explanation of why the test couldn't be executed.

   If the test is data-driven, each call to QSKIP() in the test function will
   skip only the current row of test data, so an unconditional call to QSKIP()
   will produce one skip message in the test log for each row of test data.

   If called from an \c _data function, the QSKIP() macro will stop execution of
   the \c _data function and will prevent execution of the associated test
   function. This entirely omits a data-driven test. To omit individual rows,
   make them conditional by using a simple \c{if (condition) newRow(...) << ...}
   in the \c _data function, instead of using QSKIP() in the test function.

   If called from \c initTestCase_data(), the QSKIP() macro will skip all test
   and \c _data functions. If called from \c initTestCase() when there is no
   \c initTestCase_data(), or when it only sets up one row, QSKIP() will
   likewise skip the whole test. However, if \c initTestCase_data() contains
   more than one row, then \c initTestCase() is called (followed by each test
   and finally the wrap-up) once per row of it. Therefore, a call to QSKIP() in
   \c initTestCase() will merely skip all test functions for the current row of
   global data, set up by \c initTestCase_data().

   \note This macro can only be used in a test function or \c _data
   function that is invoked by the test framework.

   Example:
   \snippet code/src_qtestlib_qtestcase.cpp 8

   \section2 Skipping Known Bugs

   If a test exposes a known bug that will not be fixed immediately, use the
   QEXPECT_FAIL() macro to document the failure and reference the bug tracking
   identifier for the known issue. When the test is run, expected failures will
   be marked as XFAIL in the test output and will not be counted as failures
   when setting the test program's return code. If an expected failure does
   not occur, the XPASS (unexpected pass) will be reported in the test output
   and will be counted as a test failure.

   For known bugs, QEXPECT_FAIL() is better than QSKIP() because a developer
   cannot fix the bug without an XPASS result reminding them that the test
   needs to be updated too. If QSKIP() is used, there is no reminder to revise
   or re-enable the test, without which subsequent regressions will not be
   reported.

   \sa QEXPECT_FAIL(), {Select Appropriate Mechanisms to Exclude Tests}
*/

/*! \macro QEXPECT_FAIL(dataIndex, comment, mode)

   \relates QTest

   The QEXPECT_FAIL() macro marks the next \l QCOMPARE() or \l QVERIFY() as an
   expected failure. Instead of adding a failure to the test log, an expected
   failure will be reported.

   If a \l QVERIFY() or \l QCOMPARE() is marked as an expected failure,
   but passes instead, an unexpected pass (XPASS) is written to the test log
   and will be counted as a test failure.

   The parameter \a dataIndex describes for which entry in the test data the
   failure is expected. Pass an empty string (\c{""}) if the failure
   is expected for all entries or if no test data exists.

   \a comment will be appended to the test log for the expected failure.

   \a mode is a \l QTest::TestFailMode and sets whether the test should
   continue to execute or not. The \a mode is applied regardless of
   whether the expected test failure occurs.

   \note This macro can only be used in a test function that is invoked
   by the test framework.

   Example 1:
   \snippet code/src_qtestlib_qtestcase.cpp 9

   In the example above, an expected fail will be written into the test output
   if the variable \c i is not 42. If the variable \c i is 42, an unexpected pass
   is written instead. The QEXPECT_FAIL() has no influence on the second QCOMPARE()
   statement in the example.

   Example 2:
   \snippet code/src_qtestlib_qtestcase.cpp 10

   The above testfunction will not continue executing for the test data
   entry \c{data27} (regardless of the value of \c i).

   \sa QTest::TestFailMode, QVERIFY(), QCOMPARE()
*/

/*! \macro QFINDTESTDATA(filename)
   \since 5.0

   \relates QTest

   Returns a QString for the testdata file referred to by \a filename, or an
   empty QString if the testdata file could not be found.

   This macro allows the test to load data from an external file without
   hardcoding an absolute filename into the test, or using relative paths
   which may be error prone.

   The returned path will be the first path from the following list which
   resolves to an existing file or directory:

   \list
   \li \a filename relative to QCoreApplication::applicationDirPath()
      (only if a QCoreApplication or QApplication object has been created).
   \li \a filename relative to the test's standard install directory
      (QLibraryInfo::TestsPath with the lowercased testcase name appended).
   \li \a filename relative to the directory containing the source file from which
      QFINDTESTDATA is invoked.
   \endlist

   If the named file/directory does not exist at any of these locations,
   a warning is printed to the test log.

   For example, in this code:
   \snippet code/src_qtestlib_qtestcase_snippet.cpp 26

   The testdata file will be resolved as the first existing file from:

   \list
   \li \c{/home/user/build/myxmlparser/tests/tst_myxmlparser/testxml/simple1.xml}
   \li \c{/usr/local/Qt-5.0.0/tests/tst_myxmlparser/testxml/simple1.xml}
   \li \c{/home/user/sources/myxmlparser/tests/tst_myxmlparser/testxml/simple1.xml}
   \endlist

   This allows the test to find its testdata regardless of whether the
   test has been installed, and regardless of whether the test's build tree
   is equal to the test's source tree.

   \note reliable detection of testdata from the source directory requires
   either that qmake is used, or the \c{QT_TESTCASE_BUILDDIR} macro is defined to
   point to the working directory from which the compiler is invoked, or only
   absolute paths to the source files are passed to the compiler. Otherwise, the
   absolute path of the source directory cannot be determined.

   \note The \c{QT_TESTCASE_BUILDDIR} macro is also implicitly defined if CMake is used
   and the QtTest module is linked to the target. You can change the default
   \c{QT_TESTCASE_BUILDDIR} by setting the QT_TESTCASE_BUILDDIR property on the target.

   \note For tests that use the \l QTEST_APPLESS_MAIN() macro to generate a
   \c{main()} function, \c{QFINDTESTDATA} will not attempt to find test data
   relative to QCoreApplication::applicationDirPath().  In practice, this means that
   tests using \c{QTEST_APPLESS_MAIN()} will fail to find their test data
   if run from a shadow build tree.
*/

/*! \macro QTEST_MAIN(TestClass)

    \relates QTest

    Implements a main() function that instantiates an application object and
    the \a TestClass, and executes all tests in the order they were defined.
    Use this macro to build stand-alone executables.

    If \c QT_WIDGETS_LIB is defined, the application object will be a QApplication,
    if \c QT_GUI_LIB is defined, the application object will be a QGuiApplication,
    otherwise it will be a QCoreApplication.  If qmake is used and the configuration
    includes \c{QT += widgets}, then \c QT_WIDGETS_LIB will be defined automatically.
    Similarly, if qmake is used and the configuration includes \c{QT += gui}, then
    \c QT_GUI_LIB will be defined automatically.

    \note On platforms that have keypad navigation enabled by default,
    this macro will forcefully disable it if \c QT_WIDGETS_LIB is defined.  This is done
    to simplify the usage of key events when writing autotests. If you wish to write a
    test case that uses keypad navigation, you should enable it either in the
    \c {initTestCase()} or \c {init()} functions of your test case by calling
    \l {QApplication::setNavigationMode()}.

    Example:
    \snippet code/src_qtestlib_qtestcase.cpp 11

    \sa QTEST_APPLESS_MAIN(), QTEST_GUILESS_MAIN(), QTest::qExec(),
    QApplication::setNavigationMode()
*/

/*! \macro QTEST_APPLESS_MAIN(TestClass)

    \relates QTest

    Implements a main() function that executes all tests in \a TestClass.

    Behaves like \l QTEST_MAIN(), but doesn't instantiate a QApplication
    object. Use this macro for really simple stand-alone non-GUI tests.

    \sa QTEST_MAIN()
*/

/*! \macro QTEST_GUILESS_MAIN(TestClass)
    \since 5.0

    \relates QTest

    Implements a main() function that instantiates a QCoreApplication object
    and the \a TestClass, and executes all tests in the order they were
    defined.  Use this macro to build stand-alone executables.

    Behaves like \l QTEST_MAIN(), but instantiates a QCoreApplication instead
    of the QApplication object. Use this macro if your test case doesn't need
    functionality offered by QApplication, but the event loop is still necessary.

    \sa QTEST_MAIN()
*/

/*!
    \macro QBENCHMARK

    \relates QTest

    This macro is used to measure the performance of code within a test.
    The code to be benchmarked is contained within a code block following
    this macro.

    For example:

    \snippet code/src_qtestlib_qtestcase.cpp 27

    \sa {Qt Test Overview#Creating a Benchmark}{Creating a Benchmark},
        {Chapter 5: Writing a Benchmark}{Writing a Benchmark}
*/

/*!
    \macro QBENCHMARK_ONCE
    \since 4.6

    \relates QTest

    \brief The QBENCHMARK_ONCE macro is for measuring performance of a
    code block by running it once.

    This macro is used to measure the performance of code within a test.
    The code to be benchmarked is contained within a code block following
    this macro.

    Unlike QBENCHMARK, the contents of the contained code block is only run
    once. The elapsed time will be reported as "0" if it's too short to
    be measured by the selected backend.

    \sa {Qt Test Overview#Creating a Benchmark}{Creating a Benchmark},
    {Chapter 5: Writing a Benchmark}{Writing a Benchmark}
*/

/*! \enum QTest::TestFailMode

    This enum describes the modes for handling a check, such as by \l
    QVERIFY() or \l QCOMPARE() macros, that is known to fail. The mode
    applies regardless of whether the check fails or succeeds.

    \value Abort Aborts the execution of the test. Use this mode when
           it doesn't make sense to execute the test any further after
           the problematic check.

    \value Continue Continues execution of the test after the
           problematic check.

    \sa QEXPECT_FAIL()
*/

/*! \enum QTest::KeyAction

    This enum describes possible actions for key handling.

    \value Press    The key is pressed.
    \value Release  The key is released.
    \value Click    The key is clicked (pressed and released).
    \value Shortcut A shortcut is activated. This value has been added in Qt 5.6.
*/

/*! \enum QTest::MouseAction

    This enum describes possible actions for mouse handling.

    \value MousePress    A mouse button is pressed.
    \value MouseRelease  A mouse button is released.
    \value MouseClick    A mouse button is clicked (pressed and released).
    \value MouseDClick   A mouse button is double clicked (pressed and released twice).
    \value MouseMove     The mouse pointer has moved.
*/

/*! \fn void QTest::keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)

    Simulates clicking of \a key with an optional \a modifier on a \a widget.
    If \a delay is larger than 0, the test will wait for \a delay milliseconds
    before clicking the key.

    Examples:
    \snippet code/src_qtestlib_qtestcase_snippet.cpp 14

    The first example above simulates clicking the \c escape key on \c
    myWidget without any keyboard modifiers and without delay. The
    second example simulates clicking \c shift-escape on \c myWidget
    following a 200 ms delay of the test.

    \sa QTest::keyClicks()
*/

/*! \fn void QTest::keyClick(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
    \overload

    Simulates clicking of \a key with an optional \a modifier on a \a widget.
    If \a delay is larger than 0, the test will wait for \a delay milliseconds
    before clicking the key.

    Example:
    \snippet code/src_qtestlib_qtestcase_snippet.cpp 13

    The example above simulates clicking \c a on \c myWidget without
    any keyboard modifiers and without delay of the test.

    \sa QTest::keyClicks()
*/

/*! \fn void QTest::keySequence(QWidget *widget, const QKeySequence &keySequence)
    \overload
    \since 5.10

    Simulates typing of \a keySequence into a \a widget.

    \sa QTest::keyClick(), QTest::keyClicks()
*/

/*! \fn void QTest::keyClick(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
    \overload
    \since 5.0

    Simulates clicking of \a key with an optional \a modifier on a \a window.
    If \a delay is larger than 0, the test will wait for \a delay milliseconds
    before clicking the key.

    Examples:
    \snippet code/src_qtestlib_qtestcase_snippet.cpp 29

    The first example above simulates clicking the \c escape key on \c
    myWindow without any keyboard modifiers and without delay. The
    second example simulates clicking \c shift-escape on \c myWindow
    following a 200 ms delay of the test.

    \sa QTest::keyClicks()
*/

/*! \fn void QTest::keyClick(QWindow *window, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
    \overload
    \since 5.0

    Simulates clicking of \a key with an optional \a modifier on a \a window.
    If \a delay is larger than 0, the test will wait for \a delay milliseconds
    before clicking the key.

    Example:
    \snippet code/src_qtestlib_qtestcase_snippet.cpp 28

    The example above simulates clicking \c a on \c myWindow without
    any keyboard modifiers and without delay of the test.

    \sa QTest::keyClicks()
*/

/*! \fn void QTest::keySequence(QWindow *window, const QKeySequence &keySequence)
    \overload
    \since 5.10

    Simulates typing of \a keySequence into a \a window.

    \sa QTest::keyClick(), QTest::keyClicks()
*/

/*! \fn void QTest::keyEvent(KeyAction action, QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)

    Sends a Qt key event to \a widget with the given \a key and an associated \a action.
    Optionally, a keyboard \a modifier can be specified, as well as a \a delay
    (in milliseconds) of the test before sending the event.
*/

/*! \fn void QTest::keyEvent(KeyAction action, QWidget *widget, char ascii, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
    \overload

    Sends a Qt key event to \a widget with the given key \a ascii and an associated \a action.
    Optionally, a keyboard \a modifier can be specified, as well as a \a delay
    (in milliseconds) of the test before sending the event.
*/

/*! \fn void QTest::keyEvent(KeyAction action, QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
    \overload
    \since 5.0

    Sends a Qt key event to \a window with the given \a key and an associated \a action.
    Optionally, a keyboard \a modifier can be specified, as well as a \a delay
    (in milliseconds) of the test before sending the event.
*/

/*! \fn void QTest::keyEvent(KeyAction action, QWindow *window, char ascii, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
    \overload
    \since 5.0

    Sends a Qt key event to \a window with the given key \a ascii and an associated \a action.
    Optionally, a keyboard \a modifier can be specified, as well as a \a delay
    (in milliseconds) of the test before sending the event.
*/

/*! \fn void QTest::keyPress(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)

    Simulates pressing a \a key with an optional \a modifier on a \a widget. If \a delay
    is larger than 0, the test will wait for \a delay milliseconds before pressing the key.

    \note At some point you should release the key using \l keyRelease().

    \sa QTest::keyRelease(), QTest::keyClick()
*/

/*! \fn void QTest::keyPress(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
    \overload

    Simulates pressing a \a key with an optional \a modifier on a \a widget.
    If \a delay is larger than 0, the test will wait for \a delay milliseconds
    before pressing the key.

    \note At some point you should release the key using \l keyRelease().

    \sa QTest::keyRelease(), QTest::keyClick()
*/

/*! \fn void QTest::keyPress(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
    \overload
    \since 5.0

    Simulates pressing a \a key with an optional \a modifier on a \a window. If \a delay
    is larger than 0, the test will wait for \a delay milliseconds before pressing the key.

    \note At some point you should release the key using \l keyRelease().

    \sa QTest::keyRelease(), QTest::keyClick()
*/

/*! \fn void QTest::keyPress(QWindow *window, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
    \overload
    \since 5.0

    Simulates pressing a \a key with an optional \a modifier on a \a window.
    If \a delay is larger than 0, the test will wait for \a delay milliseconds
    before pressing the key.

    \note At some point you should release the key using \l keyRelease().

    \sa QTest::keyRelease(), QTest::keyClick()
*/

/*! \fn void QTest::keyRelease(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)

    Simulates releasing a \a key with an optional \a modifier on a \a widget.
    If \a delay is larger than 0, the test will wait for \a delay milliseconds
    before releasing the key.

    \sa QTest::keyPress(), QTest::keyClick()
*/

/*! \fn void QTest::keyRelease(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
    \overload

    Simulates releasing a \a key with an optional \a modifier on a \a widget.
    If \a delay is larger than 0, the test will wait for \a delay milliseconds
    before releasing the key.

    \sa QTest::keyClick()
*/

/*! \fn void QTest::keyRelease(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
    \overload
    \since 5.0

    Simulates releasing a \a key with an optional \a modifier on a \a window.
    If \a delay is larger than 0, the test will wait for \a delay milliseconds
    before releasing the key.

    \sa QTest::keyPress(), QTest::keyClick()
*/

/*! \fn void QTest::keyRelease(QWindow *window, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
    \overload
    \since 5.0

    Simulates releasing a \a key with an optional \a modifier on a \a window.
    If \a delay is larger than 0, the test will wait for \a delay milliseconds
    before releasing the key.

    \sa QTest::keyClick()
*/

/*! \fn void QTest::keyClicks(QWidget *widget, const QString &sequence, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)

    Simulates clicking a \a sequence of keys on a \a
    widget. Optionally, a keyboard \a modifier can be specified as
    well as a \a delay (in milliseconds) of the test before each key
    click.

    Example:
    \snippet code/src_qtestlib_qtestcase_snippet.cpp 15

    The example above simulates clicking the sequence of keys
    representing "hello world" on \c myWidget without any keyboard
    modifiers and without delay of the test.

    \sa QTest::keyClick()
*/

/*! \fn void QTest::mousePress(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier, QPoint pos = QPoint(), int delay=-1)

    Simulates pressing a mouse \a button with an optional \a modifier
    on a \a widget.  The position is defined by \a pos; the default
    position is the center of the widget. If \a delay is specified,
    the test will wait for the specified amount of milliseconds before
    the press.

    \sa QTest::mouseRelease(), QTest::mouseClick()
*/

/*! \fn void QTest::mousePress(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos = QPoint(), int delay=-1)
    \overload
    \since 5.0

    Simulates pressing a mouse \a button with an optional \a stateKey modifier
    on a \a window.  The position is defined by \a pos; the default
    position is the center of the window. If \a delay is specified,
    the test will wait for the specified amount of milliseconds before
    the press.

    \sa QTest::mouseRelease(), QTest::mouseClick()
*/

/*! \fn void QTest::mouseRelease(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier, QPoint pos = QPoint(), int delay=-1)

    Simulates releasing a mouse \a button with an optional \a modifier
    on a \a widget.  The position of the release is defined by \a pos;
    the default position is the center of the widget. If \a delay is
    specified, the test will wait for the specified amount of
    milliseconds before releasing the button; otherwise, it will wait for a
    default amount of time (1 ms), which can be overridden via
    \l {Testing Options}{command-line arguments}.

    \note If you wish to test a double-click by sending events individually,
    specify a short delay, greater than the default, on both mouse release events.
    The total of the delays for the press, release, press and release must be
    less than QStyleHints::mouseDoubleClickInterval(). But if you don't need
    to check state between events, it's better to use QTest::mouseDClick().
    \snippet code/src_qtestlib_qtestcase_snippet.cpp 35

    \sa QTest::mousePress(), QTest::mouseClick()
*/

/*! \fn void QTest::mouseRelease(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos = QPoint(), int delay=-1)
    \overload
    \since 5.0

    Simulates releasing a mouse \a button with an optional \a stateKey modifier
    on a \a window.  The position of the release is defined by \a pos;
    the default position is the center of the window. If \a delay is
    specified, the test will wait for the specified amount of
    milliseconds before releasing the button; otherwise, it will wait for a
    default amount of time (1 ms), which can be overridden via
    \l {Testing Options}{command-line arguments}.

    \note If you wish to test a double-click by sending events individually,
    specify a short delay, greater than the default, on both mouse release events.
    The total of the delays for the press, release, press and release must be
    less than QStyleHints::mouseDoubleClickInterval(). But if you don't need
    to check state between events, it's better to use QTest::mouseDClick().
    \snippet code/src_qtestlib_qtestcase_snippet.cpp 35

    \sa QTest::mousePress(), QTest::mouseClick()
*/

/*! \fn void QTest::mouseClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier, QPoint pos = QPoint(), int delay=-1)

    Simulates clicking a mouse \a button with an optional \a modifier
    on a \a widget.  The position of the click is defined by \a pos;
    the default position is the center of the widget. If \a delay is
    specified, the test will wait for the specified amount of
    milliseconds before pressing and before releasing the button.

    \sa QTest::mousePress(), QTest::mouseRelease()
*/

/*! \fn void QTest::mouseClick(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos = QPoint(), int delay=-1)
    \overload
    \since 5.0

    Simulates clicking a mouse \a button with an optional \a stateKey modifier
    on a \a window.  The position of the click is defined by \a pos;
    the default position is the center of the window. If \a delay is
    specified, the test will wait for the specified amount of
    milliseconds before pressing and before releasing the button.

    \sa QTest::mousePress(), QTest::mouseRelease()
*/

/*! \fn void QTest::mouseDClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier, QPoint pos = QPoint(), int delay=-1)

    Simulates double clicking a mouse \a button with an optional \a
    modifier on a \a widget.  The position of the click is defined by
    \a pos; the default position is the center of the widget. If \a
    delay is specified, the test will wait for the specified amount of
    milliseconds before each press and release.

    \sa QTest::mouseClick()
*/

/*! \fn void QTest::mouseDClick(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos = QPoint(), int delay=-1)
    \overload
    \since 5.0

    Simulates double clicking a mouse \a button with an optional \a stateKey
    modifier on a \a window.  The position of the click is defined by
    \a pos; the default position is the center of the window. If \a
    delay is specified, the test will wait for the specified amount of
    milliseconds before each press and release.

    \sa QTest::mouseClick()
*/

/*! \fn void QTest::mouseMove(QWidget *widget, QPoint pos = QPoint(), int delay=-1)

    Moves the mouse pointer to a \a widget. If \a pos is not
    specified, the mouse pointer moves to the center of the widget. If
    a \a delay (in milliseconds) is given, the test will wait before
    moving the mouse pointer.
*/

/*! \fn void QTest::mouseMove(QWindow *window, QPoint pos = QPoint(), int delay=-1)
    \overload
    \since 5.0

    Moves the mouse pointer to a \a window. If \a pos is not
    specified, the mouse pointer moves to the center of the window. If
    a \a delay (in milliseconds) is given, the test will wait before
    moving the mouse pointer.
*/

/*! \fn void QTest::wheelEvent(QWindow *window, QPointF pos, QPoint angleDelta, QPoint pixelDelta = QPoint(0, 0), Qt::KeyboardModifiers stateKey = Qt::NoModifier, Qt::ScrollPhase phase = Qt::NoScrollPhase)
    \since 6.8

    Simulates a wheel event within \a window at position \a pos in local
    window coordinates. \a angleDelta contains the wheel rotation angle.
    A positive value means forward rotation, and a negative one means backward.
    \a pixelDelta contains the scrolling distance in pixels on screen. This value can be null.
    The keyboard states at the time of the event are specified by \a stateKey.
    The scrolling phase of the event is specified by \a phase.
*/

/*!
    \fn template <typename T1, typename T2> char *QTest::toString(const std::pair<T1, T2> &pair)
    \overload
    \since 5.11
    Returns a textual representation of the \a pair.
*/

/*!
    \fn char *QTest::toString(const QVector2D &v)
    \overload
    \since 5.11
    Returns a textual representation of the 2D vector \a v.
*/

/*!
    \fn char *QTest::toString(const QVector3D &v)
    \overload
    \since 5.11
    Returns a textual representation of the 3D vector \a v.
*/

/*!
    \fn char *QTest::toString(const QVector4D &v)
    \overload
    \since 5.11
    Returns a textual representation of the 4D vector \a v.
*/

/*!
    \fn template<typename T> char *QTest::toString(const T &value)

    Returns a textual representation of \a value. This function is used by
    \l QCOMPARE() to output verbose information in case of a test failure.

    You can add specializations or overloads of this function to your test to enable
    verbose output.

    \note Starting with Qt 5.5, you should prefer to provide a toString() function
    in the type's namespace instead of specializing this template.
    If your code needs to continue to work with the QTestLib from Qt 5.4 or
    earlier, you need to continue to use specialization.

    \note The caller of toString() must delete the returned data
    using \c{delete[]}.  Your implementation should return a string
    created with \c{new[]} or qstrdup(). The easiest way to do so is to
    create a QByteArray or QString and call QTest::toString() on it
    (see second example below).

    Example for specializing (Qt ≤ 5.4):

    \snippet code/src_qtestlib_qtestcase_snippet.cpp 16

    The example above defines a toString() specialization for a class
    called \c MyPoint. Whenever a comparison of two instances of \c
    MyPoint fails, \l QCOMPARE() will call this function to output the
    contents of \c MyPoint to the test log.

    Same example, but with overloading (Qt ≥ 5.5):

    \snippet code/src_qtestlib_qtestcase_snippet.cpp toString-overload

    \sa QCOMPARE()
*/

/*!
    \fn char *QTest::toString(const QLatin1StringView &string)
    \overload

    Returns a textual representation of the given \a string.
*/

/*!
    \fn char *QTest::toString(std::nullptr_t)
    \overload
    \since 5.8

    Returns a string containing \nullptr.
*/

/*!
    \fn char *QTest::toString(const QStringView &string)
    \overload
    \since 5.11

    Returns a textual representation of the given \a string.
*/

/*!
    \fn char *QTest::toString(const QUuid &uuid)
    \overload
    \since 5.11

    Returns a textual representation of the given \a uuid.
*/

/*!
    \fn char *QTest::toString(const QString &string)
    \overload

    Returns a textual representation of the given \a string.
*/

/*!
    \fn char *QTest::toString(const QByteArray &ba)
    \overload

    Returns a textual representation of the byte array \a ba.

    \sa QTest::toHexRepresentation()
*/

/*!
    \fn char *QTest::toString(const QCborError &c)
    \overload
    \since 5.12

    Returns a textual representation of the given CBOR error \a c.
*/

/*!
    \fn template <class... Types> char *QTest::toString(const std::tuple<Types...> &tuple)
    \overload
    \since 5.12

    Returns a textual representation of the given \a tuple.
*/

/*!
    \fn char *QTest::toString(const QTime &time)
    \overload

    Returns a textual representation of the given \a time.
*/

/*!
    \fn char *QTest::toString(const QDate &date)
    \overload

    Returns a textual representation of the given \a date.
*/

/*!
    \fn char *QTest::toString(const QDateTime &dateTime)
    \overload

    Returns a textual representation of the date and time specified by
    \a dateTime.
*/

/*!
    \fn char *QTest::toString(const QChar &character)
    \overload

    Returns a textual representation of the given \a character.
*/

/*!
    \fn char *QTest::toString(const QPoint &point)
    \overload

    Returns a textual representation of the given \a point.
*/

/*!
    \fn char *QTest::toString(const QSize &size)
    \overload

    Returns a textual representation of the given \a size.
*/

/*!
    \fn char *QTest::toString(const QRect &rectangle)
    \overload

    Returns a textual representation of the given \a rectangle.
*/

/*!
    \fn char *QTest::toString(const QUrl &url)
    \since 4.4
    \overload

    Returns a textual representation of the given \a url.
*/

/*!
    \fn char *QTest::toString(const QPointF &point)
    \overload

    Returns a textual representation of the given \a point.
*/

/*!
    \fn char *QTest::toString(const QSizeF &size)
    \overload

    Returns a textual representation of the given \a size.
*/

/*!
    \fn char *QTest::toString(const QRectF &rectangle)
    \overload

    Returns a textual representation of the given \a rectangle.
*/

/*!
    \fn char *QTest::toString(const QVariant &variant)
    \overload

    Returns a textual representation of the given \a variant.
*/

/*!
    \fn char *QTest::toString(QSizePolicy::ControlType ct)
    \overload
    \since 5.5

    Returns a textual representation of control type \a ct.
*/

/*!
    \fn char *QTest::toString(QSizePolicy::ControlTypes cts)
    \overload
    \since 5.5

    Returns a textual representation of control types \a cts.
*/

/*!
    \fn char *QTest::toString(QSizePolicy::Policy p)
    \overload
    \since 5.5

    Returns a textual representation of policy \a p.
*/

/*!
    \fn char *QTest::toString(QSizePolicy sp)
    \overload
    \since 5.5

    Returns a textual representation of size policy \a sp.
*/

/*!
    \fn char *QTest::toString(const QKeySequence &ks)
    \overload
    \since 6.5
    Returns a textual representation of the key sequence \a ks.
*/

/*!
    \fn QPointingDevice * QTest::createTouchDevice(QInputDevice::DeviceType devType = QInputDevice::DeviceType::TouchScreen, QInputDevice::Capabilities caps = QInputDevice::Capability::Position)
    \since 5.8

    Creates a dummy touch device of type \a devType with capabilities \a caps for
    simulation of touch events.

    The touch device will be registered with the Qt window system interface.
    You should typically use createTouchDevice() to initialize a QPointingDevice
    member variable in your test case class, use the same instance for all tests and
    delete it when no longer needed.

    \sa QTest::QTouchEventSequence, touchEvent()
*/

/*!
    \class QTest::QTouchEventSequence
    \inmodule QtTest
    \since 4.6

    \brief The QTouchEventSequence class is used to simulate a sequence of touch events.

    To simulate a sequence of touch events on a specific device for a window or widget, call
    QTest::touchEvent to create a QTouchEventSequence instance. Add touch events to
    the sequence by calling press(), move(), release() and stationary(), and let the
    instance run out of scope to commit the sequence to the event system.

    Example:
    \snippet code/src_qtestlib_qtestcase_snippet.cpp 25
*/

/*!
    \fn QTest::QTouchEventSequence::~QTouchEventSequence()

    Commits this sequence of touch events, unless autoCommit was disabled, and frees allocated resources.
*/

/*!
    \fn bool QTest::QTouchEventSequence::commit(bool processEvents)

    Commits this touch event to the event system, and returns whether it was
    accepted after delivery.

    Normally there is no need to call this function because it is called from
    the destructor. However, if autoCommit is disabled, the events only get
    committed upon explicitly calling this function. Another reason to call it
    explicitly is to check the return value.

    In special cases, tests may want to disable the processing of the event.
    This can be achieved by setting \a processEvents to false. This results in
    merely queuing the event: the event loop will not be forced to process it.

    Returns whether the event was accepted after delivery.
*/

/*!
    \fn QTouchEventSequence &QTest::QTouchEventSequence::press(int touchId, const QPoint &pt, QWindow *window)
    \since 5.0

    Adds a press event for touchpoint \a touchId at position \a pt to this sequence and returns
    a reference to this QTouchEventSequence.

    The position \a pt is interpreted as relative to \a window. If \a window is the null pointer, then
    \a pt is interpreted as relative to the window provided when instantiating this QTouchEventSequence.

    Simulates that the user pressed the touch screen or pad with the finger identified by \a touchId.
*/

/*!
    \fn QTouchEventWidgetSequence &QTest::QTouchEventWidgetSequence::press(int touchId, const QPoint &pt, QWidget *widget)

    Adds a press event for touchpoint \a touchId at position \a pt to this sequence and returns
    a reference to this QTouchEventWidgetSequence.

    The position \a pt is interpreted as relative to \a widget. If \a widget is the null pointer, then
    \a pt is interpreted as relative to the widget provided when instantiating this QTouchEventWidgetSequence.

    Simulates that the user pressed the touch screen or pad with the finger identified by \a touchId.
*/

/*!
    \fn QTouchEventSequence &QTest::QTouchEventSequence::move(int touchId, const QPoint &pt, QWindow *window)
    \since 5.0

    Adds a move event for touchpoint \a touchId at position \a pt to this sequence and returns
    a reference to this QTouchEventSequence.

    The position \a pt is interpreted as relative to \a window. If \a window is the null pointer, then
    \a pt is interpreted as relative to the window provided when instantiating this QTouchEventSequence.

    Simulates that the user moved the finger identified by \a touchId.
*/

/*!
    \fn QTouchEventWidgetSequence &QTest::QTouchEventWidgetSequence::move(int touchId, const QPoint &pt, QWidget *widget)

    Adds a move event for touchpoint \a touchId at position \a pt to this sequence and returns
    a reference to this QTouchEventWidgetSequence.

    The position \a pt is interpreted as relative to \a widget. If \a widget is the null pointer, then
    \a pt is interpreted as relative to the widget provided when instantiating this QTouchEventWidgetSequence.

    Simulates that the user moved the finger identified by \a touchId.
*/

/*!
    \fn QTouchEventSequence &QTest::QTouchEventSequence::release(int touchId, const QPoint &pt, QWindow *window)
    \since 5.0

    Adds a release event for touchpoint \a touchId at position \a pt to this sequence and returns
    a reference to this QTouchEventSequence.

    The position \a pt is interpreted as relative to \a window. If \a window is the null pointer, then
    \a pt is interpreted as relative to the window provided when instantiating this QTouchEventSequence.

    Simulates that the user lifted the finger identified by \a touchId.
*/

/*!
    \fn QTouchEventWidgetSequence &QTest::QTouchEventWidgetSequence::release(int touchId, const QPoint &pt, QWidget *widget)

    Adds a release event for touchpoint \a touchId at position \a pt to this sequence and returns
    a reference to this QTouchEventWidgetSequence.

    The position \a pt is interpreted as relative to \a widget. If \a widget is the null pointer, then
    \a pt is interpreted as relative to the widget provided when instantiating this QTouchEventWidgetSequence.

    Simulates that the user lifted the finger identified by \a touchId.
*/

/*!
    \fn QTouchEventSequence &QTest::QTouchEventSequence::stationary(int touchId)

    Adds a stationary event for touchpoint \a touchId to this sequence and returns
    a reference to this QTouchEventSequence.

    Simulates that the user did not move the finger identified by \a touchId.
*/

/*!
    \fn QTouchEventSequence QTest::touchEvent(QWindow *window, QPointingDevice *device, bool autoCommit)
    \since 5.0

    Creates and returns a QTouchEventSequence for the \a device to
    simulate events for \a window.

    When adding touch events to the sequence, \a window will also be used to translate
    the position provided to screen coordinates, unless another window is provided in the
    respective calls to press(), move() etc.

    The touch events are committed to the event system when the destructor of the
    QTouchEventSequence is called (ie when the object returned runs out of scope), unless
    \a autoCommit is set to false. When \a autoCommit is false, commit() has to be called
    manually.

    \l createTouchDevice() can be called to create a test touch device for use with this
    function.
*/

/*!
    \fn QTouchEventSequence QTest::touchEvent(QWidget *widget, QPointingDevice *device, bool autoCommit)

    Creates and returns a QTouchEventSequence for the \a device to
    simulate events for \a widget.

    When adding touch events to the sequence, \a widget will also be used to translate
    the position provided to screen coordinates, unless another widget is provided in the
    respective calls to press(), move() etc.

    The touch events are committed to the event system when the destructor of the
    QTouchEventSequence is called (ie when the object returned runs out of scope), unless
    \a autoCommit is set to false. When \a autoCommit is false, commit() has to be called
    manually.

    \l createTouchDevice() can be called to create a test touch device for use with this
    function.
*/

// Internals of qtestmouse.h:

/*! \fn void QTest::mouseEvent(MouseAction action, QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
    \internal
*/

/*! \fn void QTest::mouseEvent(MouseAction action, QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
    \internal
*/