本文整理汇总了C++中QContactDetailDefinition::setName方法的典型用法代码示例。如果您正苦于以下问题:C++ QContactDetailDefinition::setName方法的具体用法?C++ QContactDetailDefinition::setName怎么用?C++ QContactDetailDefinition::setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QContactDetailDefinition
的用法示例。
在下文中一共展示了QContactDetailDefinition::setName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QString
/*!
* Returns a map of identifier to detail definition which are valid for contacts whose type is the given \a contactType
* which are valid for the contacts in this store
*/
QMap<QString, QContactDetailDefinition> CntSymbianSimEngine::detailDefinitions(const QString& contactType, QContactManager::Error* error) const
{
if (!supportedContactTypes().contains(contactType)) {
// Should never happen
*error = QContactManager::NotSupportedError;
return QMap<QString, QContactDetailDefinition>();
}
// Get store information
SimStoreInfo storeInfo = d->m_simStore->storeInfo();
// the map we will eventually return
QMap<QString, QContactDetailDefinition> retn;
// local variables for reuse
QMap<QString, QContactDetailFieldDefinition> fields;
QContactDetailFieldDefinition f;
QContactDetailDefinition def;
QVariantList subTypes;
// sync target
def.setName(QContactSyncTarget::DefinitionName);
fields.clear();
f.setDataType(QVariant::String);
subTypes.clear();
subTypes << QString(QLatin1String(KSimSyncTarget));
f.setAllowableValues(subTypes);
fields.insert(QContactSyncTarget::FieldSyncTarget, f);
def.setFields(fields);
def.setUnique(true);
retn.insert(def.name(), def);
// type
def.setName(QContactType::DefinitionName);
fields.clear();
f.setDataType(QVariant::String);
subTypes.clear();
// groups are not supported
subTypes << QString(QLatin1String(QContactType::TypeContact));
f.setAllowableValues(subTypes);
fields.insert(QContactType::FieldType, f); // note: NO CONTEXT!!
def.setFields(fields);
def.setUnique(true);
retn.insert(def.name(), def);
/* TODO
// guid
def.setName(QContactGuid::DefinitionName);
fields.clear();
f.setDataType(QVariant::String);
f.setAllowableValues(QVariantList());
fields.insert(QContactGuid::FieldGuid, f);
f.setDataType(QVariant::StringList);
f.setAllowableValues(contexts);
fields.insert(QContactDetail::FieldContext, f);
def.setFields(fields);
def.setUnique(false);
def.setAccessConstraint(QContactDetailDefinition::CreateOnly);
retn.insert(def.name(), def);
*/
// display label
def.setName(QContactDisplayLabel::DefinitionName);
fields.clear();
f.setDataType(QVariant::String);
f.setAllowableValues(QVariantList());
fields.insert(QContactDisplayLabel::FieldLabel, f);
def.setFields(fields);
def.setUnique(true);
retn.insert(def.name(), def);
// email support needs to be checked run-time, because it is SIM specific
if (storeInfo.m_emailSupported) {
def.setName(QContactEmailAddress::DefinitionName);
fields.clear();
f.setDataType(QVariant::String);
f.setAllowableValues(QVariantList());
fields.insert(QContactEmailAddress::FieldEmailAddress, f);
def.setFields(fields);
def.setUnique(true);
retn.insert(def.name(), def);
}
// phone number
def.setName(QContactPhoneNumber::DefinitionName);
fields.clear();
f.setDataType(QVariant::String);
f.setAllowableValues(QVariantList());
fields.insert(QContactPhoneNumber::FieldNumber, f);
// TODO: subtypes supported in case a sim contact can have multiple phone numbers?
def.setFields(fields);
if (storeInfo.m_additionalNumberSupported) {
// multiple numbers supported
def.setUnique(false);
} else {
// only one phone number allowed
//.........这里部分代码省略.........