当前位置: 首页>>代码示例>>C++>>正文


C++ MythUIType::SetXMLName方法代码示例

本文整理汇总了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;
}
开发者ID:DaveDaCoda,项目名称:mythtv,代码行数:101,代码来源:xmlparsebase.cpp


注:本文中的MythUIType::SetXMLName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。