本文整理汇总了C++中QtVariantProperty::attributeValue方法的典型用法代码示例。如果您正苦于以下问题:C++ QtVariantProperty::attributeValue方法的具体用法?C++ QtVariantProperty::attributeValue怎么用?C++ QtVariantProperty::attributeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QtVariantProperty
的用法示例。
在下文中一共展示了QtVariantProperty::attributeValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: postInitializeProperty
void FontPropertyManager::postInitializeProperty(QtVariantPropertyManager *vm,
QtProperty *property,
int type,
int enumTypeId)
{
if (type != QVariant::Font)
return;
// This will cause a recursion
QtVariantProperty *antialiasing = vm->addProperty(enumTypeId, QCoreApplication::translate("FontPropertyManager", "Antialiasing"));
const QFont font = qVariantValue<QFont>(vm->variantProperty(property)->value());
antialiasing->setAttribute(QLatin1String("enumNames"), m_aliasingEnumNames);
antialiasing->setValue(antialiasingToIndex(font.styleStrategy()));
property->addSubProperty(antialiasing);
m_propertyToAntialiasing[property] = antialiasing;
m_antialiasingToProperty[antialiasing] = property;
// Fiddle family names
if (!m_familyMappings.empty()) {
const PropertyToSubPropertiesMap::iterator it = m_propertyToFontSubProperties.find(m_createdFontProperty);
QtVariantProperty *familyProperty = vm->variantProperty(it.value().front());
const QString enumNamesAttribute = QLatin1String("enumNames");
QStringList plainFamilyNames = familyProperty->attributeValue(enumNamesAttribute).toStringList();
// Did someone load fonts or something?
if (m_designerFamilyNames.size() != plainFamilyNames.size())
m_designerFamilyNames = designerFamilyNames(plainFamilyNames, m_familyMappings);
familyProperty->setAttribute(enumNamesAttribute, m_designerFamilyNames);
}
// Next
m_createdFontProperty = 0;
}