本文整理汇总了C++中MythGenericTree::getAllChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ MythGenericTree::getAllChildren方法的具体用法?C++ MythGenericTree::getAllChildren怎么用?C++ MythGenericTree::getAllChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythGenericTree
的用法示例。
在下文中一共展示了MythGenericTree::getAllChildren方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: searchStart
void GameUI::searchStart(void)
{
MythGenericTree *parent = m_gameUITree->GetCurrentNode()->getParent();
if (parent != NULL)
{
QStringList childList;
QList<MythGenericTree*>::iterator it;
QList<MythGenericTree*> *children = parent->getAllChildren();
for (it = children->begin(); it != children->end(); ++it)
{
MythGenericTree *child = *it;
childList << child->GetText();
}
MythScreenStack *popupStack =
GetMythMainWindow()->GetStack("popup stack");
MythUISearchDialog *searchDialog = new MythUISearchDialog(popupStack,
tr("Game Search"), childList, true, "");
if (searchDialog->Create())
{
connect(searchDialog, SIGNAL(haveResult(QString)),
SLOT(searchComplete(QString)));
popupStack->AddScreen(searchDialog);
}
else
delete searchDialog;
}
}
示例2: findNode
MythGenericTree* MythGenericTree::findNode(QList<int> route_of_branches,
int depth)
{
// Starting from *this* node (which will often be root) find a set of
// branches that have id's that match the collection passed in
// route_of_branches. Return the end point of those branches.
//
// In practical terms, mythmusic will use this to force the playback
// screen's ManagedTreeList to move to a given track in a given playlist
MythGenericTree *node = NULL;
for (int i = 0; i < route_of_branches.count(); i++)
{
if (!node)
node = this;
bool foundit = false;
QList<MythGenericTree*>::iterator it;
QList<MythGenericTree*> *children = node->getAllChildren();
if (!children)
break;
MythGenericTree *child = NULL;
for (it = children->begin(); it != children->end(); ++it)
{
child = *it;
if (!child)
continue;
if (child->getInt() == route_of_branches[i])
{
node = child;
foundit = true;
break;
}
}
if (!foundit)
break;
}
return NULL;
}