Results 1 to 3 of 3

Thread: Saving A List

  1. #1
    Join Date
    Mar 2007
    Posts
    19
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Saving A List

    Hello, I have written a program which gets song info from a server and stores it in a QTreeWidget. Every artist gets a node, with children that are albums. Then under each album I have the titles. So "My December" by Linkin Park would look like:
    Qt Code:
    1. +---Linkin Park
    2. |
    3. +---Reanimation
    4. |
    5. +---My December
    To copy to clipboard, switch view to plain text mode 

    However, looking up this list takes a lot of time and the list almost never changes. So, I would like to be able to save the data in a way that would allow me to create the widget much faster. Does anyone know how to save something like this to a file in such a way that it would be easily accessible?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Saving A List

    XML would be a good choice.

  3. #3
    Join Date
    Mar 2007
    Posts
    19
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Saving A List

    lol me and xml do not get along, however I figured out how to do it; I just go through all top level widgets and recur through their children. As I recur I print the nodes data (and depth), then its children's data, and so on.

    Thanks for the suggestion though

Similar Threads

  1. Highlight text in list box
    By Sheetal in forum Qt Tools
    Replies: 7
    Last Post: 9th April 2007, 12:24
  2. Saving images from QTextEdit
    By borges in forum Qt Programming
    Replies: 2
    Last Post: 11th January 2007, 11:38
  3. list of list
    By quickNitin in forum Newbie
    Replies: 1
    Last Post: 3rd July 2006, 09:11
  4. [QT4.1.1 XP] multi-columns list model/view
    By incapacitant in forum Newbie
    Replies: 1
    Last Post: 26th February 2006, 14:38
  5. QtCentre vs. Qt-Interest mailing list vs. QtForum?
    By brcain in forum General Discussion
    Replies: 4
    Last Post: 16th February 2006, 02:46

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.