本文整理汇总了C++中MythUIType::SetXMLName方法的典型用法代码示例。如果您正苦于以下问题:C++ MythUIType::SetXMLName方法的具体用法?C++ MythUIType::SetXMLName怎么用?C++ MythUIType::SetXMLName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythUIType
的用法示例。
在下文中一共展示了MythUIType::SetXMLName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
{
if (typeid(*olduitype) != typeid(*uitype))
{
VERBOSE_XML(VB_GENERAL, LOG_ERR, filename, element,
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_GENERAL, LOG_ERR, filename, element,
QString("Type of new widget '%1' doesn't match old '%2'")
.arg(name).arg(inherits));
if (parent)
parent->DeleteChild(uitype);
return NULL;
}
else
uitype->CopyFrom(base);
}
QString dependee = element.attribute("depends", "");
if (!dependee.isEmpty())
parentDependsMap.insert(name, dependee);
QFileInfo fi(filename);
uitype->SetXMLName(name);
uitype->SetXMLLocation(fi.fileName(), element.lineNumber());
// If this was copied from another uitype then it already has a depends
// map so we want to append to that one
QMap<QString, QString> dependsMap = uitype->GetDependsMap();
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() == "scrollbar" ||
info.tagName() == "webbrowser" ||
info.tagName() == "guidegrid" ||
info.tagName() == "shape" ||
info.tagName() == "editbar" ||
info.tagName() == "video")
{
ParseUIType(filename, info, info.tagName(),
uitype, screen, showWarnings, dependsMap);
}
else
{
VERBOSE_XML(VB_GENERAL, LOG_ERR, filename, info,
"Unknown widget type.");
}
}
}
uitype->SetDependsMap(dependsMap);
uitype->Finalize();
return uitype;
}