当前位置: 首页>>代码示例>>C++>>正文


C++ ModelNode类代码示例

本文整理汇总了C++中ModelNode的典型用法代码示例。如果您正苦于以下问题:C++ ModelNode类的具体用法?C++ ModelNode怎么用?C++ ModelNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ModelNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createNodeFromNode

static ModelNode createNodeFromNode(const ModelNode &modelNode,const QHash<QString, QString> &idRenamingHash, AbstractView *view)
{
    QList<QPair<QString, QVariant> > propertyList;
    QList<QPair<QString, QVariant> > variantPropertyList;
    foreach (const VariantProperty &variantProperty, modelNode.variantProperties()) {
        propertyList.append(QPair<QString, QVariant>(variantProperty.name(), variantProperty.value()));
    }
    ModelNode newNode(view->createModelNode(modelNode.type(),modelNode.majorVersion(),modelNode.minorVersion(),
                                            propertyList, variantPropertyList, modelNode.nodeSource(), modelNode.nodeSourceType()));
    syncBindingProperties(newNode, modelNode, idRenamingHash);
    syncId(newNode, modelNode, idRenamingHash);
    syncNodeProperties(newNode, modelNode, idRenamingHash, view);
    syncNodeListProperties(newNode, modelNode, idRenamingHash, view);

    return newNode;
}
开发者ID:,项目名称:,代码行数:16,代码来源:

示例2: nodeIdChanged

void ModelToTextMerger::nodeIdChanged(const ModelNode& node, const QString& newId, const QString& oldId)
{
    if (!node.isInHierarchy())
        return;

    schedule(new ChangeIdRewriteAction(node, oldId, newId));
}
开发者ID:OnlineCop,项目名称:qt-creator,代码行数:7,代码来源:modeltotextmerger.cpp

示例3: Q_ASSERT

void NestedListModel::setProperty(int index, const QString& property, const QVariant& value, QList<int> *roles)
{
    Q_ASSERT(index >=0 && index < count());

    ModelNode *node = qvariant_cast<ModelNode *>(_root->values.at(index));
    bool emitItemsChanged = node->setProperty(property, value);
    if (!emitItemsChanged)
        return;

    int r = roleStrings.indexOf(property);
    if (r < 0) {
        r = roleStrings.count();
        roleStrings << property;
    }
    roles->append(r);
}
开发者ID:stephaneAG,项目名称:PengPod700,代码行数:16,代码来源:qdeclarativelistmodel.cpp

示例4: wantHandleItem

int TextTool::wantHandleItem(const ModelNode &modelNode) const
{
    if (modelNode.metaInfo().hasProperty("text"))
        return 20;

    return 0;
}
开发者ID:qtproject,项目名称:qt-creator,代码行数:7,代码来源:texttool.cpp

示例5: goIntoComponent

void DocumentManager::goIntoComponent(const ModelNode &modelNode)
{
    if (modelNode.isValid() && modelNode.isComponent()) {
        QmlDesignerPlugin::instance()->viewManager().setComponentNode(modelNode);
        if (isFileComponent(modelNode))
            openFileComponent(modelNode);
        else if (hasDelegateWithFileComponent(modelNode))
            openFileComponentForDelegate(modelNode);
        else if (hasSourceWithFileComponent(modelNode))
            openSourcePropertyOfLoader(modelNode);
        else if (isLoaderWithSourceComponent(modelNode))
            openComponentSourcePropertyOfLoader(modelNode);
        else
            openInlineComponent(modelNode);
    }
}
开发者ID:OnlineCop,项目名称:qt-creator,代码行数:16,代码来源:documentmanager.cpp

示例6: removeSingleNodeFromList

void ComponentView::removeSingleNodeFromList(const ModelNode &node)
{
    for (int row = 0; row < m_standardItemModel->rowCount(); row++) {
        if (m_standardItemModel->item(row)->data(ModelNodeRole).toInt() == node.internalId())
            m_standardItemModel->removeRow(row);
    }
}
开发者ID:ProDataLab,项目名称:qt-creator,代码行数:7,代码来源:componentview.cpp

示例7: ModelStructureTreeNode

ModelStructure::ModelStructure(const ModelNode &node)
    : m_latestNode(new ModelStructureTreeNode(node)),
      m_latestIndent(0)
{
    Q_ASSERT(node.indent()==0);
    m_roots << m_latestNode;
}
开发者ID:sandsmark,项目名称:zanshin,代码行数:7,代码来源:modelstructure.cpp

示例8: wantHandleItem

int ColorTool::wantHandleItem(const ModelNode &modelNode) const
{
    if (modelNode.metaInfo().hasProperty("color"))
        return 10;

    return 0;
}
开发者ID:jay602,项目名称:QmlDesignerPlus,代码行数:7,代码来源:colortool.cpp

示例9: nodeCreated

void NodeInstanceView::nodeCreated(const ModelNode &createdNode)
{
    NodeInstance instance = loadNode(createdNode);

    if (isSkippedNode(createdNode))
        return;

    QList<VariantProperty> propertyList;
    propertyList.append(createdNode.variantProperty("x"));
    propertyList.append(createdNode.variantProperty("y"));
    updatePosition(propertyList);

    nodeInstanceServer()->createInstances(createCreateInstancesCommand(QList<NodeInstance>() << instance));
    nodeInstanceServer()->changePropertyValues(createChangeValueCommand(createdNode.variantProperties()));
    nodeInstanceServer()->completeComponent(createComponentCompleteCommand(QList<NodeInstance>() << instance));
}
开发者ID:AgnosticPope,项目名称:qt-creator,代码行数:16,代码来源:nodeinstanceview.cpp

示例10: instanceForModelNode

/*!
    Returns the node instance for \a node, which must be valid.

    Returns an invalid node instance if no node instance for this model node
    exists.

    \sa NodeInstance
*/
NodeInstance NodeInstanceView::instanceForModelNode(const ModelNode &node) const
{
    Q_ASSERT(node.isValid());
    Q_ASSERT(m_nodeInstanceHash.contains(node));
    Q_ASSERT(m_nodeInstanceHash.value(node).modelNode() == node);
    return m_nodeInstanceHash.value(node);
}
开发者ID:AgnosticPope,项目名称:qt-creator,代码行数:15,代码来源:nodeinstanceview.cpp

示例11: NodeInstanceServerProxy

void NodeInstanceView::modelAttached(Model *model)
{
    AbstractView::modelAttached(model);
    m_nodeInstanceServer = new NodeInstanceServerProxy(this, m_runModus, m_currentKit);
    m_lastCrashTime.start();
    connect(m_nodeInstanceServer.data(), SIGNAL(processCrashed()), this, SLOT(handleChrash()));

    if (!isSkippedRootNode(rootModelNode()))
        nodeInstanceServer()->createScene(createCreateSceneCommand());

    ModelNode stateNode = currentStateNode();
    if (stateNode.isValid() && stateNode.metaInfo().isSubclassOf("QtQuick.State", 1, 0)) {
        NodeInstance newStateInstance = instanceForModelNode(stateNode);
        activateState(newStateInstance);
    }

}
开发者ID:C-sjia,项目名称:qt-creator,代码行数:17,代码来源:nodeinstanceview.cpp

示例12: foreach

void NavigatorTreeModel::propagateInvisible(const ModelNode &node, const bool &invisible)
{
    QList <ModelNode> children = node.allDirectSubModelNodes();
    foreach (ModelNode child, children) {
        child.setAuxiliaryData("childOfInvisible",invisible);
        if (!child.auxiliaryData("invisible").toBool())
            propagateInvisible(child,invisible);
    }
开发者ID:TheProjecter,项目名称:project-qtcreator,代码行数:8,代码来源:navigatortreemodel.cpp

示例13: indexForNode

int ComponentView::indexForNode(const ModelNode &node) const
{
    for (int row = 0; row < m_standardItemModel->rowCount(); row++) {
        if (m_standardItemModel->item(row)->data(ModelNodeRole).toInt() == node.internalId())
            return row;
    }
    return -1;
}
开发者ID:ProDataLab,项目名称:qt-creator,代码行数:8,代码来源:componentview.cpp

示例14: acceptedModelNodeChildren

static QList<ModelNode> acceptedModelNodeChildren(const ModelNode &parentNode)
{
    QList<ModelNode> children;
    PropertyNameList properties;

    if (parentNode.metaInfo().hasDefaultProperty())
        properties.append(parentNode.metaInfo().defaultPropertyName());

#ifndef DISABLE_VISIBLE_PROPERTIES
    properties.append(visibleProperties(parentNode));
#endif

    foreach (const PropertyName &propertyName, properties) {
        AbstractProperty property(parentNode.property(propertyName));
        if (property.isNodeAbstractProperty())
            children.append(property.toNodeAbstractProperty().directSubNodes());
    }
开发者ID:AgnosticPope,项目名称:qt-creator,代码行数:17,代码来源:navigatortreemodel.cpp

示例15: 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());
}
开发者ID:anchowee,项目名称:QtCreator,代码行数:8,代码来源:nodeabstractproperty.cpp


注:本文中的ModelNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。