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

"required" existing property not reflects model data if CONFIG+=qtquickcompiler enabled

    XMLWordPrintable

Details

    • Linux/X11
    • b322a971f06823a4356f2b3aa331501aa4d0dc7f (qt/qtdeclarative/dev) 7f99a69e25ee3ae99c3b4ba713b8c6b5e8e60135 (qt/qtdeclarative/6.0) 045718e821d1d1f1d5732f123c7a9c189bd92b19 (qt/tqtc-qtdeclarative/tqtc/lts-5.15)

    Description

      The following example binds model's "visible" role to Item.visible property,
      one by "required visible" and the other by "visible: model.visible".

      Both texts should blink reflecting model.visible. However, the "required visible"
      one does not blink if compiled with CONFIG+=qtquickcompiler.

      Window {
          width: 640
          height: 480
          visible: true
      
          ListModel {
              id: fakeModel
      
              ListElement {
                  visible: false
                  tick: 0
              }
          }
      
          Column {
              spacing: 2
      
              Repeater {
                  model: fakeModel
      
                  Text {
                      required visible
                      required property int tick
                      required property var model
                      text: "hello required, tick: " + tick + ", model.visible: " + model.visible
                  }
              }
      
              Repeater {
                  model: fakeModel
      
                  Text {
                      visible: model.visible
                      text: "hello old style, tick: " + model.tick
                  }
              }
          }
      
          Timer {
              property int tick: 0
              interval: 1000
              repeat: true
              running: true
              onTriggered: {
                  ++tick;
                  fakeModel.set(0, {visible: !!(tick % 2), tick: tick});
              }
          }
      }
      

      (full source code attached)

      Attachments

        1. quick-bug-required-prop.tar.gz
          1 kB
        2. cachegen.txt
          4 kB
        3. cachegen_reorder.txt
          4 kB
        4. diskcache.txt
          3 kB
        5. diskcache_reorder.txt
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtqmlteam Qt Qml Team User
            jirauser52013 user-c858f (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes