aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/imports/testlib/TestCase.qml37
-rw-r--r--src/imports/testlib/toucheventsequence.qdoc6
-rw-r--r--src/qmltest/doc/qtqmltest.qdocconf22
-rw-r--r--src/qmltest/doc/snippets/src_qmltest_qquicktest.cpp81
-rw-r--r--src/qmltest/doc/src/qtquicktest-cppapi.qdoc59
-rw-r--r--src/qmltest/doc/src/qtquicktest-index.qdoc48
-rw-r--r--src/qmltest/doc/src/qtquicktest-qmltypes.qdoc46
-rw-r--r--src/qmltest/doc/src/qtquicktest.qdoc79
-rw-r--r--src/qmltest/quicktest.cpp14
-rw-r--r--src/quick/doc/src/qmltypereference.qdoc16
10 files changed, 318 insertions, 90 deletions
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index fd61c042ca..4dee4162be 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -919,12 +919,12 @@ Item {
Additionally, the returned image object has the following methods:
\list
- \li red(x, y) Returns the red channel value of the pixel at \a x, \a y position
- \li green(x, y) Returns the green channel value of the pixel at \a x, \a y position
- \li blue(x, y) Returns the blue channel value of the pixel at \a x, \a y position
- \li alpha(x, y) Returns the alpha channel value of the pixel at \a x, \a y position
- \li pixel(x, y) Returns the color value of the pixel at \a x, \a y position
- \li equals(image) Returns \c true if this image is identical to \a image -
+ \li \c {red(x, y)} Returns the red channel value of the pixel at \e x, \e y position
+ \li \c {green(x, y)} Returns the green channel value of the pixel at \e x, \e y position
+ \li \c {blue(x, y)} Returns the blue channel value of the pixel at \e x, \e y position
+ \li \c {alpha(x, y)} Returns the alpha channel value of the pixel at \e x, \e y position
+ \li \c {pixel(x, y)} Returns the color value of the pixel at \e x, \e y position
+ \li \c {equals(image)} Returns \c true if this image is identical to \e image -
see \l QImage::operator== (since 5.6)
For example:
@@ -938,7 +938,8 @@ Item {
var newImage = grabImage(rect);
verify(!newImage.equals(image));
\endcode
- \li save(path) Saves the image to the given \a path. If the image cannot
+
+ \li \c {save(path)} Saves the image to the given \e path. If the image cannot
be saved, an exception will be thrown. (since 5.10)
This can be useful to perform postmortem analysis on failing tests, for
@@ -955,8 +956,6 @@ Item {
\endcode
\endlist
-
- \sa
*/
function grabImage(item) {
return qtest_results.grabImage(item);
@@ -1221,7 +1220,7 @@ Item {
/*!
\qmlmethod TestCase::keyPress(key, modifiers = Qt.NoModifier, delay = -1)
- Simulates pressing a \a key with an optional \a modifier on the currently
+ Simulates pressing a \a key with optional \a modifiers on the currently
focused item. If \a delay is larger than 0, the test will wait for
\a delay milliseconds.
@@ -1249,7 +1248,7 @@ Item {
/*!
\qmlmethod TestCase::keyRelease(key, modifiers = Qt.NoModifier, delay = -1)
- Simulates releasing a \a key with an optional \a modifier on the currently
+ Simulates releasing a \a key with optional \a modifiers on the currently
focused item. If \a delay is larger than 0, the test will wait for
\a delay milliseconds.
@@ -1275,7 +1274,7 @@ Item {
/*!
\qmlmethod TestCase::keyClick(key, modifiers = Qt.NoModifier, delay = -1)
- Simulates clicking of \a key with an optional \a modifier on the currently
+ Simulates clicking of \a key with optional \a modifiers on the currently
focused item. If \a delay is larger than 0, the test will wait for
\a delay milliseconds.
@@ -1321,7 +1320,7 @@ Item {
/*!
\qmlmethod TestCase::mousePress(item, x = item.width / 2, y = item.height / 2, button = Qt.LeftButton, modifiers = Qt.NoModifier, delay = -1)
- Simulates pressing a mouse \a button with an optional \a modifier
+ Simulates pressing a mouse \a button with optional \a modifiers
on an \a item. The position is defined by \a x and \a y.
If \a x or \a y are not defined the position will be the center of \a item.
If \a delay is specified, the test will wait for the specified amount of
@@ -1355,7 +1354,7 @@ Item {
/*!
\qmlmethod TestCase::mouseRelease(item, x = item.width / 2, y = item.height / 2, button = Qt.LeftButton, modifiers = Qt.NoModifier, delay = -1)
- Simulates releasing a mouse \a button with an optional \a modifier
+ Simulates releasing a mouse \a button with optional \a modifiers
on an \a item. The position of the release is defined by \a x and \a y.
If \a x or \a y are not defined the position will be the center of \a item.
If \a delay is specified, the test will wait for the specified amount of
@@ -1389,7 +1388,7 @@ Item {
/*!
\qmlmethod TestCase::mouseDrag(item, x, y, dx, dy, button = Qt.LeftButton, modifiers = Qt.NoModifier, delay = -1)
- Simulates dragging the mouse on an \a item with \a button pressed and an optional \a modifier.
+ Simulates dragging the mouse on an \a item with \a button pressed and optional \a modifiers
The initial drag position is defined by \a x and \a y,
and drag distance is defined by \a dx and \a dy. If \a delay is specified,
the test will wait for the specified amount of milliseconds before releasing the button.
@@ -1442,7 +1441,7 @@ Item {
/*!
\qmlmethod TestCase::mouseClick(item, x = item.width / 2, y = item.height / 2, button = Qt.LeftButton, modifiers = Qt.NoModifier, delay = -1)
- Simulates clicking a mouse \a button with an optional \a modifier
+ Simulates clicking a mouse \a button with optional \a modifiers
on an \a item. The position of the click is defined by \a x and \a y.
If \a x and \a y are not defined the position will be the center of \a item.
If \a delay is specified, the test will wait for the specified amount of
@@ -1476,7 +1475,7 @@ Item {
/*!
\qmlmethod TestCase::mouseDoubleClick(item, x = item.width / 2, y = item.height / 2, button = Qt.LeftButton, modifiers = Qt.NoModifier, delay = -1)
- Simulates double-clicking a mouse \a button with an optional \a modifier
+ Simulates double-clicking a mouse \a button with optional \a modifiers
on an \a item. The position of the click is defined by \a x and \a y.
If \a x and \a y are not defined the position will be the center of \a item.
If \a delay is specified, the test will wait for the specified amount of
@@ -1511,7 +1510,7 @@ Item {
\qmlmethod TestCase::mouseDoubleClickSequence(item, x = item.width / 2, y = item.height / 2, button = Qt.LeftButton, modifiers = Qt.NoModifier, delay = -1)
Simulates the full sequence of events generated by double-clicking a mouse
- \a button with an optional \a modifier on an \a item.
+ \a button with optional \a modifiers on an \a item.
This method reproduces the sequence of mouse events generated when a user makes
a double click: Press-Release-Press-DoubleClick-Release.
@@ -1577,7 +1576,7 @@ Item {
/*!
\qmlmethod TestCase::mouseWheel(item, x, y, xDelta, yDelta, button = Qt.LeftButton, modifiers = Qt.NoModifier, delay = -1)
- Simulates rotating the mouse wheel on an \a item with \a button pressed and an optional \a modifier.
+ Simulates rotating the mouse wheel on an \a item with \a button pressed and optional \a modifiers.
The position of the wheel event is defined by \a x and \a y.
If \a delay is specified, the test will wait for the specified amount of milliseconds before releasing the button.
diff --git a/src/imports/testlib/toucheventsequence.qdoc b/src/imports/testlib/toucheventsequence.qdoc
index d7cc48c5dd..6f1f3f8863 100644
--- a/src/imports/testlib/toucheventsequence.qdoc
+++ b/src/imports/testlib/toucheventsequence.qdoc
@@ -57,7 +57,7 @@
/*!
\qmlmethod TouchEventSequence TouchEventSequence::press(int touchId, object item, real x = item.width / 2, real y = item.height / 2)
- Creates a new point identified as \a touchId, at the point indicated by \a x and \a y relative to \a item.
+ Creates a new point identified as \a touchId, at the point indicated by \e x and \e y relative to \a item.
Further use of the same touch point should maintain the same touchId.
Item defaults to the value provided via touchEvent().
@@ -67,7 +67,7 @@
/*!
\qmlmethod TouchEventSequence TouchEventSequence::move(int touchId, object item, real x = item.width / 2, real y = item.height / 2)
- Moves \a touchId to the point indicated by \a x and \a y relative to \a item.
+ Moves \a touchId to the point indicated by \e x and \e y relative to \a item.
Item defaults to the value provided via touchEvent().
X and y default to the midpoint of the item.
@@ -76,7 +76,7 @@
/*!
\qmlmethod TouchEventSequence TouchEventSequence::release(int touchId, object item, real x = item.width / 2, real y = item.height / 2)
- Removes \a touchId at the point indicated by \a x and \a y relative to \a item.
+ Removes \a touchId at the point indicated by \e x and \e y relative to \a item.
Item defaults to the value provided via touchEvent().
X and y default to the midpoint of the item.
diff --git a/src/qmltest/doc/qtqmltest.qdocconf b/src/qmltest/doc/qtqmltest.qdocconf
index a819546fba..9a3e16b64d 100644
--- a/src/qmltest/doc/qtqmltest.qdocconf
+++ b/src/qmltest/doc/qtqmltest.qdocconf
@@ -15,28 +15,28 @@ qhp.QtQmlTest.indexRoot =
qhp.QtQmlTest.filterAttributes = qtqmltest $QT_VERSION qtrefdoc
qhp.QtQmlTest.customFilters.Qt.name = QtQmlTest $QT_VERSION
qhp.QtQmlTest.customFilters.Qt.filterAttributes = qtqmltest $QT_VERSION
-qhp.QtQmlTest.subprojects = qmltypes classes examples
-qhp.QtQmlTest.subprojects.classes.title = C++ Classes
-qhp.QtQmlTest.subprojects.classes.indexTitle = Qt Quick Test C++ Classes
-qhp.QtQmlTest.subprojects.classes.selectors = class doc:headerfile
+
+qhp.QtQmlTest.subprojects = qmltypes classes
+qhp.QtQmlTest.subprojects.classes.title = C++ API
+qhp.QtQmlTest.subprojects.classes.indexTitle = Qt Quick Test C++ API
+qhp.QtQmlTest.subprojects.classes.selectors = class namespace doc:headerfile
qhp.QtQmlTest.subprojects.classes.sortPages = true
-qhp.QtQmlTest.subprojects.examples.title = Examples
-qhp.QtQmlTest.subprojects.examples.indexTitle = Qt Quick Test Examples
-qhp.QtQmlTest.subprojects.examples.selectors = doc:example
qhp.QtQmlTest.subprojects.qmltypes.title = QML Types
qhp.QtQmlTest.subprojects.qmltypes.indexTitle = Qt Quick Test QML Types
qhp.QtQmlTest.subprojects.qmltypes.selectors = qmlclass
qhp.QtQmlTest.subprojects.qmltypes.sortPages = true
-
-tagfile = ../../../doc/qtqmltest/qtqmltest.tags
+tagfile = qtqmltest.tags
depends += qtcore qtgui qttestlib qtqml qtquick qtdoc
headerdirs += ..
-sourcedirs += ..
+sourcedirs += .. \
+ ../../imports/testlib
+
+exampledirs += snippets
navigation.landingpage = "Qt Quick Test"
-navigation.cppclassespage = "Qt Quick Test C++ Classes"
+navigation.cppclassespage = "Qt Quick Test C++ API"
navigation.qmltypespage = "Qt Quick Test QML Types"
diff --git a/src/qmltest/doc/snippets/src_qmltest_qquicktest.cpp b/src/qmltest/doc/snippets/src_qmltest_qquicktest.cpp
new file mode 100644
index 0000000000..191f693a9a
--- /dev/null
+++ b/src/qmltest/doc/snippets/src_qmltest_qquicktest.cpp
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [1]
+//! [0]
+#include <QtQuickTest>
+//! [0]
+QUICK_TEST_MAIN(example)
+//! [1]
+
+//! [2]
+// tst_mytest.cpp
+#include <QtQuickTest>
+#include <QQmlEngine>
+#include <QQmlContext>
+
+class Setup : public QObject
+{
+ Q_OBJECT
+
+public:
+ Setup() {}
+
+public slots:
+ void qmlEngineAvailable(QQmlEngine *engine)
+ {
+ engine->rootContext()->setContextProperty("myContextProperty", QVariant(true));
+ }
+};
+
+QUICK_TEST_MAIN_WITH_SETUP(mytest, Setup)
+
+#include "tst_mytest.moc"
+//! [2]
diff --git a/src/qmltest/doc/src/qtquicktest-cppapi.qdoc b/src/qmltest/doc/src/qtquicktest-cppapi.qdoc
new file mode 100644
index 0000000000..0e5dab8887
--- /dev/null
+++ b/src/qmltest/doc/src/qtquicktest-cppapi.qdoc
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \module QtQuickTest
+ \keyword Qt Quick Test C++ API
+ \title Qt Quick Test C++ API
+ \ingroup modules
+
+ \brief Provides macros and functions for tests.
+
+ The C++ macros and functions can be included into your application using
+ the following include statement:
+
+ \snippet src_qmltest_qquicktest.cpp 0
+
+ There are two ways to link against the corresponding C++ library. If your
+ test project uses a QML \l TestCase, you should already have the following
+ line in your project file:
+
+ \badcode
+ CONFIG += qmltestcase
+ \endcode
+
+ This will cause the test to link to the C++ \QtQuickTest library.
+
+ If you have a C++-only test project, you can add the following line
+ to your project file:
+
+ \badcode
+ QT += qmltest
+ \endcode
+
+ \sa {Executing C++ Before QML Tests}
+*/
diff --git a/src/qmltest/doc/src/qtquicktest-index.qdoc b/src/qmltest/doc/src/qtquicktest-index.qdoc
index 48b41d4f0a..283e88e2e4 100644
--- a/src/qmltest/doc/src/qtquicktest-index.qdoc
+++ b/src/qmltest/doc/src/qtquicktest-index.qdoc
@@ -30,6 +30,7 @@
\title Qt Quick Test
\brief Unit testing framework for QML.
+ \target Introduction to Qt Quick Test
\section1 Introduction
\l {Qt Quick Test QML Types}{Qt Quick Test} is a unit test framework for QML applications.
@@ -62,15 +63,13 @@
only guaranteed to work with the Qt version it was developed against.
However, source compatibility is guaranteed.
+ \target Running Qt Quick Tests
\section1 Running Tests
Test cases are launched by a C++ harness that consists of
the following code:
- \code
- #include <QtQuickTest/quicktest.h>
- QUICK_TEST_MAIN(example)
- \endcode
+ \snippet src_qmltest_qquicktest.cpp 1
Where "example" is the identifier to use to uniquely identify
this set of tests. Finally, add \c{CONFIG += qmltestcase} to the project
@@ -139,7 +138,7 @@
\section1 Executing C++ Before QML Tests
To execute C++ code before any of the QML tests are run, the
- \c QUICK_TEST_MAIN_WITH_SETUP macro can be used. This can be useful for
+ \l QUICK_TEST_MAIN_WITH_SETUP macro can be used. This can be useful for
setting context properties on the QML engine, amongst other things.
The macro is identical to \l QUICK_TEST_MAIN, except that it takes an
@@ -151,53 +150,31 @@
\li Name
\li Purpose
\row
- \li void applicationAvailable()
+ \li \c {void applicationAvailable()}
\li Called right after the QApplication object was instantiated.
Use this function to setup everything that is not related
to QML directly.
\row
- \li void qmlEngineAvailable(QQmlEngine*)
+ \li \c {void qmlEngineAvailable(QQmlEngine *)}
\li Called when the QML engine is available.
Any \l {QQmlEngine::addImportPath}{import paths},
\l {QQmlEngine::addPluginPath}{plugin paths},
and \l {QQmlFileSelector::setExtraSelectors}{extra file selectors}
will have been set on the engine by this point.
\row
- \li void cleanupTestCase()
+ \li \c {void cleanupTestCase()}
\li Called right after the test execution has finished.
Use this function to clean up before everything will start to be destructed.
\endtable
- Each function will be called once for each \c tst_*.qml file, so any
+ Each function will be called once for each \c {tst_*.qml} file, so any
arguments are unique to that test. For example, this means that each QML
test file will have its own QML engine.
The following example demonstrates how the macro can be used to set context
properties on the QML engine:
- \code
- #include <QtQuickTest>
- #include <QQmlEngine>
- #include <QQmlContext>
-
- class Setup : public QObject
- {
- Q_OBJECT
-
- public:
- Setup() {}
-
- public slots:
- void qmlEngineAvailable(QQmlEngine *engine)
- {
- engine->rootContext()->setContextProperty("myContextProperty", QVariant(true));
- }
- };
-
- QUICK_TEST_MAIN_WITH_SETUP(mytest, Setup)
-
- #include "tst_mytest.moc"
- \endcode
+ \snippet src_qmltest_qquicktest.cpp 2
The \c .moc include is based on the file name of the \c .cpp file.
For example, in the example above, the \c .cpp file is named
@@ -208,6 +185,13 @@
#include "MyTest.moc"
\endcode
+ \section1 Reference
+
+ \list
+ \li \l{Qt Quick Test QML Types}{QML Types}
+ \li \l{Qt Quick Test C++ API}{C++ API}
+ \endlist
+
\section1 Licenses
Qt Quick Tests is available under commercial licenses from \l{The Qt Company}.
diff --git a/src/qmltest/doc/src/qtquicktest-qmltypes.qdoc b/src/qmltest/doc/src/qtquicktest-qmltypes.qdoc
new file mode 100644
index 0000000000..0ed8c6faa0
--- /dev/null
+++ b/src/qmltest/doc/src/qtquicktest-qmltypes.qdoc
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \qmlmodule QtTest 1.\QtMinorVersion
+ \title Qt Quick Test QML Types
+ \brief Provides QML types to unit test your QML application.
+ \ingroup qmlmodules
+
+ You can import this module using the following statement:
+
+ \qml \QtMinorVersion
+ import QtTest 1.\1
+ \endqml
+
+ \section1 QML Types
+ \generatelist {qmltypesbymodule QtTest}
+ \noautolist
+
+ For more information about how to use these types, see
+ \l{Qt Quick Test}.
+*/
diff --git a/src/qmltest/doc/src/qtquicktest.qdoc b/src/qmltest/doc/src/qtquicktest.qdoc
new file mode 100644
index 0000000000..31c097ed76
--- /dev/null
+++ b/src/qmltest/doc/src/qtquicktest.qdoc
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \namespace QQuickTest
+ \inmodule QtQuickTest
+
+ \brief The QQuickTest namespace contains all the functions and
+ macros related to Qt Quick Test.
+
+ See the \l{Introduction to Qt Quick Test} for information about how to write
+ Qt Quick unit tests.
+
+ To link to the Qt Quick Test C++ library, see \l {Qt Quick Test C++ API}.
+
+ \sa {Executing C++ Before QML Tests}
+*/
+
+/*!
+ \macro QUICK_TEST_MAIN(name)
+ \relates QQuickTest
+
+ \brief Sets up the entry point for a Qt Quick Test application.
+ The \a name argument uniquely identifies this set of tests.
+
+ \snippet src_qmltest_qquicktest.cpp 1
+
+ \note The macro assumes that your test sources are in the current
+ directory, unless the \c QUICK_TEST_SOURCE_DIR environment variable is set.
+
+ \sa QUICK_TEST_MAIN_WITH_SETUP(), {Running Qt Quick Tests}
+
+*/
+
+/*!
+ \macro QUICK_TEST_MAIN_WITH_SETUP(name, QuickTestSetupClass)
+ \relates QQuickTest
+
+ \brief Sets up the entry point for a Qt Quick Test application.
+ The \a name argument uniquely identifies this set of tests.
+
+ This macro is identical to QUICK_TEST_MAIN(), except that it takes an
+ additional argument \a QuickTestSetupClass, a pointer to a QObject-derived
+ class. With this class it is possible to define additional setup code to
+ execute before running the QML test.
+
+ \note The macro assumes that your test sources are in the current
+ directory, unless the \c QUICK_TEST_SOURCE_DIR environment variable is set.
+
+ The following snippet demonstrates the use of this macro:
+
+ \snippet src_qmltest_qquicktest.cpp 2
+
+ \sa QUICK_TEST_MAIN(), {Running Qt Quick Tests}
+*/
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp
index 8803075284..1e25656048 100644
--- a/src/qmltest/quicktest.cpp
+++ b/src/qmltest/quicktest.cpp
@@ -77,8 +77,6 @@
QT_BEGIN_NAMESPACE
/*!
- \fn bool qIsPolishScheduled(const QQuickItem *item)
- \relates QtQuickTest
\since 5.13
Returns \c true if \l {QQuickItem::}{updatePolish()} has not been called
@@ -103,6 +101,9 @@ QT_BEGIN_NAMESPACE
makes it obvious why an item wasn't polished and allows tests to
fail early under such circumstances.
+ The QML equivalent of this function is
+ \l {TestCase::}{isPolishScheduled()}.
+
\sa QQuickItem::polish(), QQuickItem::updatePolish()
*/
bool QQuickTest::qIsPolishScheduled(const QQuickItem *item)
@@ -111,8 +112,6 @@ bool QQuickTest::qIsPolishScheduled(const QQuickItem *item)
}
/*!
- \fn bool qWaitForItemPolished(const QQuickItem *item, int timeout = 5000)
- \relates QtQuickTest
\since 5.13
Waits for \a timeout milliseconds or until
@@ -121,11 +120,8 @@ bool QQuickTest::qIsPolishScheduled(const QQuickItem *item)
Returns \c true if \c updatePolish() was called on \a item within
\a timeout milliseconds, otherwise returns \c false.
- To use this function, add the following line to your test's \c .pro file:
-
- \code
- QT += qmltest
- \endcode
+ The QML equivalent of this function is
+ \l {TestCase::}{waitForItemPolished()}.
\sa QQuickItem::polish(), QQuickItem::updatePolish(),
QQuickTest::qIsPolishScheduled()
diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc
index ddf90f88d9..f921d42dab 100644
--- a/src/quick/doc/src/qmltypereference.qdoc
+++ b/src/quick/doc/src/qmltypereference.qdoc
@@ -887,19 +887,3 @@ console.log(c + " " + d); // false true
\sa {QML Basic Types}
*/
-
-/*!
-\qmlmodule QtTest 1.\QtMinorVersion
-\title Qt Quick Test QML Types
-\brief This module provides QML types to unit test your QML application
-\ingroup qmlmodules
-
-You can import this module using the following statement:
-
-\qml \QtMinorVersion
-import QtTest 1.\1
-\endqml
-
-For more information about how to use these types, see
-\l{Qt Quick Test}.
-*/