whats wrong with this peace of code for saving contacts

Posted by Shadow on Stack Overflow See other posts from Stack Overflow or by Shadow
Published on 2010-06-15T08:59:53Z Indexed on 2010/06/15 9:02 UTC
Read the original article Hit count: 230

Filed under:
|
|
|
|

Hi, i am using the latest Nokia Qt SDK. i have tried to add the contacts, its 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

© Stack Overflow or respective owner

Related posts about qt

Related posts about qt4