Results 1 to 4 of 4

Thread: QTextStream Problem

  1. #1
    Join Date
    Mar 2011
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Exclamation QTextStream Problem

    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 :

    Qt Code:
    1. private :
    2. QDomElement childs;
    To copy to clipboard, switch view to plain text mode 
    in the cpp file :

    Qt Code:
    1. Write_XML::Write_XML(QString xmlfile)
    2. {
    3. QFile file(xmlfile);
    4. childs = doc.createElement(xmlfile);
    5. doc.appendChild(childs);
    6. if (!file.open(QIODevice::WriteOnly))
    7. return;
    8. out=new QTextStream(&file);
    9. }
    To copy to clipboard, switch view to plain text mode 

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

    How can I solve this problem ?

    Thanks

  2. #2
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTextStream Problem

    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

  3. #3
    Join Date
    Mar 2011
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTextStream Problem

    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 ?

  4. #4
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTextStream Problem

    hint: basic syntax... 'out' isn't a pointer!

Similar Threads

  1. QTextStream readLine() problem
    By walito in forum Newbie
    Replies: 11
    Last Post: 10th January 2011, 14:55
  2. Replies: 0
    Last Post: 17th June 2010, 11:07
  3. QTextStream
    By WXNSNW in forum Qt Programming
    Replies: 1
    Last Post: 16th November 2008, 16:43
  4. QTextStream problem
    By ^NyAw^ in forum Qt Programming
    Replies: 3
    Last Post: 19th June 2007, 09:50
  5. Problem with QTextStream
    By eter in forum Qt Programming
    Replies: 2
    Last Post: 21st November 2006, 15:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.