本文整理汇总了C++中QtVariantProperty::valueType方法的典型用法代码示例。如果您正苦于以下问题:C++ QtVariantProperty::valueType方法的具体用法?C++ QtVariantProperty::valueType怎么用?C++ QtVariantProperty::valueType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QtVariantProperty
的用法示例。
在下文中一共展示了QtVariantProperty::valueType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resetProperty
void AbstractItemEditor::resetProperty(QtProperty *property)
{
if (m_propertyManager->resetFontSubProperty(property))
return;
if (m_propertyManager->resetIconSubProperty(property))
return;
BoolBlocker block(m_updatingBrowser);
QtVariantProperty *prop = m_propertyManager->variantProperty(property);
int role = m_propertyToRole.value(prop);
if (role == ItemFlagsShadowRole)
prop->setValue(qVariantFromValue((int)QListWidgetItem().flags()));
else
prop->setValue(QVariant(prop->valueType(), (void *)0));
prop->setModified(false);
setItemData(role, QVariant());
if (role == Qt::DecorationPropertyRole)
setItemData(Qt::DecorationRole, qVariantFromValue(QIcon()));
if (role == Qt::DisplayPropertyRole)
setItemData(Qt::EditRole, qVariantFromValue(QString()));
if (role == Qt::ToolTipPropertyRole)
setItemData(Qt::ToolTipRole, qVariantFromValue(QString()));
if (role == Qt::StatusTipPropertyRole)
setItemData(Qt::StatusTipRole, qVariantFromValue(QString()));
if (role == Qt::WhatsThisPropertyRole)
setItemData(Qt::WhatsThisRole, qVariantFromValue(QString()));
}
示例2: setTargetProperty
void Inspector::setTargetProperty(const std::string &name, const rapidjson::Value &value)
{
auto it = name2property_.find(name);
if(it == name2property_.end())
{
return;
}
QtVariantProperty *property = dynamic_cast<QtVariantProperty*>(it->second);
if(property != nullptr)
{
int valueType = property->valueType();
QVariant qvalue;
json2tvalue(qvalue, value, valueType);
QtVariantPropertyManager *propertyMgr = PropertyItemFactory::instance()->getPropertyMgr();
propertyMgr->setValue(property, qvalue);
}
}