Results 1 to 6 of 6

Thread: Read Contact - Symbian ^3

  1. #1
    Join Date
    Mar 2011
    Posts
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Symbian S60

    Default Read Contact - Symbian ^3

    Hi everybody, some days ago i completed an app that could print all the contact of a device on the screen,and then call one of them.
    But yersterday i add only a text box in the ui file, and from that moment the app doesn't work anymore. It works fine on the simulator(printing the name of the contact in the debug window, or in a label), but on the device it returns:
    Qt Code:
    1. [Qt Message] ASSERT failure in QList<T>::operator[]: "index out of range", file C:/QtSDK/Symbian/SDKs/Symbian3Qt473/include/QtCore/qlist.h, line 464
    2. Thread has crashed: Thread 0x876 has panicked. Category: ASSERT failure i; Reason: 0
    3. Thread has crashed: Thread 0x877 has panicked. Category: ASSERT failure i; Reason: 0
    To copy to clipboard, switch view to plain text mode 

    this is the method i use:

    Qt Code:
    1. void MainWindow::list_contact()
    2. {
    3. m_contactManager = new QContactManager("symbian");
    4. QList<QContact> contacts = m_contactManager->contacts();
    5.  
    6. QContactName name = contacts[0].detail<QContactName>();
    7.  
    8. ui->label->setText("name: " + name.firstName() + " " + name.lastName());
    9. }
    To copy to clipboard, switch view to plain text mode 

    Help?

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Read Contact - Symbian ^3

    If this is the only place where you use QList:: operator [] , then looks like contacts.count() == 0. Try to print it:
    Qt Code:
    1. void MainWindow::list_contact()
    2. {
    3. m_contactManager = new QContactManager("symbian");
    4. QList<QContact> contacts = m_contactManager->contacts();
    5. if( contacts.count() ){
    6. QContactName name = contacts[0].detail<QContactName>();
    7. ui->label->setText("name: " + name.firstName() + " " + name.lastName());
    8. } else{
    9. ui->label->setText("contact list empty");
    10. }
    11. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Mar 2011
    Posts
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Symbian S60

    Default Re: Read Contact - Symbian ^3

    Ok it works fine, and the app does'n crash anymore. But it always returns the contact list as empty. I don't understand...

  4. #4
    Join Date
    Jul 2011
    Location
    Gurgaon
    Posts
    25
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Re: Read Contact - Symbian ^3

    jshu koto roko Qt skini juin Qt 4.7 massage....sheiki......... kkk

  5. #5
    Join Date
    Mar 2011
    Posts
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Symbian S60

    Default Re: Read Contact - Symbian ^3

    Please english... I didn't understand...

  6. #6
    Join Date
    Apr 2011
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Re: Read Contact - Symbian ^3

    I don't know if this late answer helps now, but maybe some one who search for the same problem find this usefull.

    I had he same problem with the contact list on symbian, seems like a bug in the symbian contacts backend. Here is my thread in the qt developer forum, with some sort of workaround:
    http://developer.qt.nokia.com/forums/viewthread/8060/

    I switched to Symbian Belle lately on my Nokia N8 with Mobility 1.2 and this bug seems to be solved, i can retrieve all contacts as excpected.

Similar Threads

  1. Replies: 0
    Last Post: 1st June 2011, 15:17
  2. How to create a contact group
    By loolz in forum Qt Programming
    Replies: 0
    Last Post: 8th January 2011, 22:50
  3. Replies: 1
    Last Post: 9th September 2010, 16:49
  4. How to create collapsing type contact list
    By The Storm in forum Qt Programming
    Replies: 38
    Last Post: 10th October 2009, 13:34
  5. How can I contact a DLL using Qt.
    By srohit24 in forum Qt Programming
    Replies: 3
    Last Post: 19th February 2009, 04:58

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.