Results 1 to 3 of 3

Thread: QStringList straight to file

  1. #1
    Join Date
    Feb 2006
    Posts
    25
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QStringList straight to file

    Is there a way to write a QStringList straight to file without the overhead of going each element of the QString list separate?

    Thanks in advanced.

  2. #2
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QStringList straight to file

    join.........


    Qt Code:
    1. qlistxmlfile.append("<?xml version=\"1.0\" ?>");
    2. qlistxmlfile.append("<uri>"+pics_xml_fiel_browser+"</uri>");
    3. qlistxmlfile.append("<icon>/user/images/icon/folder.png</icon>");
    4. qlistxmlfile.append("<title>Pictures</title>");
    5. qlistxmlfile.append("<src>"+pics_xml_fiel_browser+"</src>"); /* browser server path */
    6. qlistxmlfile.append("<items>");
    7. /* die aussen schleleife
    8.   qlistxmlfile.append("<resource id=\""+bildname+"\">");
    9.   die innen schleleife
    10.   qlistxmlfile.append("\t<uri>"+pathimage+bildname"</uri>");
    11.   qlistxmlfile.append("\t<title>"+bildname"</title>");
    12.   qlistxmlfile.append("\t<description>"++"</description>");
    13.   qlistxmlfile.append("\t<width>"++"</width>");
    14.   qlistxmlfile.append("\t<height>"++"</height>");
    15.   qlistxmlfile.append("\t<size>"++"</size>");
    16.   qlistxmlfile.append("</resource>");
    17.  
    18.   */
    19. qlistxmlfile.append("</items>");
    20. QString xml = QString(qlistxmlfile.join("\n"));
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QStringList straight to file

    Quote Originally Posted by patrik08
    join.........
    Please, post only relevant part of the code.

    That is:
    Qt Code:
    1. qlistxmlfile.append("<?xml version=\"1.0\" ?>");
    2. qlistxmlfile.append("<uri>"+pics_xml_fiel_browser+"</uri>");
    3. ...
    4. QString xml = QString(qlistxmlfile.join("\n"));
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Draging a non-existing file to the Windows Desktop
    By klaus1111 in forum Qt Programming
    Replies: 13
    Last Post: 20th September 2007, 12:47
  2. File permission QFile::WriteOther on Win Dos
    By patrik08 in forum Newbie
    Replies: 1
    Last Post: 13th June 2006, 15:16
  3. Cannot queue arguments of type 'QStringList'
    By vfernandez in forum Qt Programming
    Replies: 2
    Last Post: 19th April 2006, 21:48
  4. need help to classify some QStringList
    By patcito in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 22:24
  5. dialog box
    By Bahar in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2006, 15:52

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.