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

qmlls fix for unqualified access is applied in the wrong place

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P1: Critical P1: Critical
    • 6.11
    • 6.10.0
    • QML: Tooling

      import QtQuick
      import QtQuick.Controls
      
      ApplicationWindow {
          id: window
          width: 640
          height: 480
          visible: true
      
          property bool shiftPressed: false
      
          Item {
              id: shiftHandler
      
              Keys.onPressed: (event) => shiftPressed = event.modifiers & Qt.ShiftModifier
              Keys.onReleased: (event) => shiftPressed = event.modifiers & Qt.ShiftModifier
          }
      }
      

      Unqualified access: shiftPressed is a member of a parent element. You can qualify the access with its id to avoid this warning. [unqualified]

      Its fix:

              Keys.onPressed: (event) => shiftPressed = event.modifiers & Qt.window.ShiftModifier
              Keys.onReleased: (event) => shiftPressed = event.modifiers & Qt.window.ShiftModifier
      

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

            qtqmlteam Qt Qml Team User
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes