Hello,
I want to get those small pictures associated with contacts. I guess these are "Avatars". I am testing on a 5800XM because it is the only platform with
I know for sure that at least two of my contacts on my phone have those pictures.
I tried the following to obtain the path of the avatar:
Code:
QContactManager manager(QString("symbian"), QMap<QString,QString>(), this);
QList<QContactLocalId> contactIds = manager.contacts(QContactFilter());
foreach (const QContactLocalId & id, contactIds) {
QContact contact(manager.contact(id));
QContactName name(contact.detail(QContactName::DefinitionName));
//qDebug() << name.first();
//QContactAvatar avatar(contact.detail<QContactAvatar>());
QContactAvatar avatar(contact.detail(QContactAvatar::DefinitionName));
QString avatar_path(avatar.avatar());
if (!avatar_path.isEmpty()) {
qDebug() << avatar_path;
}
}
Getting name works, I get all 170 names when I comment the line with the name in. But the avatar.avatar() always returns an empty string. I tried both ways, the commented and the not commented one to get the avatar path.
- Should this work?
- Any idea why it does not work?
- Which one is the preferred way to access the avatar?
- Why are there two ways to access the detail? By template and by "DefinitionName"?
- Why is <QContactAvatar> include file missing in the package?