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:

    @

    ContactModel{
    id:cm
    }

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

    Image{
    id:agregarBtn
    source: "imagenes/button.png"
    MouseArea{
    anchors.fill: parent
    onClicked: {
    cm.saveContact(contactoNuevo);
    }
    }
    }
    @

    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:
    http://qt-project.org/forums/viewthread/13889

    Best,
    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:
    http://qt-project.org/forums/viewthread/13889

    Best,
    Fernando Moreno.[/quote]


Log in to reply
 

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