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

qmldom: attached/grouped property names as string

XMLWordPrintable

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

      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 '.'.

        For Gerrit Dashboard: QTBUG-117380
        # Subject Branch Project Status CR V

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes