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

qmlsc/qmllint: optional properties

    XMLWordPrintable

Details

    Description

      There are situations in which one wants to access a property of an Item, but you do not know its exact type or you want to use it for different types. For example, using qmllint on qtdeclarative/src/quickcontrols2/material/impl/CheckIndicator.qml yields:

      Warning: qtdeclarative/src/quickcontrols2/material/impl/CheckIndicator.qml:19:38: Property "checkState" not found on type "QQuickItem"
          property int checkState: control.checkState
                                           ^^^^^^^^^^
      

      Of course, since control is defined as:

      property Item control
      

      and Item does not have a property `checkState`.

      However, both ButtonGroup and CheckBox have a property checkState.

      If I want to use either of them in a property like this one - with silent qmlsc and no lint warnings - how would you do that?

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            moerkb Markus Bader
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes