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

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 6.10
    • 6.10.0 Beta1
    • QML: Tooling
    • None

    Description

      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".

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change