Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
5.15.4
-
None
-
9f089022bec116b1a7ae415c431768d5b6a67a8a 1243279ddc92bab67bc75e4ecb4ce793715ed11f
Description
import QtQuick.Window 2.15 import QtQuick 2.15 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Item { id: item } Connections { target: item.Window function onWindowChanged() { console.log("window changed of item") } Component.onCompleted: { console.log(target, item.Window) console.assert(target !== item, "Target is the item self, and is not its attached object.") } } }
In the Qt 5.15.8, I get the follow logs:
Qt 5.15.8
QML debugging is enabled. Only use this in a safe environment.
qml: QQuickItem(0x5633eba9ec20) QQuickWindowAttached(0x5633eb860190)
Target is the item self, and is not its attached object.
onCompleted (qrc:/qml_attached_properties_bug/main.qml:22)
In the Qt 6.4.2, I get the follow logs:
Qt 6.4.2
QML debugging is enabled. Only use this in a safe environment.
qml: QQuickWindowAttached(0x56135bbdf2e0) QQuickWindowAttached(0x56135bbdf2e0)
So, Is it a known bug?
Attachments
Issue Links
- duplicates
-
QTBUG-97427 Binding an attached property instance to a Connection.target results in attachee being set as a target
-
- Closed
-