Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.7.0
-
None
-
Linux yoga 4.7.6-1-ARCH #1 SMP PREEMPT Fri Sep 30 19:28:42 CEST 2016 x86_64 GNU/Linux
Description
I.e. it does not work when `target` was set to the parent item via the default behaviour.
Per the documentation, setting `target` to `null` should disconnect the Connection: http://doc.qt.io/qt-5/qml-qtqml-connections.html#target-prop.
If set to null, no connection is made and any signal handlers are ignored until the target is not null.
Testcase:
test.qml
import QtQuick 2.0 Item { MouseArea { id: mouse_area anchors.fill: parent Connections { id: connections // target: mouse_area // Testcase works if this line is uncommented onPressedChanged: { console.log("pressed changed") } } onClicked: { console.log("connections target", connections.target, mouse_area) connections.target = null console.log("connections target", connections.target, mouse_area) } } }