本文整理汇总了C++中QSharedPointer::AddChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ QSharedPointer::AddChildren方法的具体用法?C++ QSharedPointer::AddChildren怎么用?C++ QSharedPointer::AddChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSharedPointer
的用法示例。
在下文中一共展示了QSharedPointer::AddChildren方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AssignItemsForOperation
void QuickEdit::AssignItemsForOperation(QSharedPointer<TreeItemInterface> root, BrowserNode* node)
{
QList<QSharedPointer<TreeItemInterface>> items;
auto interfaceItem = CreateInterfaceNode(root, operationController, node);
BrowserOperation* operationNode = static_cast<BrowserOperation*>(node);
// first we make a dummy node for return type
QSharedPointer<BrowserNode> returnType(new BrowserOperationReturnType(dummyView, operationNode));
QList<QSharedPointer<BrowserNode>> operationNodes;
operationNodes << returnType;
// next we make dummy nodes for all attributes
int paramCount = ((OperationData*)operationNode->get_data())->nparams;
for (int i = 0; i < paramCount; ++i)
{
QSharedPointer<BrowserNode> param(new BrowserOperationAttribute(dummyView,
operationNode,
((OperationData*)operationNode->get_data())->params[i]));
operationNodes << param;
items << CreateInterfaceNode(interfaceItem, operationAttributeController, param.data());
}
interfaceItem->AddChildren(items);
root->AddChildren(QList<QSharedPointer<TreeItemInterface>>() << interfaceItem);
localNodeHolder.append(operationNodes);
}
示例2: AssignItemsForClass
void QuickEdit::AssignItemsForClass(QSharedPointer<TreeItemInterface> root, BrowserNode* classNode)
{
auto interfaceItem = CreateInterfaceNode(root, classController, classNode);
auto children = classNode->children(validTypes);
std::reverse(children.begin(), children.end());
for (const auto& child : children)
{
if (!child)
continue;
UmlCode nodeType = child->get_type();
itemCreators[nodeType](interfaceItem, child);
}
root->AddChildren(QList<QSharedPointer<TreeItemInterface>>() << interfaceItem);
}
示例3: AssignItemsForExtraNode
void QuickEdit::AssignItemsForExtraNode(QSharedPointer<TreeItemInterface> root, BrowserNode * extraNode)
{
QSharedPointer<TreeItemInterface > interfaceItem = CreateInterfaceNode(root, extraNodeController, extraNode);
root->AddChildren(QList<QSharedPointer<TreeItemInterface> >() << interfaceItem);
}
示例4: AssignItemsForRelation
void QuickEdit::AssignItemsForRelation(QSharedPointer<TreeItemInterface> root, BrowserNode * classNode)
{
QSharedPointer<TreeItemInterface > interfaceItem = CreateInterfaceNode(root, relationController, classNode);
root->AddChildren(QList<QSharedPointer<TreeItemInterface> >() << interfaceItem);
}
示例5: AssignItemsForAttribute
void QuickEdit::AssignItemsForAttribute(QSharedPointer<TreeItemInterface> root, BrowserNode* classNode)
{
auto interfaceItem = CreateInterfaceNode(root, attributeController, classNode);
root->AddChildren(QList<QSharedPointer<TreeItemInterface>>() << interfaceItem);
}