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