本文整理汇总了C++中MythUIType::CopyFrom方法的典型用法代码示例。如果您正苦于以下问题:C++ MythUIType::CopyFrom方法的具体用法?C++ MythUIType::CopyFrom怎么用?C++ MythUIType::CopyFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythUIType
的用法示例。
在下文中一共展示了MythUIType::CopyFrom方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CopyFrom
/**
* \brief Copy this widgets state from another.
*/
void MythUIType::CopyFrom(MythUIType *base)
{
m_Visible = base->m_Visible;
m_Enabled = base->m_Enabled;
m_CanHaveFocus = base->m_CanHaveFocus;
m_focusOrder = base->m_focusOrder;
SetArea(base->m_Area);
m_MinArea = base->m_MinArea;
m_MinSize = base->m_MinSize;
m_Alpha = base->m_Alpha;
m_AlphaChangeMode = base->m_AlphaChangeMode;
m_AlphaChange = base->m_AlphaChange;
m_AlphaMin = base->m_AlphaMin;
m_AlphaMax = base->m_AlphaMax;
m_Moving = base->m_Moving;
m_XYDestination = base->m_XYDestination;
m_XYSpeed = base->m_XYSpeed;
m_deferload = base->m_deferload;
QList<MythUIType *>::Iterator it;
for (it = base->m_ChildrenList.begin(); it != base->m_ChildrenList.end();
++it)
{
MythUIType *child = GetChild((*it)->objectName());
if (child)
child->CopyFrom(*it);
else
(*it)->CreateCopy(this);
}
}
示例2: 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;
}