<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Node name="message 18"> <Prp name="date" type="D" value="40100.0302291204"/> <Prp name="priority" type="I" value="300"/> <Prp name="owner id" type="I" value="-1"/> <Prp name="color" type="I" value="-252645136"/> <Prp name="id" type="I" value="18"/> <Prp name="bkcolor" type="I" value="-252645136"/> <Prp name="message" type="S" value="Информирование"/> <Prp name="picture" type="S" value=""/> <Prp name="link" type="S" value=""/> <Prp name="unit id" type="I" value="0"/> <Prp name="remarks" type="S" value=""/> <Prp name="type" type="I" value="0"/> <Prp name="line no" type="I" value="66"/> <Prp name="child index" type="I" value="-1"/> </Node>
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
QDomNode root = xmlDocument->childNodes().item(1).childNodes().item(0); int nodeCount = root.childNodes().count(); for (int i = 0;i < nodeCount;i++){ if (QString(root.childNodes().item(i).childNodes().item(10).attributes().item(1).nodeValue()).contains(QString("Информация") ,Qt::CaseInsensitive)){ qDebug() << "Messages : " + (root.childNodes().item(i).childNodes().item(10).attributes().item(1).nodeValue()); } }
QTextCodec *codec = QTextCodec::codecForName("UTF-8");
C++ (Qt)QTextCodec::setCodecForCString( QTextCodec::codecForLocale() );
C++ (Qt)contains( tr( "Информация" ) );
C++ (Qt)QTextCodec::setCodecForTr( QTextCodec::codecForLocale() );