Hi,
I have some custom sub-views/components (View1, View2, View3…) I’d like to display in both a ListView and a GridView.
I saw this example with “Package” : http://harmattan-dev.nokia.com/docs/library/html/qt4/declarative-modelviews-package.html
But I can’t figure how to apply it to my use case.
I thought to write something like this, but I can’t make it work :
ObjectModel {
id: myModel
View1 { }
View2 { }
View3 { }
View4 { }
}
VisualDataModel {
id: visualModel
delegate: Delegate {}
model: myModel
}
ListView {
width: 200; height:200
model: visualModel.parts.list
}
GridView {
x: 200; width: 200; height:200
cellHeight: 50
model: visualModel.parts.grid
}
With the Delegate being a container with the sole purpose of reparenting the views into the listview/gridview.
↧