How can i apply delegate of repeater for ObjectModel in QML?
-
ApplicationWindow { // @disable-check M16 visible: true // @disable-check M16 width: 640 // @disable-check M16 height: 480 Grid { id:grid width: 200; height: 100 columns: 3 rows: 3 columnSpacing: 2 rowSpacing: 2 Repeater{ id:repeater model:objModel delegate: Component{ Rectangle{ width: 150 height: 150 border.color: "black" border.width: 5 } } } ObjectModel{ id:objModel Rectangle{ width: 100 height: 100 color: "red" } Rectangle{ width: 100 height: 100 color: "blue" } } }}
I build TableLayoutPanel control custom use Grid with Repeater to generate item.I definition delegate for repeater.But when i pass model I use ObjectModel.It dont use delegate(follow QT DOCUMENTATION).So How can i apply delegate of repeater for ObjectModel?
I want when pass ObjectModel each item has a Rectangle with property like I definition in delegate.