Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

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

    QML and Qt Quick
    2
    2
    1396
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      tapadar last edited by

      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
                  }
              }@
      
      1 Reply Last reply Reply Quote 0
      • M
        miksuh last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post