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

Qmllint does not handle nested QtObjects

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • 6.9
    • 6.6.3
    • QML: Tooling
    • None
    • All

    Description

      qmllint does not handle nesting of QtObjects it seems. It's useful to be able to declare a tree-like structure for things like color roles / settings:

      For example Colors.qml registered as a QT_QML_SINGLETON_TYPE:

      pragma Singleton
      
      import QtQuick
      import QtQml
      
      QtObject {
          id: root
      
          readonly property QtObject colors: QtObject {
              readonly property QtObject base: QtObject {
                  readonly property color _100: "#FFFFFF"
                  readonly property color _900: "#000000"
              }
              readonly property QtObject neutral: QtObject {
                  readonly property color _100: "#DCDCDC"
                  readonly property color _900: "#050505"
              }
              readonly property QtObject danger: QtObject {
                  readonly property color _100: "#FCCACA"
                  readonly property color _900: "#170202"
              }
          }
      }
      

      And if you were to use a property like this:
      Colors.colors.base._100

      qmllint complains:
      Member "base" not found on type "QObject" [missing-property]
       

      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
            evan621 Evan Swinney
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes