本文整理汇总了C++中QXmppVCardIq::from方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmppVCardIq::from方法的具体用法?C++ QXmppVCardIq::from怎么用?C++ QXmppVCardIq::from使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QXmppVCardIq
的用法示例。
在下文中一共展示了QXmppVCardIq::from方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vCardReceived
void Xmpp::vCardReceived (const QXmppVCardIq& vCard)
{
QByteArray photo = vCard.photo();
QBuffer buffer;
buffer.setData (photo);
buffer.open (QIODevice::ReadOnly);
QImageReader imageReader (&buffer);
QImage image = imageReader.read();
if (image.isNull())
image = QImage (":/faces/faces/generic-user.png");
jids.append (vCard.from());
users.append (vCard.fullName());
emit newUser (vCard.fullName(), vCard.from(), image);
}
示例2: slotvCardReceived
//得到好友形象信息
void CFrmUserList::slotvCardReceived(const QXmppVCardIq& vCard)
{
QString jid = QXmppUtils::jidToBareJid(vCard.from());
QMap<QString, CRoster*>::iterator it = m_Rosters.find(jid);
if(m_Rosters.end() != it)
{
it.value()->SetVCard(vCard);
}
}
示例3: initVCard
void MyXmppClient::initVCard(const QXmppVCardIq &vCard)
{
QString bareJid = vCard.from();
RosterItemModel *item = (RosterItemModel*)cachedRoster->find( bareJid );
vCardData dataVCard;
if( item != 0 )
{
/* set nickname */
QXmppRosterIq::Item itemRoster = rosterManager->getRosterEntry( bareJid );
QString nickName = vCard.nickName();
if( (!nickName.isEmpty()) && (!nickName.isNull()) && (itemRoster.name().isEmpty()) ) {
qDebug() << "MyXmppClient::initPresence: updating name for"<< bareJid;
item->setContactName( nickName );
}
/* avatar */
bool isAvatarCreated = true;
QString avatarFile = cacheIM->getAvatarCache( bareJid );
if( (avatarFile.isEmpty() || avatarFile == "qrc:/avatar" || (flVCardRequest != "")) && vCard.photo() != "" ) {
isAvatarCreated = cacheIM->setAvatarCache( bareJid, vCard.photo() );
}
item->setAvatar(cacheIM->getAvatarCache(bareJid));
dataVCard.nickName = nickName;
dataVCard.firstName = vCard.firstName();
dataVCard.fullName = vCard.fullName();;
dataVCard.middleName = vCard.middleName();
dataVCard.lastName = vCard.lastName();
dataVCard.url = vCard.url();
dataVCard.eMail = vCard.email();
if( flVCardRequest == bareJid ) {
qmlVCard->setPhoto( avatarFile );
qmlVCard->setNickName( vCard.nickName() );
qmlVCard->setMiddleName( vCard.middleName() );
qmlVCard->setLastName( vCard.lastName() );
qmlVCard->setFullName( vCard.fullName() );
qmlVCard->setName( vCard.firstName() );
qmlVCard->setBirthday( vCard.birthday().toString("dd.MM.yyyy") );
qmlVCard->setEMail( vCard.email() );
qmlVCard->setUrl( vCard.url() );
qmlVCard->setJid( bareJid );
flVCardRequest = "";
emit vCardChanged();
}
cacheIM->setVCard( bareJid, dataVCard );
}
}
示例4: vCardReceived
void vCardCache::vCardReceived(const QXmppVCardIq& vcard)
{
QString from = vcard.from();
if(from.isEmpty() && m_client)
from = m_client->configuration().jidBare();
m_mapBareJidVcard[from] = vcard;
saveToFile(from);
emit vCardReadyToUse(from);
}
示例5: handleStanza
bool QXmppVCardManager::handleStanza(const QDomElement &element)
{
if(element.tagName() == "iq" && QXmppVCardIq::isVCard(element))
{
QXmppVCardIq vCardIq;
vCardIq.parse(element);
if(vCardIq.from().isEmpty())
{
m_clientVCard = vCardIq;
m_isClientVCardReceived = true;
emit clientVCardReceived();
}
emit vCardReceived(vCardIq);
return true;
}
return false;
}
示例6: initVCard
void MyXmppClient::initVCard(const QXmppVCardIq &vCard)
{
QString bareJid = vCard.from();
RosterItemModel *item = (RosterItemModel*)cachedRoster->find( bareJid );
vCardData dataVCard;
if( item != 0 )
{
/* set nickname */
QXmppRosterIq::Item itemRoster = rosterManager->getRosterEntry( bareJid );
QString nickName = vCard.nickName();
if( (!nickName.isEmpty()) && (!nickName.isNull()) && (itemRoster.name().isEmpty()) ) {
qDebug() << "MyXmppClient::initPresence: updating name for"<< bareJid;
item->setContactName( nickName );
}
/* avatar */
bool isAvatarCreated = true;
QString avatarFile = cacheIM->getAvatarCache( bareJid );
if( (avatarFile.isEmpty() || avatarFile == "qrc:/avatar") && vCard.photo() != "" && !disableAvatarCaching) {
isAvatarCreated = cacheIM->setAvatarCache( bareJid, vCard.photo() );
}
item->setAvatar(cacheIM->getAvatarCache(bareJid));
dataVCard.nickName = nickName;
dataVCard.firstName = vCard.firstName();
dataVCard.fullName = vCard.fullName();;
dataVCard.middleName = vCard.middleName();
dataVCard.lastName = vCard.lastName();
dataVCard.url = vCard.url();
dataVCard.eMail = vCard.email();
cacheIM->setVCard( bareJid, dataVCard );
}
}