Reputation: 315
I am using Qt Quitck Control 2.0 . I want to add image and text into Combobox list. Image is left , text is rigth. How to do that
Upvotes: 2
Views: 617
Reputation: 13701
You write a custom delegate:
delegate: ItemDelegate {
id: delegatRoot
width: control.width
height: 40
Row {
Image {
width: delegateRoot.width / 2
height: 40
source: 'my/image/path.png'
}
Text {
text: 'myText'
}
}
}
As in any view, you can use model.roleName
to get the values from your ListModel
.
Upvotes: 2