Results 1 to 4 of 4

Thread: QTextStream

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

    Default QTextStream

    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 2010
    Location
    Belarus
    Posts
    71
    Thanks
    1
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Windows Maemo/MeeGo

    Default Re: QTextStream

    use pointer for out or void QTextStream::setDevice ( QIODevice * device );

    so

    Qt Code:
    To copy to clipboard, switch view to plain text mode 

    or

    Qt Code:
    1. out.setDevice(file);
    To copy to clipboard, switch view to plain text mode 
    Try read Qt documentation before ask stupid question.

  3. #3
    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


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

    Default Re: QTextStream

    Thanks Novice

Similar Threads

  1. QTextStream under Mac OS X
    By hunsrus in forum Qt Programming
    Replies: 0
    Last Post: 14th September 2009, 09:49
  2. QTextStream
    By WXNSNW in forum Qt Programming
    Replies: 1
    Last Post: 16th November 2008, 16:43
  3. when close QTextStream
    By mattia in forum Newbie
    Replies: 1
    Last Post: 24th November 2007, 13:17
  4. QTextStream problem
    By ^NyAw^ in forum Qt Programming
    Replies: 3
    Last Post: 19th June 2007, 09:50
  5. QTextStream help pls
    By munna in forum Newbie
    Replies: 5
    Last Post: 16th May 2006, 18:45

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.