Results 1 to 5 of 5

Thread: How to set an .xml file as datasource to Listview

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,329
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to set an .xml file as datasource to Listview

    Not working xml: //The Dash and xml header are added by itself.
    What do you mean, "added by itself"? If you are writing the file, then it is your code that is putting in the "-" characters. If it is not your code, then the code you are using is writing invalid XML to the file.

    You will not be able to bind incorrect XML to the XML model. Fix the code that writes the file so it writes complete and correct XML and you will be able to load it into the model.

    Be aware that unless you add more code (a QFileSystemWatcher) to monitor any changes to the file, the model will not automatically reload itself if the file is changed from another program.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. The following user says thank you to d_stranz for this useful post:

    Mathan (3rd October 2016)

Similar Threads

  1. Replies: 2
    Last Post: 16th May 2016, 23:50
  2. ListView - ListView communication
    By MarkoSan in forum Qt Quick
    Replies: 1
    Last Post: 30th October 2015, 10:18
  3. TWAIN Datasource in Qt
    By astodolski in forum Qt Programming
    Replies: 4
    Last Post: 19th November 2013, 21:31
  4. qml listview
    By Le_B in forum Qt Quick
    Replies: 1
    Last Post: 25th May 2011, 13:01
  5. listview
    By addu in forum Qt Programming
    Replies: 2
    Last Post: 11th May 2009, 12:05

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.