本文整理汇总了C++中ModelNode::internalNode方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelNode::internalNode方法的具体用法?C++ ModelNode::internalNode怎么用?C++ ModelNode::internalNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelNode
的用法示例。
在下文中一共展示了ModelNode::internalNode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reparentHere
void NodeAbstractProperty::reparentHere(const ModelNode &modelNode, bool isNodeList)
{
if (modelNode.parentProperty() == *this)
return;
Internal::WriteLocker locker(model());
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
if (isNodeProperty()) {
NodeProperty nodeProperty(toNodeProperty());
if (nodeProperty.modelNode().isValid())
throw InvalidReparentingException(__LINE__, __FUNCTION__, __FILE__);
}
if (modelNode.isAncestorOf(parentModelNode()))
throw InvalidReparentingException(__LINE__, __FUNCTION__, __FILE__);
if (internalNode()->hasProperty(name()) && !internalNode()->property(name())->isNodeAbstractProperty())
model()->d->removeProperty(internalNode()->property(name()));
if (modelNode.hasParentProperty()) {
Internal::InternalNodeAbstractProperty::Pointer oldParentProperty = modelNode.internalNode()->parentProperty();
model()->d->reparentNode(internalNode(), name(), modelNode.internalNode(), isNodeList);
Q_ASSERT(!oldParentProperty.isNull());
} else {
model()->d->reparentNode(internalNode(), name(), modelNode.internalNode(), isNodeList);
}
}
示例2: indexOf
int NodeAbstractProperty::indexOf(const ModelNode &node) const
{
Internal::InternalNodeAbstractProperty::Pointer property = internalNode()->nodeAbstractProperty(name());
if (property.isNull())
return 0;
return property->indexOf(node.internalNode());
}
示例3: 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
}
示例4: deselectModelNode
/*!
Removes \a node from the selection list.
*/
void AbstractView::deselectModelNode(const ModelNode &node)
{
model()->d->deselectNode(node.internalNode());
}
示例5: isSelectedModelNode
bool AbstractView::isSelectedModelNode(const ModelNode &modelNode) const
{
return model()->d->selectedNodes().contains(modelNode.internalNode());
}