本文整理汇总了C++中QDomElement::nodeType方法的典型用法代码示例。如果您正苦于以下问题:C++ QDomElement::nodeType方法的具体用法?C++ QDomElement::nodeType怎么用?C++ QDomElement::nodeType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDomElement
的用法示例。
在下文中一共展示了QDomElement::nodeType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void Config::init(){
QDomElement root;
try{
root = Utils::openXml(":/Army/list.xml");
}
catch(...){
return;
}
if(root.tagName() != "list")
throw tr("Fichier mal formaté");
QDomNode n = root.firstChild();
ArmyFactory *factory = new ArmyFactory();
while(!n.isNull()){
QDomElement e = n.toElement();
if(e.tagName() == "army" && e.nodeType() == QDomNode::ElementNode && e.childNodes().count() == 1){
QString ids = e.attribute("id","");
if(ids == "") //No id, and we need it !
continue;
bool ok;
qint32 id = ids.toInt(&ok);
if(!ok) //it's not and Int
continue;
this->m_mArmyList.push_back( factory->getArmy(e.text(),id));
}
n = n.nextSibling();
}
}
示例2: domNotImplemented
void domNotImplemented(QDomElement e)
{
if (!MScore::debugMsg)
return;
QString s = domElementPath(e);
if (!docName.isEmpty())
fprintf(stderr, "<%s>:", qPrintable(docName));
fprintf(stderr, "%s: Node not implemented: <%s>, type %d\n",
qPrintable(s), qPrintable(e.tagName()), e.nodeType());
if (e.isText())
fprintf(stderr, " text node <%s>\n", qPrintable(e.toText().data()));
}
示例3: domNotImplemented
void domNotImplemented(const QDomElement& e)
{
if (!MScore::debugMode)
return;
QString s = domElementPath(e);
if (!docName.isEmpty())
qDebug("<%s>:", qPrintable(docName));
qDebug("%s: Node not implemented: <%s>, type %d\n",
qPrintable(s), qPrintable(e.tagName()), e.nodeType());
if (e.isText())
qDebug(" text node <%s>\n", qPrintable(e.toText().data()));
}
示例4: domError
void domError(QDomElement e)
{
QString s = domElementPath(e);
if (!docName.isEmpty())
fprintf(stderr, "<%s>:", qPrintable(docName));
int ln = e.lineNumber();
if (ln != -1)
fprintf(stderr, "line:%d ", ln);
int col = e.columnNumber();
if (col != -1)
fprintf(stderr, "col:%d ", col);
fprintf(stderr, "%s: Unknown Node <%s>, type %d\n",
qPrintable(s), qPrintable(e.tagName()), e.nodeType());
if (e.isText())
fprintf(stderr, " text node <%s>\n", qPrintable(e.toText().data()));
}
示例5: domError
void domError(const QDomElement& e)
{
QString m;
QString s = domElementPath(e);
if (!docName.isEmpty())
m = QString("<%1>:").arg(docName);
int ln = e.lineNumber();
if (ln != -1)
m += QString("line:%1 ").arg(ln);
int col = e.columnNumber();
if (col != -1)
m += QString("col:%1 ").arg(col);
m += QString("%1: Unknown Node <%2>, type %3").arg(s).arg(e.tagName()).arg(e.nodeType());
if (e.isText())
m += QString(" text node <%1>").arg(e.toText().data());
qDebug("%s", qPrintable(m));
}