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


C++ MythGenericTree::getParent方法代码示例

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


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

示例1: RemoveItem

/*!
 * \brief Remove the item from the tree
 *
 * \param item Item to be removed
 * \param deleteNode Also delete the node from the tree? Modifies the tree.
 *
 * \return True if successful
 */
void MythUIButtonTree::RemoveItem(MythUIButtonListItem *item, bool deleteNode)
{
    if (!item || !m_rootNode)
        return;

    MythGenericTree *node = qVariantValue<MythGenericTree *>(item->GetData());

    if (node && node->getParent())
    {
        DoSetCurrentNode(node->getParent());

        if (deleteNode)
            node->getParent()->deleteNode(node);
        else
            node->SetVisible(false);
    }

    MythUIButtonList *list = item->parent();

    list->RemoveItem(item);

    if (list->IsEmpty())
    {
        if (m_currentDepth > 0)
            m_currentDepth--;
        else if (m_activeListID > 1)
            m_activeListID--;

        SetTreeState(true);
    }
}
开发者ID:,项目名称:,代码行数:39,代码来源:

示例2: while

QList<MythGenericTree*> MythGenericTree::getRoute(void)
{
    QList<MythGenericTree*> route;

    route.push_front(this);

    MythGenericTree *parent = this;
    while( (parent = parent->getParent()) )
    {
        route.push_front(parent);
    }
    return route;
}
开发者ID:Openivo,项目名称:mythtv,代码行数:13,代码来源:mythgenerictree.cpp

示例3: getRouteByString

QStringList MythGenericTree::getRouteByString()
{
    QStringList routeByString;

    routeByString.push_front(getString());

    MythGenericTree *parent = this;
    while( (parent = parent->getParent()) )
    {
        routeByString.push_front(parent->getString());
    }
    return routeByString;
}
开发者ID:Openivo,项目名称:mythtv,代码行数:13,代码来源:mythgenerictree.cpp


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