Hi
I'm writing a new application on Qt&Symbian. But i need to access contacts list and i want to assign contacts list into QString array. How can i do this.
Thanks.
Hi
I'm writing a new application on Qt&Symbian. But i need to access contacts list and i want to assign contacts list into QString array. How can i do this.
Thanks.
it could help only as quickstart then look at official doc and wiki
#ifndef CONTACTS_H
#define CONTACTS_H
#include <QObject>
#include "qtcontacts.h"
QTM_USE_NAMESPACE
class Contacts : public QObject
{
Q_OBJECT
public:
explicit Contacts(QObject *parent = 0);
QContactManager *m_manager;
QList<QContact> m_contacts;
QContactFilter m_currentFilter;
signals:
public slots:
};#include <QDebug>
#include "contacts.h"
#ifdef BUILD_VERSIT
#include "qversitreader.h"
#include "qversitcontactimporter.h"
#include "qversitwriter.h"
#include "qversitcontactexporter.h"
#endif
Contacts::Contacts(QObject *parent) : QObject(parent){
m_manager = new QContactManager("symbian");
m_currentFilter = QContactFilter();
m_contacts = m_manager->contacts(m_currentFilter);
foreach (QContact contact, m_contacts) {
QString s=contact.displayLabel();
QContactDetail detail=contact.detail(QContactPhoneNumber:efinitionName);
QString p=detail.value("PhoneNumber");
//qDebug()<<s<<p;
}
}CONFIG += mobility
MOBILITY = contacts
contains(mobility_modules,versit) {
MOBILITY += versit
DEFINES += BUILD_VERSIT
}
Last edited by lucarocchi; 2011-01-01 at 18:34.
Keep it simple, stupid (I think to myself)
borg - http://store.ovi.com/content/116105