本文整理汇总了C++中QContact::customField方法的典型用法代码示例。如果您正苦于以下问题:C++ QContact::customField方法的具体用法?C++ QContact::customField怎么用?C++ QContact::customField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QContact
的用法示例。
在下文中一共展示了QContact::customField方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void ContactBrowser::init( const QContact& contact, ContactDocument::ContactDocumentType docType)
{
mLink.clear();
if (!mDocument)
mDocument = new ContactDocument(this);
mDocument->textDocument()->setTextWidth(width() - 10);
mDocument->init(this, contact, docType);
setDocument(mDocument->textDocument());
loadLinks(contact.customField(QDL::CLIENT_DATA_KEY));
verifyLinks();
}
示例2: findRingTone
QString RingControl::findRingTone()
{
QString ringTone;
if(DialerControl::instance()->hasIncomingCall()) {
QPhoneCall call = DialerControl::instance()->incomingCall();
QString numberOrName = call.number();
QContact cnt;
QContactModel *m = ServerContactModel::instance();
if (!call.contact().isNull()) {
cnt = m->contact(call.contact());
} else if (!numberOrName.isEmpty()) {
cnt = m->matchPhoneNumber(numberOrName);
}
if (!cnt.uid().isNull()) {
numberOrName = cnt.label();
// video ringtone
ringTone = cnt.customField( "videotone" );
if ( !ringTone.isEmpty() ) {
d->videoTone = true;
} else { // normal ringtone
ringTone = cnt.customField( "tone" );
d->videoTone = false;
}
if ( ringTone.isEmpty() ) {
// check if the contacts category has a ringtone
QList<QString> catList = cnt.categories();
if ( catList.count() ) {
QCategoryManager catManager;
ringTone = catManager.ringTone( catList.at( 0 ) );
}
d->videoTone = false;
}
}
}
return ringTone;
}