Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-29088

Aliasing root item property gives 'Avoid referencing the root item in a hierarchy' warning

    XMLWordPrintable

Details

    • 585eb1c3e (11.0)

    Description

      When one tries to alias a root item property, he/she will be greeted by such warning:
      Avoid referencing the root item in a hierarchy (M402)

      A snippet to reproduce the warning:

      Rectangle {
          id: root
          property alias backgroundColor: root.color <- Here goes the warning message
      }
      

      The reason of aliasing root item property is to, for example, giving the property a better/more descriptive name. I think it is a valid use case.

      A result from https://codereview.qt-project.org/c/qt-creator/qt-creator/+/390841

      Attachments

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

        Activity

          People

            cstenger Christian Stenger
            luqiaochen Luqiao Chen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes