February 22, 2012

horxpig horxpig
Lab Rat
7 posts

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:

  1. ContactModel{
  2.         id:cm
  3.     }
  4.  
  5. Contact{
  6.         id: contactoNuevo
  7.          Name {
  8.              firstName: "Medico";
  9.              lastName: variable1;
  10.          }
  11.          EmailAddress {
  12.              emailAddress: variable2;
  13.          }
  14.          address.street: variable3;
  15.          address.locality: "Ciudad de Mexico"
  16.          address.country:"Mexico"
  17.          PhoneNumber {
  18.              number: variable4;
  19.          }
  20.     }
  21.  
  22. Image{
  23.             id:agregarBtn
  24.             source: "imagenes/button.png"
  25.             MouseArea{
  26.                 anchors.fill: parent
  27.                 onClicked: {
  28.                     cm.saveContact(contactoNuevo);
  29.                 }
  30.             }
  31.         }

And it throws this error:

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

Thanks in advance :)

2 replies

February 23, 2012

shoyeb shoyeb
Hobby Entomologist
99 posts

  1. import QtMobility.contacts 1.1

 Signature 

There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

February 23, 2012

horxpig horxpig
Lab Rat
7 posts
shoyeb wrote:
@import QtMobility.contacts 1.1@

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 :(

 
  ‹‹ Qtmobility Organizer Qml And C++      QWSScreenSaver ››

You must log in to post a reply. Not a member yet? Register here!