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


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

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


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

示例1: 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

示例2: searchForComponentAndAddToList

void ComponentView::searchForComponentAndAddToList(const ModelNode &node)
{
    QList<ModelNode> nodeList;
    nodeList.append(node);
    nodeList.append(node.allSubModelNodes());


    bool masterNotAdded = true;

    foreach (const ModelNode &node, nodeList) {
        if (node.nodeSourceType() == ModelNode::NodeWithComponentSource) {
            if (masterNotAdded) {
                masterNotAdded = true;
                addMasterDocument();
            }

            if (!hasEntryForNode(node)) {
                QString description = descriptionForNode(node);




                QStandardItem *item = new QStandardItem(description);
                item->setData(QVariant::fromValue(node.internalId()), ModelNodeRole);
                item->setEditable(false);
                removeSingleNodeFromList(node); //remove node if already present
                m_standardItemModel->appendRow(item);
            }
        }
    }
}
开发者ID:ProDataLab,项目名称:qt-creator,代码行数:31,代码来源:componentview.cpp

示例3: 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

示例4: createItemRow

NavigatorTreeModel::ItemRow NavigatorTreeModel::createItemRow(const ModelNode &node)
{
    Q_ASSERT(node.isValid());

    uint hash = node.internalId();

    const bool dropEnabled = node.metaInfo().isValid();

    QStandardItem *idItem = new QStandardItem;
    idItem->setDragEnabled(true);
    idItem->setDropEnabled(dropEnabled);
    idItem->setEditable(true);
    idItem->setData(hash, NavigatorRole);
    if (node.metaInfo().isValid())
        idItem->setToolTip(node.type());
    else
        idItem->setToolTip(msgUnknownItem(node.type()));
#    ifdef _LOCK_ITEMS_
    QStandardItem *lockItem = new QStandardItem;
    lockItem->setDragEnabled(true);
    lockItem->setDropEnabled(dropEnabled);
    lockItem->setEditable(false);
    lockItem->setCheckable(true);
    lockItem->setData(hash, NavigatorRole);
#    endif

    QStandardItem *visibilityItem = new QStandardItem;
    visibilityItem->setDropEnabled(dropEnabled);
    visibilityItem->setCheckable(true);
    visibilityItem->setEditable(false);
    visibilityItem->setData(hash, NavigatorRole);
    if (node.isRootNode())
        visibilityItem->setCheckable(false);

    QMap<QString, QStandardItem *> propertyItems;
    foreach (const QString &propertyName, visibleProperties(node)) {
        QStandardItem *propertyItem = new QStandardItem;
        propertyItem->setSelectable(false);
        propertyItem->setDragEnabled(false);
        propertyItem->setDropEnabled(dropEnabled);
        propertyItem->setEditable(false);
        propertyItem->setData(propertyName, Qt::DisplayRole);
        propertyItems.insert(propertyName, propertyItem);
        idItem->appendRow(propertyItem);
    }
开发者ID:darksylinc,项目名称:qt-creator,代码行数:45,代码来源:navigatortreemodel.cpp

示例5: nodeAboutToBeRemoved

/*! Notifies the view that \a removedNode will be removed.
*/
void NodeInstanceView::nodeAboutToBeRemoved(const ModelNode &removedNode)
{
    nodeInstanceServer()->removeInstances(createRemoveInstancesCommand(removedNode));
    nodeInstanceServer()->removeSharedMemory(createRemoveSharedMemoryCommand("Image", removedNode.internalId()));
    removeInstanceAndSubInstances(removedNode);
}
开发者ID:C-sjia,项目名称:qt-creator,代码行数:8,代码来源:nodeinstanceview.cpp


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