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

qmllint: claims binding will not update on a signal handler (i.e. not a binding)

XMLWordPrintable

    • 740d67fbc (dev), e730c16cd (6.10)

      With this code

      import QtQuick
      Item {
        DropArea {
          onDropped: (drop) => {
            console.log(drop.hasUrls)
          }
        }
      }
      

      qmllint will complain

       

      /Users/user/Qt/6.10.0/macos/bin/qmllint test.qml 
      Warning: test.qml:8:24: Reading non-constant and non-notifiable property hasUrls. Binding might not update when the property changes. [stale-property-read]
            console.log(drop.hasUrls)
                             ^^^^^^^

      But onDropped is not a binding so this warning is bogus and in my opinion it is more than ok to use/read that property since you want to use it only "at that point in time".

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

            qtqmlteam Qt Qml Team User
            albert.astals.cid.avid Albert Astals Cid
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes