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

Package / DelegateModel with custom components

$
0
0
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.

Viewing all articles
Browse latest Browse all 4972

Latest Images

Trending Articles



Latest Images