本文整理汇总了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);
}
}
示例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);
}
}
}
}
示例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;
}
示例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);
}
示例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);
}