PDA

View Full Version : QTextStream Problem



lahmitia
8th March 2011, 20:01
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

schnitzel
8th March 2011, 20:03
you are using QTextStream incorrectly - check out the sample source code on the following web page: http://doc.qt.nokia.com/latest/qtextstream.html#details

lahmitia
8th March 2011, 20:06
Yeah I see , but how can I make it Work ? i want to use the out QTextStream in the Whole Class !

So I guess that I have to make some change in the Header ? No ?

schnitzel
8th March 2011, 20:16
hint: basic syntax... 'out' isn't a pointer!