本文整理汇总了C++中QtVariantProperty::setNameColor方法的典型用法代码示例。如果您正苦于以下问题:C++ QtVariantProperty::setNameColor方法的具体用法?C++ QtVariantProperty::setNameColor怎么用?C++ QtVariantProperty::setNameColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QtVariantProperty
的用法示例。
在下文中一共展示了QtVariantProperty::setNameColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateProperties
void ObjectTypesEditor::updateProperties()
{
const auto selectionModel = mUi->objectTypesTable->selectionModel();
const auto selectedRows = selectionModel->selectedRows();
AggregatedProperties aggregatedProperties;
for (const QModelIndex &index : selectedRows) {
ObjectType objectType = mObjectTypesModel->objectTypeAt(index);
aggregatedProperties.aggregate(objectType.defaultProperties);
}
mAddPropertyAction->setEnabled(!selectedRows.isEmpty());
mProperties = aggregatedProperties;
mUpdating = true;
mVariantManager->clear();
mNameToProperty.clear();
QMapIterator<QString, AggregatedPropertyData> it(aggregatedProperties);
while (it.hasNext()) {
it.next();
const QString &name = it.key();
const AggregatedPropertyData &data = it.value();
QtVariantProperty *property = createProperty(data.value().userType(), name);
property->setValue(data.value());
bool everywhere = data.presenceCount() == selectedRows.size();
bool consistent = everywhere && data.valueConsistent();
if (!everywhere)
property->setNameColor(Qt::gray);
if (!consistent)
property->setValueColor(Qt::gray);
}
mUpdating = false;
}