Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

radiobuttons in listview and groups by sections

$
0
0
Hi, Im trying to build a listview containing radiobuttons. The listview has sections as described above in the code. Rectangle {     ListModel {         id:nameModel         ListElement {name: "Grey"; sectionName: "apples" }         ListElement {name: "Red";  sectionName: "apples" }         ListElement {name: "Blue"; sectionName: "cars"}         ListElement {name: "Green";sectionName: "cars"}     }     ListView {         anchors.fill: parent         model: nameModel         delegate {             RowLayout{                 RadioButton{                     text: "test"                     exclusiveGroup: sectionName                 }                 Text {                     text: name;                     font.pixelSize: 24                 }             }         }         section {             property: "sectionName"             delegate: Rectangle {                 width: parent.width                 height: childrenRect.height + 4                 Text {                     font.pixelSize: 16                     font.bold: true                     text: section                   }             }         }     } } Now I would like the RadioButtons of each section to be exclusive. It would be so nice if I could convert the section string into an exclusiveGroup but i didnt find a way to do this. Do you have any ideas? greetings Pioupus

Viewing all articles
Browse latest Browse all 4972

Trending Articles