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

qmllint DropArea Reading non-constant and non-notifiable property hasColor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.10.0 Beta1
    • Quick: Other
    • None
    • Linux/Wayland

    Description

      Using this code:

          DropArea {
              id: dropAreag
              anchors.fill: parent
              keys: ["application/x-color"]
              onDropped: drop => {
                  if (drop.hasColor) {
                      if (drop.proposedAction === Qt.CopyAction) {
                          internal.setColor(drop.colorData);
                          drop.acceptProposedAction();
                      }
                  }
              }
              onEntered: drag => {
                  if (!drag.hasColor) {
                      drag.accepted = false;
                  }
              }
          } 

      Linter gives:

      Reading non-constant and non-notifiable property hasColor. Binding might not update when the property changes. [stale-property-read]

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            qtdel Quentin Deldycke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes