本文整理汇总了C++中MythUIType::ParseElement方法的典型用法代码示例。如果您正苦于以下问题:C++ MythUIType::ParseElement方法的具体用法?C++ MythUIType::ParseElement怎么用?C++ MythUIType::ParseElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythUIType
的用法示例。
在下文中一共展示了MythUIType::ParseElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
{
VERBOSE_XML(VB_IMPORTANT, filename, element,
LOC_ERR + "Unknown widget type.");
return NULL;
}
if (!uitype)
{
VERBOSE_XML(VB_IMPORTANT, filename, element,
LOC_ERR + "Failed to instantiate widget type.");
return NULL;
}
if (olduitype)
{
if (typeid(*olduitype) != typeid(*uitype))
{
VERBOSE_XML(VB_IMPORTANT, filename, element, LOC_ERR +
QString("Duplicate name: '%1' in parent '%2'")
.arg(name).arg(parent->objectName()));
parent->DeleteChild(olduitype);
}
else
{
parent->DeleteChild(uitype);
uitype = olduitype;
}
}
if (base)
{
if (typeid(*base) != typeid(*uitype))
{
VERBOSE_XML(VB_IMPORTANT, filename, element, LOC_ERR +
QString("Type of new widget '%1' doesn't "
"match old '%2'")
.arg(name).arg(inherits));
parent->DeleteChild(uitype);
return NULL;
}
else
uitype->CopyFrom(base);
}
for (QDomNode child = element.firstChild(); !child.isNull();
child = child.nextSibling())
{
QDomElement info = child.toElement();
if (!info.isNull())
{
if (uitype->ParseElement(filename, info, showWarnings))
{
}
else if (info.tagName() == "font" || info.tagName() == "fontdef")
{
bool global = (GetGlobalObjectStore() == parent);
MythFontProperties *font = MythFontProperties::ParseFromXml(
filename, info, parent, global, showWarnings);
if (!global && font)
{
QString name = info.attribute("name");
uitype->AddFont(name, font);
}
delete font;
}
else if (info.tagName() == "imagetype" ||
info.tagName() == "textarea" ||
info.tagName() == "group" ||
info.tagName() == "textedit" ||
info.tagName() == "button" ||
info.tagName() == "buttonlist" ||
info.tagName() == "buttonlist2" ||
info.tagName() == "buttontree" ||
info.tagName() == "spinbox" ||
info.tagName() == "checkbox" ||
info.tagName() == "statetype" ||
info.tagName() == "clock" ||
info.tagName() == "progressbar" ||
info.tagName() == "webbrowser" ||
info.tagName() == "guidegrid" ||
info.tagName() == "shape" ||
info.tagName() == "editbar" ||
info.tagName() == "video")
{
ParseUIType(filename, info, info.tagName(),
uitype, screen, showWarnings);
}
else
{
VERBOSE_XML(VB_IMPORTANT, filename, info,
LOC_ERR + "Unknown widget type.");
}
}
}
uitype->Finalize();
return uitype;
}