PDA

View Full Version : QTextStream



lahmitia
8th March 2011, 21:27
Hello Fellas ,

I'm having a problem with a small Xml parser and writer that i'm coding !
Well , i wrote a class Write_XML in the header i have :


private :
QDomDocument doc;
QDomElement childs;
QTextStream out;

in the cpp file :


Write_XML::Write_XML(QString xmlfile)
{
QFile file(xmlfile);
childs = doc.createElement(xmlfile);
doc.appendChild(childs);
if (!file.open(QIODevice::WriteOnly))
return;
out=new QTextStream(&file);
}

But I'm having this disturbing Error : field 'out' has incomplete type.

How can I solve this problem ?

Thanks :D

unit
8th March 2011, 21:32
use pointer for out or void QTextStream::setDevice ( QIODevice * device );

so


QTextStream *out;

or


out.setDevice(file);

schnitzel
8th March 2011, 21:36
and stop double posting:
http://www.qtcentre.org/threads/39453-QTextStream-Problem

lahmitia
8th March 2011, 21:50
Thanks Novice :)