Results 1 to 5 of 5

Thread: DomDocument to XML: producing empty files

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: DomDocument to XML: producing empty files

    the test of your open is wrong
    not particularly helpful... any more to add? something like doc.setContent? I haven't looked at it in a couple of days. I'll try again tomorrow I think.

  2. #2
    Join Date
    May 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Wink Re: DomDocument to XML: producing empty files

    ----------FIXED-------------

    Fixed the problem, really silly mistake.

    Qt Code:
    1. QFile file("something.xml");
    2. if (file.open(QIODevice::WriteOnly))
    3. {
    4. QTextStream TextStream(&file);
    5. TextStream << xml;
    6. file.close();
    7. }
    8.  
    9. return 0;
    To copy to clipboard, switch view to plain text mode 

    Changed the condition in the if loop. Removed not operator, duh! Works perfectly now.

  3. #3
    Join Date
    Nov 2010
    Posts
    82
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: DomDocument to XML: producing empty files

    that's what i was saying

Similar Threads

  1. Replies: 1
    Last Post: 14th November 2011, 09:58
  2. is QString empty?
    By timmu in forum Qt Programming
    Replies: 2
    Last Post: 16th January 2010, 22:17
  3. Producing PDF
    By giusepped in forum Qt Programming
    Replies: 1
    Last Post: 29th May 2008, 08:41
  4. Producing Keypressed Event
    By anafor2004 in forum Newbie
    Replies: 11
    Last Post: 30th April 2008, 10:19
  5. remove directory empty or not empty
    By raphaelf in forum Newbie
    Replies: 12
    Last Post: 27th October 2006, 07:30

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.