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

qmllint warning: Property "pixelDensity" not found on type "QQuickScreen"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.0
    • 6.0
    • QML: Tooling
    • aa8d5a45930dcfce7f25878fa36c1595b1dfc023 (qt/qtdeclarative/dev)

    Description

      I get warning about code like this:

       contentItem: Item {
              IconImage {
                  id: icon
                  anchors.top: parent.top
                  anchors.topMargin: Screen.pixelDensity * 0.5
      
      Warning: Property "pixelDensity" not found on type "QQuickScreen" at TabButton.qml:21:39
                  anchors.topMargin: Screen.pixelDensity * 0.5
                                            ^^^^^^^^^^^^
      

      The problem looks similar to https://bugreports.qt.io/browse/QTBUG-84300
      The `QQuickScreen` has attached type to QQuickScreenAttached which prototype QQuickScreenInfo has property: Property

      { name: "pixelDensity"; type: "double"; isReadonly: true }

      .

      But
      https://github.com/qt/qtdeclarative/blob/22d8db1e115b120ce2f62896eb7fea452348941e/tools/qmllint/checkidentifiers.cpp#L215
      check only attached types to pixelDestiny no check for attached type to QQuickScreen .

      Similar = caller that call checkMemberAccess should resolve attachedType of QQuickScreen.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes