Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to display the avatar/picure associate with a contact in qml.
QtWS25 Last Chance

How to display the avatar/picure associate with a contact in qml.

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 2.1k Views
  • 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.
  • S Offline
    S Offline
    satyendra
    wrote on last edited by
    #1

    I want to display contact image(thumbnail or the avatar) for all the contacts.i am able to show the first Name, last Name and the phone Number of each contact.
    here is my code snippet.

    @import QtQuick 1.0
    import QtMobility.contacts 1.1

    Rectangle {
    width: 360
    height: 360
    //Model
    ContactModel {
    id : contactsmodel
    }
    //View
    ListView {
    id : list
    anchors.fill: parent
    model: contactsmodel.contacts
    //delegate
    delegate: Text { text: name.firstName +" "+ name.lastName +" : "+phoneNumber.number }
    }

    //MouseArea
    MouseArea {
        anchors.fill: parent
        onClicked: {console.log("MouseArea")}
    }
    

    }

    @

    1 Reply Last reply
    0
    • S Offline
      S Offline
      satyendra
      wrote on last edited by
      #2

      Now i can see the avatar of the contact in the left side of the contact list.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved