本文整理汇总了C++中ModelNode::hasNodeListProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelNode::hasNodeListProperty方法的具体用法?C++ ModelNode::hasNodeListProperty怎么用?C++ ModelNode::hasNodeListProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelNode
的用法示例。
在下文中一共展示了ModelNode::hasNodeListProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openComponentSourcePropertyOfLoader
static void openComponentSourcePropertyOfLoader(const ModelNode &modelNode)
{
QmlDesignerPlugin::instance()->viewManager().nextFileIsCalledInternally();
QHash<PropertyName, QVariant> propertyHash;
getProperties(modelNode, propertyHash);
ModelNode componentModelNode;
if (modelNode.hasNodeProperty("sourceComponent")) {
componentModelNode = modelNode.nodeProperty("sourceComponent").modelNode();
} else if (modelNode.hasNodeListProperty("component")) {
/*
* The component property should be a NodeProperty, but currently is a NodeListProperty, because
* the default property is always implcitly a NodeListProperty. This is something that has to be fixed.
*/
componentModelNode = modelNode.nodeListProperty("component").toModelNodeList().first();
}
Core::EditorManager::openEditor(componentModelNode.metaInfo().componentFileName(), Core::Id(), Core::EditorManager::DoNotMakeVisible);
ModelNode rootModelNode = currentDesignDocument()->rewriterView()->rootModelNode();
applyProperties(rootModelNode, propertyHash);
}
示例2: isLoaderWithSourceComponent
static bool isLoaderWithSourceComponent(const ModelNode &modelNode)
{
if (modelNode.isValid()
&& modelNode.metaInfo().isValid()
&& modelNode.metaInfo().isSubclassOf("QtQuick.Loader")) {
if (modelNode.hasNodeProperty("sourceComponent"))
return true;
if (modelNode.hasNodeListProperty("component"))
return true;
}
return false;
}