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


C++ QSharedPointer::AddChildren方法代码示例

本文整理汇总了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);
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:25,代码来源:quickedit.cpp

示例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);
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:14,代码来源:quickedit.cpp

示例3: AssignItemsForExtraNode

void QuickEdit::AssignItemsForExtraNode(QSharedPointer<TreeItemInterface> root, BrowserNode * extraNode)
{
    QSharedPointer<TreeItemInterface > interfaceItem = CreateInterfaceNode(root, extraNodeController, extraNode);
    root->AddChildren(QList<QSharedPointer<TreeItemInterface> >() << interfaceItem);

}
开发者ID:open-src,项目名称:douml,代码行数:6,代码来源:quickedit.cpp

示例4: AssignItemsForRelation

void QuickEdit::AssignItemsForRelation(QSharedPointer<TreeItemInterface> root,  BrowserNode * classNode)
{
    QSharedPointer<TreeItemInterface > interfaceItem = CreateInterfaceNode(root, relationController, classNode);
    root->AddChildren(QList<QSharedPointer<TreeItemInterface> >() << interfaceItem);
}
开发者ID:open-src,项目名称:douml,代码行数:5,代码来源:quickedit.cpp

示例5: AssignItemsForAttribute

void QuickEdit::AssignItemsForAttribute(QSharedPointer<TreeItemInterface> root, BrowserNode* classNode)
{
    auto interfaceItem = CreateInterfaceNode(root, attributeController, classNode);
    root->AddChildren(QList<QSharedPointer<TreeItemInterface>>() << interfaceItem);
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:5,代码来源:quickedit.cpp


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