views:

80

answers:

2

Hi, 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(“[email protected]”);
   // example.saveDetail(&email);
   // Finally, save the contact details
    cm->saveContact(&example);
    delete cm;

Thanks

A: 

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
ya, i am using them itself, but its getting crashed at the constructor only :(available managers "symbian" is not working for N96 devices :(
Shadow
A: 

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

-jk

John
Nope, its crashing while initializing the QContactManager, its crashing at constructor itself :(.i tried for error code, not getting :(
Shadow
Sounds like this bug (http://bugreports.qt.nokia.com/browse/QTMOBILITY-338)-jk
John