summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2018-12-12 12:36:39 +0100
committerTopi Reiniƶ <topi.reinio@qt.io>2019-01-04 12:16:56 +0000
commit3b03150aa2af76b13424c988c6c7892d19cce6c5 (patch)
tree741a11a9e6ec9c5a456a16987ae9a42778fecc66 /src
parent17fe5fc128541553b1eda719d47221763959f8b6 (diff)
Doc: Restore documentation for QTest functions in other modules
Qt Test library sources specific to Core, GUI and Widgets modules were moved around in commit 88867e39b. The new source locations must be referenced in Qt Test documentation configuration. The same sources are excluded in their original doc projects, and the related snippet file is moved over to qttestlib. The commit also fixes the remaining documentation issues for Qt Test. Change-Id: Ibe011aa83639e574d647f12bc9e53e618781bce6 Reviewed-by: Martin Smith <martin.smith@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/doc/qtcore.qdocconf3
-rw-r--r--src/corelib/kernel/qtestsupport_core.cpp6
-rw-r--r--src/gui/doc/qtgui.qdocconf5
-rw-r--r--src/gui/kernel/qtestsupport_gui.cpp10
-rw-r--r--src/testlib/doc/qttestlib.qdocconf8
-rw-r--r--src/testlib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp (renamed from src/corelib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp)0
-rw-r--r--src/testlib/qtestcase.qdoc22
-rw-r--r--src/widgets/doc/qtwidgets.qdocconf3
-rw-r--r--src/widgets/kernel/qtestsupport_widgets.cpp17
9 files changed, 54 insertions, 20 deletions
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index 5a42e21845..85dcde4607 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -45,6 +45,9 @@ excludedirs += snippets
excludefiles += ../../../examples/widgets/tools/customcompleter/doc/src/customcompleter.qdoc \
../../../examples/widgets/tools/codecs/doc/src/codecs.qdoc
+# Included in qttestlib.qdocconf instead
+excludefiles += ../kernel/qtestsupport_core.cpp
+
manifestmeta.highlighted.names = "QtCore/JSON Save Game Example" \
"QtCore/Local Fortune*"
diff --git a/src/corelib/kernel/qtestsupport_core.cpp b/src/corelib/kernel/qtestsupport_core.cpp
index d69551a227..aba2a136a1 100644
--- a/src/corelib/kernel/qtestsupport_core.cpp
+++ b/src/corelib/kernel/qtestsupport_core.cpp
@@ -59,8 +59,7 @@ Q_CORE_EXPORT void QTestPrivate::qSleep(int ms)
#endif
}
-/*! \fn template <typename Functor> bool qWaitFor(Functor predicate, int timeout)
- \relates QTest
+/*! \fn template <typename Functor> bool QTest::qWaitFor(Functor predicate, int timeout)
Waits for \a timeout milliseconds or until the \a predicate returns true.
@@ -77,8 +76,7 @@ Q_CORE_EXPORT void QTestPrivate::qSleep(int ms)
*/
-/*! \fn void qWait(int ms)
- \relates QTest
+/*! \fn void QTest::qWait(int ms)
Waits for \a ms milliseconds. While waiting, events will be processed and
your test will stay responsive to user interface events or network communication.
diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf
index e546c817a7..b8b8a00cd6 100644
--- a/src/gui/doc/qtgui.qdocconf
+++ b/src/gui/doc/qtgui.qdocconf
@@ -54,7 +54,10 @@ exampledirs += ../../../examples/gui \
imagedirs += images \
../../../examples/gui/doc/images \
- ../../../doc/src/images \
+ ../../../doc/src/images
+
+# Included in qttestlib.qdocconf instead
+excludefiles += ../kernel/qtestsupport_gui.cpp
manifestmeta.highlighted.names = "QtGui/Analog Clock Window Example"
diff --git a/src/gui/kernel/qtestsupport_gui.cpp b/src/gui/kernel/qtestsupport_gui.cpp
index 56e0eb52b3..8a6f662274 100644
--- a/src/gui/kernel/qtestsupport_gui.cpp
+++ b/src/gui/kernel/qtestsupport_gui.cpp
@@ -44,23 +44,21 @@
QT_BEGIN_NAMESPACE
-/*! \fn bool qWaitForWindowActive(QWindow *window, int timeout)
- \relates QTest
+/*!
\since 5.0
Waits for \a timeout milliseconds or until the \a window is active.
Returns \c true if \c window is active within \a timeout milliseconds, otherwise returns \c false.
- \sa QTest::qWaitForWindowExposed(), QWindow::isActive()
+ \sa qWaitForWindowExposed(), QWindow::isActive()
*/
Q_GUI_EXPORT bool QTest::qWaitForWindowActive(QWindow *window, int timeout)
{
return QTest::qWaitFor([&]() { return window->isActive(); }, timeout);
}
-/*! \fn bool qWaitForWindowExposed(QWindow *window, int timeout)
- \relates QTest
+/*!
\since 5.0
Waits for \a timeout milliseconds or until the \a window is exposed.
@@ -73,7 +71,7 @@ Q_GUI_EXPORT bool QTest::qWaitForWindowActive(QWindow *window, int timeout)
area is completely covered by other windows, or if the window is otherwise not visible. This function
will then time out when waiting for such a window.
- \sa QTest::qWaitForWindowActive(), QWindow::isExposed()
+ \sa qWaitForWindowActive(), QWindow::isExposed()
*/
Q_GUI_EXPORT bool QTest::qWaitForWindowExposed(QWindow *window, int timeout)
{
diff --git a/src/testlib/doc/qttestlib.qdocconf b/src/testlib/doc/qttestlib.qdocconf
index 1fdb136e78..93a5ab393c 100644
--- a/src/testlib/doc/qttestlib.qdocconf
+++ b/src/testlib/doc/qttestlib.qdocconf
@@ -31,8 +31,16 @@ depends += qtcore qtdoc qtwidgets qtgui qmake qtquick
headerdirs += ..
+headers += ../../corelib/kernel/qtestsupport_core.h \
+ ../../gui/kernel/qtestsupport_gui.h \
+ ../../widgets/kernel/qtestsupport_widgets.h
+
sourcedirs += ..
+sources += ../../corelib/kernel/qtestsupport_core.cpp \
+ ../../gui/kernel/qtestsupport_gui.cpp \
+ ../../widgets/kernel/qtestsupport_widgets.cpp
+
exampledirs += ../../../examples/qtestlib \
../ \
snippets
diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp b/src/testlib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp
index ed3e9bd0c0..ed3e9bd0c0 100644
--- a/src/corelib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp
+++ b/src/testlib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp
diff --git a/src/testlib/qtestcase.qdoc b/src/testlib/qtestcase.qdoc
index ad9776f7ec..b00c9e51cd 100644
--- a/src/testlib/qtestcase.qdoc
+++ b/src/testlib/qtestcase.qdoc
@@ -995,6 +995,22 @@
*/
/*!
+ \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
@@ -1113,6 +1129,12 @@
*/
/*!
+ \fn template <typename Tuple, int... I> char *QTest::toString(const Tuple &tuple, QtPrivate::IndexesList<I...> )
+ \internal
+ \since 5.12
+*/
+
+/*!
\fn QTouchDevice *QTest::createTouchDevice(QTouchDevice::DeviceType devType = QTouchDevice::TouchScreen)
\since 5.8
diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf
index 4700ee29bf..5d7262fca1 100644
--- a/src/widgets/doc/qtwidgets.qdocconf
+++ b/src/widgets/doc/qtwidgets.qdocconf
@@ -40,6 +40,9 @@ exampledirs += ../../../examples/widgets \
excludedirs += snippets
+# Included in qttestlib.qdocconf instead
+excludefiles += ../kernel/qtestsupport_widgets.cpp
+
imagedirs += images \
../../../doc/src/images \
../../../examples/widgets/doc/images \
diff --git a/src/widgets/kernel/qtestsupport_widgets.cpp b/src/widgets/kernel/qtestsupport_widgets.cpp
index b227e6ff5d..0056bebdc6 100644
--- a/src/widgets/kernel/qtestsupport_widgets.cpp
+++ b/src/widgets/kernel/qtestsupport_widgets.cpp
@@ -46,15 +46,14 @@
QT_BEGIN_NAMESPACE
-/*! \fn bool qWaitForWindowActive(QWidget *widget, int timeout)
- \relates QTest
+/*!
\since 5.0
Waits for \a timeout milliseconds or until the \a widget's window is active.
Returns \c true if \c widget's window is active within \a timeout milliseconds, otherwise returns \c false.
- \sa QTest::qWaitForWindowExposed(), QWidget::isActiveWindow()
+ \sa qWaitForWindowExposed(), QWidget::isActiveWindow()
*/
Q_WIDGETS_EXPORT Q_REQUIRED_RESULT bool QTest::qWaitForWindowActive(QWidget *widget, int timeout)
{
@@ -63,8 +62,7 @@ Q_WIDGETS_EXPORT Q_REQUIRED_RESULT bool QTest::qWaitForWindowActive(QWidget *wid
return false;
}
-/*! \fn bool qWaitForWindowExposed(QWidget *widget, int timeout)
- \relates QTest
+/*!
\since 5.0
Waits for \a timeout milliseconds or until the \a widget's window is exposed.
@@ -80,7 +78,7 @@ Q_WIDGETS_EXPORT Q_REQUIRED_RESULT bool QTest::qWaitForWindowActive(QWidget *wid
A specific configuration where this happens is when using QGLWidget as a viewport widget on macOS:
The viewport widget gets the expose event, not the parent widget.
- \sa QTest::qWaitForWindowActive()
+ \sa qWaitForWindowActive()
*/
Q_WIDGETS_EXPORT Q_REQUIRED_RESULT bool QTest::qWaitForWindowExposed(QWidget *widget, int timeout)
{
@@ -89,11 +87,12 @@ Q_WIDGETS_EXPORT Q_REQUIRED_RESULT bool QTest::qWaitForWindowExposed(QWidget *wi
return false;
}
-/*! \fn bool qWaitForWindowShown(QWidget *widget, int timeout)
- \relates QTest
+/*! \fn bool QTest::qWaitForWindowShown(QWidget *widget, int timeout)
\since 5.0
\deprecated
+ Use qWaitForWindowExposed() instead.
+
Waits for \a timeout milliseconds or until the \a widget's window is exposed.
Returns \c true if \c widget's window is exposed within \a timeout milliseconds, otherwise returns \c false.
@@ -107,7 +106,7 @@ Q_WIDGETS_EXPORT Q_REQUIRED_RESULT bool QTest::qWaitForWindowExposed(QWidget *wi
QTest::qWaitForWindowShown(&widget);
\endcode
- \sa QTest::qWaitForWindowActive(), QTest::qWaitForWindowExposed()
+ \sa qWaitForWindowActive(), qWaitForWindowExposed()
*/
QT_END_NAMESPACE