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

qmllint doesn't see properties from base classes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P2: Important
    • 6.8
    • 6.7.2
    • QML: Tooling
    • None

    Description

      We have a base class "ParameterizedColorControlsItemQml" that is part of qml module A:

      class ParameterizedColorControlsItemQml : public QQuickPaintedItem {
          Q_OBJECT
          QML_ELEMENT
      public:
          Q_PROPERTY(QString colorTransferModel ...)
      };
      

      Then a class "ParameterizedColorControlsItemQmlWithDialog" that inherits from "ParameterizedColorControlsItemQml" and is part of separate qml module B:

      class ParameterizedColorControlsItemQmlWithDialog : public ParameterizedColorControlsItemQml {
          Q_OBJECT
          QML_ELEMENT
          // ...
      };
      

      Module A is included in the "DEPENDENCIES" of module B.

      However, when used in qml like this:

      Column {
          ParameterizedColorControlsItemQmlWithDialog {
              colorTransferModel: "ColorTransferModel"
              height: 160
              width: parent.width
          }
      }
      

      then qmllint doesn't complain about unresolved type, which is good, but it seems it doesn't see the base class and it's properties:

      Warning: ColorControlsMenu.qml:120:21: Cannot assign to default property of incompatible type [incompatible-type]
                          ParameterizedColorControlsItemQmlWithDialog {
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      Warning: ColorControlsMenu.qml:125:25: Binding assigned to "colorTransferModel", but no property "colorTransferModel" exists in the current element. [missing-property]
                              colorTransferModel: {
                              ^^^^^^^^^^^^^^^^^^
      Warning: ColorControlsMenu.qml:128:25: Binding assigned to "height", but no property "height" exists in the current element. [missing-property]
                              height: 160
                              ^^^^^^
      Warning: ColorControlsMenu.qml:129:25: Binding assigned to "width", but no property "width" exists in the current element. [missing-property]
                              width: parent.width
                              ^^^^^
      

      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
            friendnick Mykola Vankovych
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes