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

qmllint: property-changes-parsed suggests can code that don't understand

    XMLWordPrintable

Details

    • 7bc52d660 (dev), 3dff3ce1b (6.7), c753d52d8 (6.6), c6416101b (tqtc/lts-6.5)

    Description

      If you take code from https://bugreports.qt.io/browse/QTBUG-105251

      import QtQuick
      
      Window {
          width: 640
          height: 480
          visible: true
          title: 'Resolve my color type'
      
          Item {
              id: foo
      
              states: [
                  State {
                      PropertyChanges {
                          target: foo
                          myColor: Qt.rgba(0.5, 0.5, 0.5, 0.16)
                      }
                  }        
               ]
      
              property color myColor: 'black'
          }
      }
      

      qmllint reports:

      Warning: /var/tmp/Test1.qml:16:30: Property "myColor" is custom-parsed in PropertyChanges. You should phrase this binding as "foo.myColor: Qt.rgba(0.5, ..." [Quick.property-changes-parsed]
                          myColor: Qt.rgba(0.5, 0.5, 0.5, 0.16)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      

      But if this apply suggested fix:

      import QtQuick
      
      Window {
          width: 640
          height: 480
          visible: true
          title: 'Resolve my color type'
      
          Item {
              id: foo
      
              states: [
                  State {
                      PropertyChanges {
                          target: foo
                          foo.myColor: Qt.rgba(0.5, 0.5, 0.5, 0.16)
                      }
                  }        
               ]
      
              property color myColor: 'black'
          }
      }
      

      qmllint reports:

      Warning: /var/tmp/Test1.qml:16:21: Unknown property "foo" in PropertyChanges. [Quick.property-changes-parsed]
                          foo.myColor: Qt.rgba(0.5, 0.5, 0.5, 0.16)
                          ^^^
      

      while "qml" uitlity parses the changed qml without any errors.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-113695
          # Subject Branch Project Status CR V

          Activity

            People

              ulherman Ulf Hermann
              evgeniy_dushistov evgeniy_dushistov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: