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


C++ ModelNode::nodeProperty方法代码示例

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


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

示例1: handleTabComponent

static void handleTabComponent(const ModelNode &modelNode)
{
    if (modelNode.hasNodeProperty("component")
            && modelNode.nodeProperty("component").modelNode().nodeSourceType() == ModelNode::NodeWithComponentSource) {
        designDocument()->changeToSubComponent(modelNode.nodeProperty("component").modelNode());
    }
}
开发者ID:choenig,项目名称:qt-creator,代码行数:7,代码来源:documentmanager.cpp

示例2: handleDelegate

static void handleDelegate(const ModelNode &modelNode)
{
    if (modelNode.metaInfo().isView()
            && modelNode.hasNodeProperty("delegate")
            && modelNode.nodeProperty("delegate").modelNode().nodeSourceType() == ModelNode::NodeWithComponentSource)
        designDocument()->changeToSubComponent(modelNode.nodeProperty("delegate").modelNode());
}
开发者ID:choenig,项目名称:qt-creator,代码行数:7,代码来源:documentmanager.cpp

示例3: syncNodeProperties

static void syncNodeProperties(ModelNode &outputNode, const ModelNode &inputNode, const QHash<QString, QString> &idRenamingHash, AbstractView *view)
{
    foreach (const NodeProperty &nodeProperty, inputNode.nodeProperties()) {
        ModelNode newNode = createNodeFromNode(nodeProperty.modelNode(), idRenamingHash, view);
        outputNode.nodeProperty(nodeProperty.name()).reparentHere(newNode);
    }
}
开发者ID:KDE,项目名称:android-qt-creator,代码行数:7,代码来源:modelmerger.cpp

示例4: setupGradient

void GradientLineQmlAdaptor::setupGradient()
{
    if (!active())
        return;

    ModelNode modelNode = m_itemNode.modelNode();
    QLinearGradient newGradient;
    QVector<QGradientStop> stops;

    if (!modelNode.isValid())
        return;

    if (modelNode.hasBindingProperty(gradientName()))
        return;

    if (modelNode.hasProperty(gradientName())) { //gradient exists

        ModelNode gradientNode = modelNode.nodeProperty(gradientName()).modelNode();
        QList<ModelNode> stopList = gradientNode.nodeListProperty("stops").toModelNodeList();

        foreach (const ModelNode &stopNode, stopList) {
            QmlObjectNode stopObjectNode = stopNode;
            if (stopObjectNode.isValid()) {
                qreal position = stopObjectNode.modelValue("position").toReal();
                QColor color = stopObjectNode.modelValue("color").value<QColor>();
                stops.append( QPair<qreal, QColor>(position, color));
            }
        }
开发者ID:KDE,项目名称:android-qt-creator,代码行数:28,代码来源:gradientlineqmladaptor.cpp

示例5: 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);
}
开发者ID:DuinoDu,项目名称:qt-creator,代码行数:27,代码来源:documentmanager.cpp

示例6: resolveBinding

static ModelNode resolveBinding(const QString &binding, ModelNode currentNode, AbstractView* view)
{
    int i = 0;
    QString element = binding.split(QLatin1Char('.')).at(0);
    while (!element.isEmpty())
    {
        if (element == "parent") {
            if (currentNode.hasParentProperty())
                currentNode = currentNode.parentProperty().toNodeAbstractProperty().parentModelNode();
            else
                return ModelNode(); //binding not valid
        } else if (currentNode.hasProperty(element)) {
            if (currentNode.property(element).isNodeProperty()) {
                currentNode = currentNode.nodeProperty(element).modelNode();
            } else {
                currentNode = view->modelNodeForId(element); //id
                if (!currentNode.isValid())
                    return ModelNode(); //binding not valid
            }
        } else {
            currentNode = view->modelNodeForId(element); //id
        }
        i++;
        if (i < binding.split(QLatin1Char('.')).count())
            element = binding.split(QLatin1Char('.')).at(i);
        else
            element.clear();
    }
    return currentNode;

}
开发者ID:,项目名称:,代码行数:31,代码来源:

示例7: hasDelegateWithFileComponent

static bool hasDelegateWithFileComponent(const ModelNode &node)
{
    if (node.isValid()
            && node.metaInfo().isValid()
            && node.metaInfo().isView()
            && node.hasNodeProperty("delegate")
            && node.nodeProperty("delegate").modelNode().metaInfo().isFileComponent())
        return true;

    return false;
}
开发者ID:choenig,项目名称:qt-creator,代码行数:11,代码来源:documentmanager.cpp

示例8: isInEditedPath

static bool isInEditedPath(const NodeAbstractProperty &propertyParent, const ModelNode &editingPathViewModelNode)
{
    if (editingPathViewModelNode.isValid()) {
        if (editingPathViewModelNode.hasNodeProperty("path")) {
            ModelNode pathModelNode = editingPathViewModelNode.nodeProperty("path").modelNode();
            if (pathModelNode.metaInfo().isSubclassOf("QtQuick.Path")) {
                if (propertyParent.name() == "pathElements" && propertyParent.parentModelNode() == pathModelNode)
                    return true;
            }
        }
    }

    return false;
}
开发者ID:kai66673,项目名称:qt-creator,代码行数:14,代码来源:pathtoolview.cpp

示例9: accept

void BehaviorDialog::accept()
{
    QDialog::accept();
    if (m_modelNode.hasProperty(m_propertyName))
        m_modelNode.removeProperty(m_propertyName);
    if (m_ui->comboBox->currentIndex() == 0) {
        RewriterTransaction transaction(m_modelNode.view()->beginRewriterTransaction());
        ModelNode Behavior = m_modelNode.view()->createModelNode("Qt/Behavior", 4, 7);
        m_modelNode.nodeProperty(m_propertyName).reparentHere(Behavior);
        ModelNode animation = m_modelNode.view()->createModelNode("Qt/NumberAnimation", 4, 7);
        animation.variantProperty("duration") = m_ui->duration->value();
        animation.variantProperty("easing") = m_ui->curve->currentText();
        Behavior.nodeProperty("animation").reparentHere(animation);
    } else {
        RewriterTransaction transaction(m_modelNode.view()->beginRewriterTransaction());
        ModelNode springFollow = m_modelNode.view()->createModelNode("Qt/SpringFollow", 4, 7);
        m_modelNode.nodeProperty(m_propertyName).reparentHere(springFollow);
        springFollow.variantProperty("velocity") = m_ui->velocity->value();
        springFollow.variantProperty("spring") = m_ui->spring->value();
        springFollow.variantProperty("damping") = m_ui->damping->value();
        springFollow.bindingProperty("source") = m_ui->source->text();
    }
}
开发者ID:CNOT,项目名称:julia-studio,代码行数:23,代码来源:behaviordialog.cpp

示例10: addNodeChild

static ModelNode addNodeChild(const ModelNode &parentNode, const QString &typeName, int major, int minor, const QString &parentProperty)
{
    ModelNode newNode = parentNode.view()->createModelNode(typeName, major, minor);
    parentNode.nodeProperty(parentProperty).reparentHere(newNode);
    return newNode;
}
开发者ID:NoobSaibot,项目名称:qtcreator-minimap,代码行数:6,代码来源:statichelpers.cpp

示例11: openFileComponentForDelegate

static void openFileComponentForDelegate(const ModelNode &modelNode)
{
    openFileComponent(modelNode.nodeProperty("delegate").modelNode());
}
开发者ID:choenig,项目名称:qt-creator,代码行数:4,代码来源:documentmanager.cpp


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