Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-119162

Qml: Behaviour differs between interpreted/compiled code

    XMLWordPrintable

Details

    • 8d7f18ec4 (dev), 826346435 (dev), 84d950bc3 (dev), 852067de0 (6.6), 06c3f86d2 (tqtc/lts-6.5)

    Description

      Running with Qml debugger (assuming this uses the bytecode representation):

      2023-11-15 13:57:29.852454+0100 appuntitled3[66173:6512588] QML Debugger: Waiting for connection on port 62665...
      2023-11-15 13:57:31.103805+0100 appuntitled3[66173:6512504] qrc:/untitled3/Main.qml:18:5: QML Foo: Binding loop detected for property "bar"
      2023-11-15 13:57:31.103910+0100 appuntitled3[66173:6512504] [qml] BAR null
      2023-11-15 13:57:31.103967+0100 appuntitled3[66173:6512504] qrc:/untitled3/Main.qml:18:5: QML Foo: Binding loop detected for property "bar"
      2023-11-15 13:57:31.103987+0100 appuntitled3[66173:6512504] [qml] BAR null
      2023-11-15 13:57:31.104021+0100 appuntitled3[66173:6512504] qrc:/untitled3/Main.qml:18:5: QML Foo: Binding loop detected for property "bar"
      2023-11-15 13:57:31.104036+0100 appuntitled3[66173:6512504] [qml] BAR null
      2023-11-15 13:57:31.104072+0100 appuntitled3[66173:6512504] qrc:/untitled3/Main.qml:18:5: QML Foo: Binding loop detected for property "bar"
      2023-11-15 13:57:31.104088+0100 appuntitled3[66173:6512504] [qml] BAR null
      2023-11-15 13:57:31.104117+0100 appuntitled3[66173:6512504] qrc:/untitled3/Main.qml:18:5: QML Foo: Binding loop detected for property "bar"
      2023-11-15 13:57:31.104133+0100 appuntitled3[66173:6512504] [qml] BAR null
      

      Running in normal mode (no debuggger attached):

      QML debugging is enabled. Only use this in a safe environment.
      qml: BAR QQuickItem(0x6000000f48c0, "Bar")
      qml: BAR QQuickItem(0x6000000f48c0, "Bar")
      qml: BAR QQuickItem(0x6000000f48c0, "Bar")
      qml: BAR QQuickItem(0x6000000f48c0, "Bar")
      qml: BAR QQuickItem(0x6000000f48c0, "Bar")
      

      Main.qml:

      pragma ComponentBehavior: Bound
      
      import QtQuick
      
      Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
      
        Item {
          id: bar
          objectName: "Bar"
        }
      
        Repeater {
          model: 5
          Foo {
            bar: bar
          }
        }
      }
      

      Foo.qml

      import QtQuick
      
      Item {
        property Item bar
      
        Component.onCompleted: console.log("BAR", bar)
      }
      

      Notes:

      • "bar" is used for both the id and the property. Changing either the property or the id "fixes" the problem.
      • This only occurs if "bar" is an item outside of the delegate component scope (pragma Bound)

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ulherman Ulf Hermann
            njeisecke Nils Jeisecke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: