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


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

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


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

示例1: getVisibleChildAt

MythGenericTree* MythGenericTree::getVisibleChildAt(uint reference) const
{
    if (reference >= (uint)m_ordered_subnodes->count())
        return NULL;

    QList<MythGenericTree*> *list;

    if (m_currentOrderingIndex == -1)
        list = m_subnodes;
    else
        list = m_ordered_subnodes;

    uint n = 0;
    for (int i = 0; i < list->size(); ++i)
    {
        MythGenericTree *child = list->at(i);
        if (child->IsVisible())
        {
            if (n == reference)
                return child;
            n++;
        }
    }

    return NULL;
}
开发者ID:Openivo,项目名称:mythtv,代码行数:26,代码来源:mythgenerictree.cpp

示例2: UpdateList

/*!
 * \brief Update a list with children of the tree node
 *
 * \param list List to refill
 * \param node Parent node whose children will appear in the list
 *
 * \return True if successful, False if the node had no children or was invalid
 */
bool MythUIButtonTree::UpdateList(MythUIButtonList *list, MythGenericTree *node)
{
    disconnect(list, 0, 0, 0);

    list->Reset();

    QList<MythGenericTree *> *nodelist = NULL;

    if (node)
        nodelist = node->getAllChildren();

    if (!nodelist || nodelist->isEmpty())
        return false;

    MythGenericTree *selectedNode = node->getSelectedChild(true);

    MythUIButtonListItem *selectedItem = NULL;
    QList<MythGenericTree *>::iterator it;

    for (it = nodelist->begin(); it != nodelist->end(); ++it)
    {
        MythGenericTree *childnode = *it;

        if (!childnode->IsVisible())
            continue;

        MythUIButtonListItem *item = childnode->CreateListButton(list);

        if (childnode == selectedNode)
            selectedItem = item;
    }

    if (list->IsEmpty())
        return false;

    if (selectedItem)
        list->SetItemCurrent(selectedItem);

    connect(list, SIGNAL(itemSelected(MythUIButtonListItem *)),
            SLOT(handleSelect(MythUIButtonListItem *)));
    connect(list, SIGNAL(itemClicked(MythUIButtonListItem *)),
            SLOT(handleClick(MythUIButtonListItem *)));
    connect(list, SIGNAL(itemVisible(MythUIButtonListItem *)),
            SLOT(handleVisible(MythUIButtonListItem *)));

    return true;
}
开发者ID:,项目名称:,代码行数:55,代码来源:

示例3: getVisibleChildAt

MythGenericTree* MythGenericTree::getVisibleChildAt(uint reference) const
{
    if (reference >= (uint)m_subnodes->count())
        return nullptr;

    QList<MythGenericTree*> *list = m_subnodes;

    uint n = 0;
    for (int i = 0; i < list->size(); ++i)
    {
        MythGenericTree *child = list->at(i);
        if (child->IsVisible())
        {
            if (n == reference)
                return child;
            n++;
        }
    }

    return nullptr;
}
开发者ID:tomhughes,项目名称:mythtv,代码行数:21,代码来源:mythgenerictree.cpp


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