Results 1 to 2 of 2

Thread: XmlListModel

  1. #1
    Join Date
    Sep 2013
    Posts
    1
    Qt products
    Qt5

    Unhappy XmlListModel

    Hi,

    I typed a sample, but it displayed nothing in tableView, Did I do anything wrong?

    Thanks a lot!

    Steven

    javascript Code:
    1. import QtQuick 2.1
    2. import QtQuick.Controls 1.0
    3. import QtQuick.Window 2.0
    4. import QtQuick.Layouts 1.0
    5. import QtQuick.XmlListModel 2.0
    6.  
    7. ApplicationWindow {
    8. id: root
    9. title: qsTr("L2 Tool")
    10. width: 500
    11. height: 360
    12. TableView {
    13. id: flickerTable
    14. TableViewColumn {
    15. title: "Column 1"
    16. role: "title"
    17. }
    18. model: flickerModel
    19. }
    20.  
    21. XmlListModel{
    22. id: flickerModel
    23. source: "http://api.flickr.com/services/feeds/photos_public.gne?format=rss2&tags=Cat"
    24. query: "/rss/channel/item"
    25. namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";"
    26. XmlRole { name: "title"; query: "title/string()" }
    27. XmlRole { name: "date"; query: "pubDate/string()" }
    28. XmlRole { name: "source"; query: "media:thumbnail/@url/string()" }
    29. XmlRole { name: "credit"; query: "media:credit/string()" }
    30. }
    31. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 2nd September 2013 at 22:40.

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

    Default Re: XmlListModel

    Was the model populated correctly? How many items does it have?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. qml PathView XmlListModel
    By waiter in forum Qt Quick
    Replies: 14
    Last Post: 15th January 2013, 01:18
  2. problem using XmlListModel query to parsing rss xml
    By xiazhouquan in forum Qt Quick
    Replies: 1
    Last Post: 19th June 2011, 09:22

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.