Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-19186 Improved property declaration support in QML
  3. QTBUG-15117

QML syntax does not allow bindings on property declarations

    XMLWordPrintable

Details

    • f31d94f2d4438106558dede0de1a423cade960a9

    Description

      If you write QML such as

      property bool bar: false
      property string text: bar ? "hello" : "world"
      

      ,
      the variable "text" will be evaluated as a binding. However, it is not allowed to type a multiline binding in a block, such as

      property string text: {
          return bar ? "hello" : "world"
      }
      

      Because bindings are allowed for QML properties, this limitation seems artificial and only dependent on the syntax of QML. If possible, it would be great to have it removed to make the language more consistent.

      Attachments

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

        Activity

          People

            raggi Roberto Raggi
            holmsted Lasse Holmstedt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes