Hey,

I am on Nokia 5800, Qt 4.7.3, Qt mobility 1.1.3.
I need to fetch contacts. When I do – QContactmanager cm; or QContactmanager *cm =new QContactManager(); or QContactmanager::AvailableManagers(); my app crashes with the debugger showing a Segmentation Fault at these lines.

Here is what I m doing:
Qt Code:
  1. void Contacts::FetchContacts()
  2. {
  3. qDebug()<<"here1";
  4.  
  5. /* QStringList strlist = QContactManager::availableManagers();
  6.   qDebug()<<strlist.count();
  7.   for(int i=0;i<strlist.count();i++)
  8.   {
  9.   qDebug()<<strlist.at(i);
  10.   }*/
  11.  
  12. QContactManager cm; // or QContactManager cm("symbian");
  13. qDebug()<<"here2";
  14.  
  15. QList<QContactLocalId> contactIds = cm.contactIds();
  16. QContact currContact;
  17. qDebug()<<contactIds.count();
  18.  
  19. foreach (const QContactLocalId& id, contactIds)
  20. {
  21. currContact = cm.contact(id);
  22. QString nameAndNumber(currContact.displayLabel() + ": " + currContact.detail(QContactPhoneNumber::DefinitionName).value(QContactPhoneNumber::FieldNumber));
  23. ui->listWidget->addItem(nameAndNumber);
  24. }
  25.  
  26. }
To copy to clipboard, switch view to plain text mode 

In Application output I receive “here1” and then a segmentation fault occurs and app crashes before printing “here2”.
Any help in this regard would be apreciated.
Thanks