本文整理汇总了C++中MythUIText::SetTextFromMap方法的典型用法代码示例。如果您正苦于以下问题:C++ MythUIText::SetTextFromMap方法的具体用法?C++ MythUIText::SetTextFromMap怎么用?C++ MythUIText::SetTextFromMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythUIText
的用法示例。
在下文中一共展示了MythUIText::SetTextFromMap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetTextFromMap
void MythUIStateType::SetTextFromMap(const InfoMap &infoMap)
{
if (m_ObjectsByName.isEmpty() && m_ObjectsByState.isEmpty())
return;
QMap<QString, MythUIType *>::Iterator i;
for (i = m_ObjectsByName.begin(); i != m_ObjectsByName.end(); ++i)
{
MythUIType *type = i.value();
MythUIText *textType = dynamic_cast<MythUIText *> (type);
if (textType)
textType->SetTextFromMap(infoMap);
MythUIComposite *group = dynamic_cast<MythUIComposite *> (type);
if (group)
group->SetTextFromMap(infoMap);
}
QMap<int, MythUIType *>::Iterator j;
for (j = m_ObjectsByState.begin(); j != m_ObjectsByState.end(); ++j)
{
MythUIType *type = j.value();
MythUIText *textType = dynamic_cast<MythUIText *> (type);
if (textType)
textType->SetTextFromMap(infoMap);
MythUIComposite *group = dynamic_cast<MythUIComposite *> (type);
if (group)
group->SetTextFromMap(infoMap);
}
}
示例2: DoSetTextFromMap
static void DoSetTextFromMap(MythUIType *UItype, QHash<QString, QString> &infoMap)
{
QList<MythUIType *> *children = UItype->GetAllChildren();
MythUIText *textType;
QMutableListIterator<MythUIType *> i(*children);
while (i.hasNext())
{
MythUIType *type = i.next();
if (!type->IsVisible())
continue;
textType = dynamic_cast<MythUIText *> (type);
if (textType && infoMap.contains(textType->objectName()))
textType->SetTextFromMap(infoMap);
MythUIGroup *group = dynamic_cast<MythUIGroup *> (type);
if (group)
DoSetTextFromMap(type, infoMap);
}
}