[Interest] QML: ApplicationWindow's child strange parent

Alexander Dyagilev alervdvcw at gmail.com
Fri Jan 14 12:34:36 CET 2022


Hello,

I'm getting "non-valid" parent in my object.

I have the following code:

ApplicationWindow {
    id: appWindow
    MyItem {}
}

MyItem's code:

Item {
       id: root
      Component.onCompleted: {
         console.log("appWindow:", appWindow);
         console.log("parent: ", root.parent);
      }
}

I'm getting the following output:

qml: appWindow: QQuickApplicationWindow_QML_278(0x17db695b330)
qml: parent:  QQuickContentItem(0x17db68b3ef0, "ApplicationWindow")

What does it mean? Why parent is NOT appWindow? Isn't it should be?

Is it a bug? Am I missing something?



More information about the Interest mailing list