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

qmllint dislikes alias on required properties

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • 6.4
    • 6.4
    • QML: Tooling
    • All

    Description

      Given these two files:

       InfoWidget.qml
              PartRenderer {
                  renderController: RenderController { }
              }
      
      
      PartRenderer.qml:
      Item {
          required property var renderController
          property alias rc: root.renderController
      }

      qmllint complains about the alias being required

      Warning: InfoWidget.qml:110:9: Component is missing required property rc from PartRenderer
              PartRenderer {
              ^^^^^^^^^^^^
      

      And yes, this is a bit of an odd setup, but I had to repeat "renderController" so many times in PartRenderer.qml that an abbreviation was in order... but not at the expense of a nice interface to the outside .

      Replacing property alias rc with property var rc works just as well without warnings, but I guess it's a bit more overhead on the engine side.

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            rgriebl Robert Griebl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes