C++ (Qt) QTcpSocket * Sok = new QTcpSocket(); Sok->connectToHost("127.0.0.1",5000); QXmlStreamWriter * wr = new QXmlStreamWriter(Sok); QXmlStreamReader * rd = new QXmlStreamReader(Sok); wr->setAutoFormatting(true); wr->writeStartDocument(); wr->writeStartElement("ValueStart");//Root wr->writeStartElement("ValueNext"); wr->writeEndElement(); wr->writeStartElement("ValueNext2"); wr->writeEndElement(); wr->writeStartElement("ValueNext3"); wr->writeEndElement(); wr->writeEndElement(); wr->writeEndDocument();//End Root Sok->flush(); <snip> void MainWindowImpl::IncomingDataXML(){ rd->readNext(); while(!rd->atEnd()) { // parsing code there // ... rd->readNext(); }}
C++ (Qt)int z=0; while(!rd->atEnd() || (z = rd->atEnd())) { int i = rd->atEnd(); QMessageBox::about(0,"AAAAAAAAAAAA",QString::number(z));
C++ (Qt)while(!rd->atEnd() || (z == rd->atEnd()))