Please nominate your Qt Champions for 2021!

QML Contact Model Problem

  • Hi everyone!

    I'm developing an application for N950 that must allow users to save new contacts in the address book, but when I try to use the ContactModel component it gives me an error.

    Here's the code I'm using:



    id: contactoNuevo
    Name {
    firstName: "Medico";
    lastName: variable1;
    EmailAddress {
    emailAddress: variable2;
    address.street: variable3;
    address.locality: "Ciudad de Mexico""Mexico"
    PhoneNumber {
    number: variable4;

    source: "imagenes/button.png"
    anchors.fill: parent
    onClicked: {

    And it throws this error:
    libqtcontacts-tracker: contactsaverequest.cpp:1969: Save request prematurely failed for contact 1/1
    QSparqlConnection::exec: connection not open
    libqtcontacts-tracker: sparqlresolver.cpp:144: Connection not open
    libqtcontacts-tracker: contactsaverequest.cpp:2046: Cannot resolve local ids of saved contacts

    Thanks in advance :)

  • @import QtMobility.contacts 1.1@

  • [quote author="shoyeb" date="1329972133"]@import QtMobility.contacts 1.1@[/quote]

    I already did this, but now I noticed that it only fails when I`m debbuging my application, qhen I use it for real in my N950 it does create a new contact but it wont save any of the information I added to it in my QML :(

  • Hi,
    look at this:

    Fernando Moreno.

  • Hello, I already solved it by creating a custom QML element through C++ and the qmlRegisterType method. But thanks anyway :)

    [quote author="kahon" date="1339929061"]Hi,
    look at this:

    Fernando Moreno.[/quote]

Log in to reply