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:
Code:
[Qt Message] ASSERT failure in QList<T>::operator[]: "index out of range", file C:/QtSDK/Symbian/SDKs/Symbian3Qt473/include/QtCore/qlist.h, line 464
Thread has crashed: Thread 0x876 has panicked. Category: ASSERT failure i; Reason: 0
Thread has crashed: Thread 0x877 has panicked. Category: ASSERT failure i; Reason: 0
this is the method i use:
Code:
void MainWindow::list_contact()
{
m_contactManager = new QContactManager("symbian");
QList<QContact> contacts = m_contactManager->contacts();
QContactName name = contacts[0].detail<QContactName>();
ui->label->setText("name: " + name.firstName() + " " + name.lastName());
}
Help?
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:
Code:
void MainWindow::list_contact()
{
m_contactManager = new QContactManager("symbian");
QList<QContact> contacts = m_contactManager->contacts();
if( contacts.count() ){
QContactName name = contacts[0].detail<QContactName>();
ui->label->setText("name: " + name.firstName() + " " + name.lastName());
} else{
ui->label->setText("contact list empty");
}
}
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...
Re: Read Contact - Symbian ^3
jshu koto roko Qt skini juin Qt 4.7 massage....sheiki......... kkk
Re: Read Contact - Symbian ^3
Please english... I didn't understand...
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.