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

qmlint: Example in documentation produces Cannot assign binding of type QQmlListProperty<QObject> to QList<QObject *>

    XMLWordPrintable

Details

    • All
    • fa259ed4ff84a5952cdb6d2c6215e92d65afa56a, 808a8764a (tqtc/lts-6.5)

    Description

      The ButtonGroup example (https://doc.qt.io/qt-6/qml-qtquick-controls2-buttongroup.html#details ):

      ButtonGroup {
           buttons: column.children
       }
      
       Column {
           id: column
      
           RadioButton {
               checked: true
               text: qsTr("DAB")
           }
      
           RadioButton {
               text: qsTr("FM")
           }
      
           RadioButton {
               text: qsTr("AM")
           }
       }
      

      produces this error message:

      Warning: main.qml:13:19: Cannot assign binding of type QQmlListProperty<QObject> to QList<QObject *>
               buttons: column.children
                        ^^^^^^^^^^^^^^^
      Error: main.qml:13:34: Could not compile binding for buttons: cannot convert from QQmlListProperty<QObject> of QQuickItem::children with type QQuickItem to QList<QObject *> of QList<QObject *>
               buttons: column.children
                                       ^
      

      Maybe this is out-of-scope because the alternative method using "ButtonGroup.group: radioGroup" works fine.

      Attachments

        Issue Links

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

          Activity

            People

              olivier.decanniere Olivier De Cannière
              Harald Meyer Harald Meyer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes