What should be the section.property string when using Qml ContactsModel



  • My code is like this ,
    what should be the section.property when using Qml ContactsModel?

    I do not see the section showing up anything here.

    Also, Is it possible to copy the ContactsModel to ListModel? If so, how?

    @ListView{
    id:listContact
    focus:true;clip:true
    anchors.fill: parent
    model:contactModel.contacts

                delegate: contactDelegate
                section{
                    property: "name.firstName"
                    criteria: ViewSection.FirstCharacter
                    delegate: Rectangle{
                        x:200;y:300
                        width:parent.width-40; height:40
                        color:"#00808080"
                        visible: listContact.moving
                        Text{
                            anchors.centerIn: parent
                            font{pixelSize: 44; bold:true}
                            text:section
                        }
                    }
                }
                ScrollDecorator{
                    flickableItem: listContact
                }
            }@


  • I also would like to know how to use sections with QtMobility's QML ContactModel. Has anyone any idea? Sections show up just fine when I use custom ListModel, but I can't figure out how to use sections with ContactModel.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.