Results 1 to 3 of 3

Thread: QtMobility Contacts API: Can’t create QContactManager object on Nokia 5800

  1. #1
    Join Date
    Oct 2011
    Posts
    14
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default QtMobility Contacts API: Can’t create QContactManager object on Nokia 5800

    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

  2. #2
    Join Date
    Feb 2008
    Posts
    154
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QtMobility Contacts API: Can’t create QContactManager object on Nokia 5800

    try to use QContactManager as a member pointer

  3. #3
    Join Date
    Oct 2011
    Posts
    14
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: QtMobility Contacts API: Can’t create QContactManager object on Nokia 5800

    @mismael85 did u mean this :
    QContactManager *cm = new QContactManager();

    crashing anyway

Similar Threads

  1. Small QT app in a Nokia 5800
    By Ethan in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 7th October 2011, 20:11
  2. Replies: 1
    Last Post: 28th September 2011, 14:04
  3. qtMobility and symbian contacts
    By fuoco66 in forum Newbie
    Replies: 5
    Last Post: 14th March 2011, 00:25
  4. Qt + QtWebkit + OpenStreetMap + Nokia 5800 XM
    By Tadas in forum Qt Programming
    Replies: 0
    Last Post: 7th November 2010, 19:30
  5. Qt GUI application appears as white in Nokia 5800
    By biswajithit in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 1st February 2010, 09:34

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.