summaryrefslogtreecommitdiffstats
path: root/src/testlib/qsignalspy.qdoc
diff options
context:
space:
mode:
authorThe Qt Project <gerrit-noreply@qt-project.org>2019-10-14 08:49:14 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2019-10-14 08:49:14 +0000
commiteba59bfd14d0ea29f36e80be81137d26cc67e23a (patch)
tree69ff8601b3d4a62bea38e1a32245f45cb744aaac /src/testlib/qsignalspy.qdoc
parentf03ac58b1ecc24f01cb83b275a9b6088f9483545 (diff)
parentf4b4c4f79b629498f3cddbbc10df8c1b4d6020d9 (diff)
Merge "Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake" into wip/cmake
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 3352307d69..5ea6bc5dc7 100644
--- a/src/testlib/qsignalspy.qdoc
+++ b/src/testlib/qsignalspy.qdoc
@@ -86,6 +86,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.