Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
quicktest.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QUICKTEST_H
5#define QUICKTEST_H
6
7#include <QtQuickTest/quicktestglobal.h>
8#include <QtTest/qtest.h>
9
11
12class QQuickItem;
13class QQuickWindow;
14
15Q_QMLTEST_EXPORT int quick_test_main(int argc, char **argv, const char *name, const char *sourceDir);
16Q_QMLTEST_EXPORT int quick_test_main_with_setup(int argc, char **argv, const char *name, const char *sourceDir, QObject *setup);
17
18#ifdef QUICK_TEST_SOURCE_DIR
19
20#define QUICK_TEST_MAIN(name) \
21 int main(int argc, char **argv) \
22 { \
23 QTEST_SET_MAIN_SOURCE_PATH \
24 return quick_test_main(argc, argv, #name, QUICK_TEST_SOURCE_DIR); \
25 }
26
27#define QUICK_TEST_OPENGL_MAIN(name) \
28 int main(int argc, char **argv) \
29 { \
30 QTEST_SET_MAIN_SOURCE_PATH \
31 return quick_test_main(argc, argv, #name, QUICK_TEST_SOURCE_DIR); \
32 }
33
34#define QUICK_TEST_MAIN_WITH_SETUP(name, QuickTestSetupClass) \
35 int main(int argc, char **argv) \
36 { \
37 QTEST_SET_MAIN_SOURCE_PATH \
38 QuickTestSetupClass setup; \
39 return quick_test_main_with_setup(argc, argv, #name, QUICK_TEST_SOURCE_DIR, &setup); \
40 }
41
42#else
43
44#define QUICK_TEST_MAIN(name) \
45 int main(int argc, char **argv) \
46 { \
47 QTEST_SET_MAIN_SOURCE_PATH \
48 return quick_test_main(argc, argv, #name, nullptr); \
49 }
50
51#define QUICK_TEST_OPENGL_MAIN(name) \
52 int main(int argc, char **argv) \
53 { \
54 QTEST_SET_MAIN_SOURCE_PATH \
55 return quick_test_main(argc, argv, #name, nullptr); \
56 }
57
58#define QUICK_TEST_MAIN_WITH_SETUP(name, QuickTestSetupClass) \
59 int main(int argc, char **argv) \
60 { \
61 QTEST_SET_MAIN_SOURCE_PATH \
62 QuickTestSetupClass setup; \
63 return quick_test_main_with_setup(argc, argv, #name, nullptr, &setup); \
64 }
65
66#endif
67
68namespace QQuickTest {
69static const int defaultTimeout = 5000;
70
71Q_QMLTEST_EXPORT bool qIsPolishScheduled(const QQuickItem *item);
72Q_QMLTEST_EXPORT bool qIsPolishScheduled(const QQuickWindow *window);
73
74#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
75#if QT_DEPRECATED_SINCE(6, 4)
76 QT_DEPRECATED_X("Use qWaitForPolish(QQuickItem *) instead")
77 Q_QMLTEST_EXPORT bool qWaitForItemPolished(const QQuickItem *item, int timeout = defaultTimeout);
78#endif
79#endif
80Q_QMLTEST_EXPORT bool qWaitForPolish(const QQuickItem *item, int timeout = defaultTimeout);
81Q_QMLTEST_EXPORT bool qWaitForPolish(const QQuickWindow *window, int timeout = defaultTimeout);
82}
83
85
86#endif
\inmodule QtCore
Definition qobject.h:103
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
Q_QMLTEST_EXPORT bool qWaitForPolish(const QQuickItem *item, int timeout=defaultTimeout)
Q_QMLTEST_EXPORT bool qIsPolishScheduled(const QQuickItem *item)
Definition quicktest.cpp:76
static const int defaultTimeout
Definition quicktest.h:69
Combined button and popup list for selecting options.
GLbitfield GLuint64 timeout
[4]
GLuint name
#define QT_DEPRECATED_X(text)
Q_QMLTEST_EXPORT int quick_test_main_with_setup(int argc, char **argv, const char *name, const char *sourceDir, QObject *setup)
Q_QMLTEST_EXPORT int quick_test_main(int argc, char **argv, const char *name, const char *sourceDir)
QGraphicsItem * item
aWidget window() -> setWindowTitle("New Window Title")
[2]