summaryrefslogtreecommitdiffstats
path: root/src/testlib/qsignalspy.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib/qsignalspy.qdoc')
-rw-r--r--src/testlib/qsignalspy.qdoc22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testlib/qsignalspy.qdoc b/src/testlib/qsignalspy.qdoc
index 39639d0a09..d532ad478d 100644
--- a/src/testlib/qsignalspy.qdoc
+++ b/src/testlib/qsignalspy.qdoc
@@ -98,6 +98,28 @@
\snippet code/doc_src_qsignalspy.cpp 6
*/
+/*! \fn QSignalSpy(const QObject *obj, const QMetaMethod &signal)
+ \since 5.14
+
+ Constructs a new QSignalSpy that listens for emissions of the \a signal
+ from the QObject \a object. If QSignalSpy is not able to listen for a
+ valid signal (for example, because \a object is \nullptr or \a signal does
+ not denote a valid signal of \a object), an explanatory warning message
+ will be output using qWarning() and subsequent calls to \c isValid() will
+ return false.
+
+ This constructor is convenient to use when Qt's meta-object system is
+ heavily used in a test.
+
+ Basic usage example:
+ \snippet code/doc_src_qsignalspy.cpp 7
+
+ Imagine we need to check whether all properties of the QWindow class
+ that represent minimum and maximum dimensions are properly writable.
+ The following example demonstrates one of the approaches:
+ \snippet code/doc_src_qsignalspy.cpp 8
+*/
+
/*! \fn QSignalSpy::isValid() const
Returns \c true if the signal spy listens to a valid signal, otherwise false.