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

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • 6.6
    • 6.4.0
    • QML: Compiler
    • All

      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.

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

            semih.yavuz Semih Yavuz
            Harald Meyer Harald Meyer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes