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

qmldom: attached/grouped property names as string

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • P2: Important
    • 6.7
    • 6.6
    • QML: Tooling
    • None
    • 3aa4c00c5 (dev), a44f21f19 (dev), 81b333679 (dev), 71d1d94a7 (dev)

    Description

      Inside a Dom::Binding, you will see that the name is "SomeAttachedType.attachedProperty" or "someId.SomeAttachedType.attachedProperty" in case of attached properties. The same also happens for grouped properties, which is annoying because these property names might require some type resolution to be able to be used. See for example https://doc.qt.io/qt-6.4/qtqml-syntax-objectattributes.html#attached-properties-and-attached-signal-handlers that you might need to resolve first and id, than an attached type and finally the property of the attached type before knowing the type of the property you are binding to.

      Because of the string, you cannot use helpers like QQmlLSUtils::resolveExpressionType() to do the type resolution.

      Instead, change QQmlDomAstCreator::visit(AST::UiScriptBinding *el) to construct a FieldMemberExpression for the dotted name, in the same way as QQmlDomAstCreator::endVisit(AST::FieldMemberExpression *expression) does it. If there is no dot, you can just construct a ScriptIdentifierExpression.

      Note that attached or grouped properties binding name can have a lot of '.'.

      Attachments

        Issue Links

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

          Activity

            People

              semih.yavuz Semih Yavuz
              sami.shalayel Sami Shalayel
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes