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

QML setter being entered multiple times.

    XMLWordPrintable

Details

    • f514451cc2e3610e160b5dc8ccd1e390730ecc67

    Description

      With the following QML the names setter of each component is entered twice both with a given value of ["one", "two"]. Without using customType.names the setter is only entered once.

      CustomType {
        id: customType
        objectName: "customType"
        names: ["one", "two"]
      }
      CustomType {
        id: customType2
        objectName: "customType2"
        names: customType.names
      }
      

      If id: customType2 is defined above id: customType then each setter is only entered once.

      CustomType {
         id: customType2
        objectName: "customType2"
        names: customType.names
      }
      CustomType {
        id: customType
        objectName: "customType"
        names: ["one", "two"]
      }
      

      FWIW I use Qt with PyQt5 and here is my test case. https://gist.github.com/Siecje/f19c737c8cdbb72e468b18c2da5a6a6f

      Lucijan from the #qt-quick freenode IRC channel created a C++ version which shows the behaviour, which I have attached.

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              code Cody Scott
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes