本文整理汇总了C++中internal::internalproperty::Pointer类的典型用法代码示例。如果您正苦于以下问题:C++ Pointer类的具体用法?C++ Pointer怎么用?C++ Pointer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Pointer类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setExpression
void BindingProperty::setExpression(const QString &expression)
{
Internal::WriteLocker locker(model());
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
if (name() == "id") { // the ID for a node is independent of the state, so it has to be set with ModelNode::setId
throw InvalidPropertyException(__LINE__, __FUNCTION__, __FILE__, name());
}
if (expression.isEmpty())
throw InvalidArgumentException(__LINE__, __FUNCTION__, __FILE__, name());
if (internalNode()->hasProperty(name())) { //check if oldValue != value
Internal::InternalProperty::Pointer internalProperty = internalNode()->property(name());
if (internalProperty->isBindingProperty()
&& internalProperty->toBindingProperty()->expression() == expression)
return;
}
if (internalNode()->hasProperty(name()) && !internalNode()->property(name())->isBindingProperty())
model()->d->removeProperty(internalNode()->property(name()));
model()->d->setBindingProperty(internalNode(), name(), expression);
}
示例2: setValue
void VariantProperty::setValue(const QVariant &value)
{
Internal::WriteLocker locker(model());
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
if (isDynamic())
qWarning() << "Calling VariantProperty::setValue on dynamic property.";
if (value.isNull())
throw InvalidArgumentException(__LINE__, __FUNCTION__, __FILE__, name());
if (internalNode()->hasProperty(name())) { //check if oldValue != value
Internal::InternalProperty::Pointer internalProperty = internalNode()->property(name());
if (internalProperty->isVariantProperty()
&& internalProperty->toVariantProperty()->value() == value
&& dynamicTypeName().isEmpty())
return;
}
if (internalNode()->hasProperty(name()) && !internalNode()->property(name())->isVariantProperty())
model()->d->removeProperty(internalNode()->property(name()));
model()->d->setVariantProperty(internalNode(), name(), value);
}
示例3: setDynamicTypeNameAndValue
void VariantProperty::setDynamicTypeNameAndValue(const QString &type, const QVariant &value)
{
Internal::WriteLocker locker(model());
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
if (type.isEmpty()) {
throw InvalidArgumentException(__LINE__, __FUNCTION__, __FILE__, name());
}
if (internalNode()->hasProperty(name())) { //check if oldValue != value
Internal::InternalProperty::Pointer internalProperty = internalNode()->property(name());
if (internalProperty->isVariantProperty()
&& internalProperty->toVariantProperty()->value() == value
&& internalProperty->toVariantProperty()->dynamicTypeName() == type)
return;
}
if (internalNode()->hasProperty(name()) && !internalNode()->property(name())->isVariantProperty())
model()->d->removeProperty(internalNode()->property(name()));
model()->d->setDynamicVariantProperty(internalNode(), name(), type, value);
}
示例4: setSource
void SignalHandlerProperty::setSource(const QString &source)
{
Internal::WriteLocker locker(model());
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
if (name() == "id") { // the ID for a node is independent of the state, so it has to be set with ModelNode::setId
throw InvalidPropertyException(__LINE__, __FUNCTION__, __FILE__, name());
}
if (source.isEmpty())
throw InvalidArgumentException(__LINE__, __FUNCTION__, __FILE__, name());
if (internalNode()->hasProperty(name())) { //check if oldValue != value
Internal::InternalProperty::Pointer internalProperty = internalNode()->property(name());
if (internalProperty->isSignalHandlerProperty()
&& internalProperty->toSignalHandlerProperty()->source() == source)
return;
}
if (internalNode()->hasProperty(name()) && !internalNode()->property(name())->isSignalHandlerProperty())
model()->d->removeProperty(internalNode()->property(name()));
model()->d->setSignalHandlerProperty(internalNode(), name(), source);
}
示例5: modelNode
ModelNode NodeProperty::modelNode() const
{
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
if (internalNode()->hasProperty(name())) { //check if oldValue != value
Internal::InternalProperty::Pointer internalProperty = internalNode()->property(name());
if (internalProperty->isNodeProperty())
return ModelNode(internalProperty->toNodeProperty()->node(), model(), view());
}
return ModelNode();
}
示例6: setModelNode
void NodeProperty::setModelNode(const ModelNode &modelNode)
{
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
if (!modelNode.isValid())
throw InvalidArgumentException(__LINE__, __FUNCTION__, __FILE__, name());
if (internalNode()->hasProperty(name())) { //check if oldValue != value
Internal::InternalProperty::Pointer internalProperty = internalNode()->property(name());
if (internalProperty->isNodeProperty()
&& internalProperty->toNodeProperty()->node() == modelNode.internalNode())
return;
}
if (internalNode()->hasProperty(name()) && !internalNode()->property(name())->isNodeProperty())
model()->d->removeProperty(internalNode()->property(name()));
model()->d->reparentNode(internalNode(), name(), modelNode.internalNode(), false); //### we have to add a flag that this is not a list
}