Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

QXmlStreamReader !

$
0
0
hi, i have in my application to convert, to a graphic item, this XML code :         <name>      <text>FORK_1</text>      <graphics>       <offset x="22" y="-10">      </graphics>     </name>       <graphics>           </graphics>       <initialMarking>      <text>1</text>      <graphics>       <offset x="22" y="20">      </graphics>     </initialMarking>      </place> i tray like this :   QXmlStreamReader xmlreader(&recordfile);   QXmlStreamAttributes attributes;     while (!xmlreader.atEnd()) {          xmlreader.readNextStartElement();    if(xmlreader.isStartElement()){   if(xmlreader.name() == "place")   {    attributes = xmlreader.attributes();    QStringRef id = attributes.value("id");    qDebug()<<id;    xmlreader.readNextStartElement();    if(xmlreader.name() == "name")     {       xmlreader.readNextStartElement();       if(xmlreader.name() == "text")        {          qDebug()<<xmlreader.readElementText ();            }           }   }  }    } how to make the code more simple ? any suggestion ?

Viewing all articles
Browse latest Browse all 18427

Latest Images

Trending Articles



Latest Images