2

I am using the latest Nokia Qt SDK. I have tried to add the contacts, it's not getting added.. what is missing here?

  // Construct contact manager for default contact backend
    QContactManager* cm = new QContactManager("simulator");
  // QContactManager* cm = new QContactManager("memory"); // i tried this, its also not working
  // Create example contact
    QContact example;
  // Add contact name
    QContactName name;
    name.setFirstName("John");
    name.setLastName("Doe");
    example.saveDetail(&name);

    // Add contact email address

    //QContactEmailAddress email;
   // email.setContexts(QContactDetail::ContextHome);
   //email.setEmailAddress(“john.doe@example.com”);
   // example.saveDetail(&email);
   // Finally, save the contact details
    cm->saveContact(&example);
    delete cm;

Thanks

John Topley
  • 113,588
  • 46
  • 195
  • 237
Naruto
  • 9,476
  • 37
  • 118
  • 201
  • I can't create the tag, but you should specify that you are using the Qt-Mobility API. Are you following this documentation? http://doc.qt.nokia.com/qtmobility-1.0-tp/contacts.html – Adam W Jun 15 '10 at 14:05

2 Answers2

0

http://doc.qt.nokia.com/qtmobility-1.0-tp/qcontactmanager.html#availableManagers check list of available managers, and use one of them. Maybe then it will work

Kamil Klimek
  • 12,884
  • 2
  • 43
  • 58
  • ya, i am using them itself, but its getting crashed at the constructor only :( available managers "symbian" is not working for N96 devices :( – Naruto Jun 16 '10 at 09:08
0

cm->saveContact(&example) returns QList<QContactManager::Error>. Are there any values return in this list?

-jk

John
  • 476
  • 2
  • 5
  • 15
  • Nope, its crashing while initializing the QContactManager, its crashing at constructor itself :(. i tried for error code, not getting :( – Naruto Jun 17 '10 at 04:33