Hi,
I typed a sample, but it displayed nothing in tableView, Did I do anything wrong?
Thanks a lot!
Steven
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Window 2.0
import QtQuick.Layouts 1.0
import QtQuick.XmlListModel 2.0
ApplicationWindow {
id: root
title: qsTr("L2 Tool")
width: 500
height: 360
TableView {
id: flickerTable
TableViewColumn {
title: "Column 1"
role: "title"
}
model: flickerModel
}
XmlListModel{
id: flickerModel
source: "http://api.flickr.com/services/feeds/photos_public.gne?format=rss2&tags=Cat"
query: "/rss/channel/item"
namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";"
XmlRole { name: "title"; query: "title/string()" }
XmlRole { name: "date"; query: "pubDate/string()" }
XmlRole { name: "source"; query: "media:thumbnail/@url/string()" }
XmlRole { name: "credit"; query: "media:credit/string()" }
}
}
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Window 2.0
import QtQuick.Layouts 1.0
import QtQuick.XmlListModel 2.0
ApplicationWindow {
id: root
title: qsTr("L2 Tool")
width: 500
height: 360
TableView {
id: flickerTable
TableViewColumn {
title: "Column 1"
role: "title"
}
model: flickerModel
}
XmlListModel{
id: flickerModel
source: "http://api.flickr.com/services/feeds/photos_public.gne?format=rss2&tags=Cat"
query: "/rss/channel/item"
namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";"
XmlRole { name: "title"; query: "title/string()" }
XmlRole { name: "date"; query: "pubDate/string()" }
XmlRole { name: "source"; query: "media:thumbnail/@url/string()" }
XmlRole { name: "credit"; query: "media:credit/string()" }
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks