Uploaded image for project: 'Qt Mobility'
  1. Qt Mobility
  2. QTMOBILITY-1697

ContactModel crashes on startup

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 1.2.x
    • Contacts
    • None
    • Linux desktop

    Description

      The qmlcontacts application crashes on startup (see attached backtrace), when run on a Linux desktop machine with the "memory" backend. The problem seems to be caused by early binding of the ListView.model property to ContactModel, delaying this binding prevents the crash. The following code is a minimal example, you will need the example.vcf file from the qmlcontacts demo (demos/qmlcontacts/content/example.vcf).

      import QtQuick 1.1
      import QtMobility.contacts 1.1
      
      Rectangle {
          width: 360
          height: 360
      
          ListView {
              anchors.fill:  parent
      
              model: contactModel
              delegate: Text {
                  text: contact.name.firstName + " " + contact.name.lastName
              }
      
              ContactModel {
                  id: contactModel
                  Component.onCompleted: {
                      if (manager == "memory")
                          importContacts(Qt.resolvedUrl("example.vcf"));
                  }
              }
          }
      }
      

      Attachments

        Activity

          People

            satu.m.makela satu makela
            amccarth Aaron McCarthy (closed Nokia identity) (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: