Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.5.0
-
Windows 7
Description
If SignalSpy signalName property is defined before target property we can see that SignalSpy count property returns doubled value.
See the only difference is order of target and signalName:
SignalSpy { id: spySignalNameFirst signalName: "antialiasingChanged" target: rect } SignalSpy { id: spyTargetFirst target: rect signalName: "antialiasingChanged" }
value of rect is changed in initTestCase only once:
function initTestCase() { rect.antialiasing = true; console.log("spySignalNameFirst.count: " + spySignalNameFirst.count) console.log("spyTargetFirst.count: " + spyTargetFirst.count) }
And output shows that value is different depending of the property order:
QDEBUG : tst_testCase::myTest::initTestCase() qml: spySignalNameFirst.count: 2 QDEBUG : tst_testCase::myTest::initTestCase() qml: spyTargetFirst.count: 1
Test project for above test atached.
If signal from rect is attached more than once it cause spySignalNameFirst.count value to be always double of the spyTrgetFirst.count value.
Attachments
Issue Links
- is duplicated by
-
QTBUG-47878 SignalSpy created with Qt.createQmlObject always remains invalid
- Closed
- relates to
-
QTBUG-21083 SignalSpy in QtQuickTest cannot handle target switching properly
- Closed