-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.7.0
-
None
-
aaaa7a063 (dev), 28bcc7ca9 (6.10), 2cbea6584 (6.9)
http://doc.qt.io/qt-5/qml-qttest-signalspy.html#clear-method says:
Clears count to 0, resets valid to false and clears the signalArguments to empty.
However, the following code works fine:
import QtQuick 2.0 import QtTest 1.0 TestCase { name: "Untitled" Item { id: item signal test } SignalSpy { id: spy } function test_tryVerify() { spy.target = item; spy.signalName = "test"; item.test(); compare(spy.count, 1) spy.clear(); compare(spy.count, 0); compare(spy.signalArguments.length, 0); verify(spy.valid); print(spy.target, spy.signalName) item.test(); compare(spy.count, 1) } }
For Gerrit Dashboard: QTBUG-54605 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
659075,3 | Doc: Fix incorrect description of SignalSpy::clear() behavior | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
660482,2 | Doc: Fix incorrect description of SignalSpy::clear() behavior | 6.10 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
663199,2 | Doc: Fix incorrect description of SignalSpy::clear() behavior | 6.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |