This is the code:
import Qt 4.7
import "content"
Rectangle {< br /> id: window;
width: 320
height: 480
XmlListModel {
id: xmlModel
source: "http ://gameknot.com/rss.pl?n=kEzvYvEgfHoOmzQzQlY/5w5ITO5YDN"
query: "/rss/channel/item"
XmlRole {name: "title"; query: " title/string()"}
XmlRole {name: "description"; query: "description/string()"}
}
Column
{
id: mainContainer
ListView
{
id: list
model: xmlModel
delegate: ListDelegate {}
//delegate: Text {text: title }
}
}
}
The delegate should be correct, because the simple delegate I have commented out will also happen the same Thing.
Column
{
anchors.fill: parent
id: mainContainer
ListView
{
width: parent.width
height: parent.height
id: list
model: xmlModel
delegate: ListDelegate {}
//delegate: Text {text: title }
}
}
I am trying to create a simple QML application which will use me An active chess game to get the RSS feed and do something with it. At this time I just try to populate the list view with the feed content, but it only shows one item, even though there should be 11 items in the feed. Is this an error or I don’t have Get the correct answer?
This is the code:
import Qt 4.7
import "content"
Rectangle {< br /> id: window;
width: 320
height: 480
XmlListModel {
id: xmlModel
source: "http ://gameknot.com/rss.pl?n=kEzvYvEgfHoOmzQzQlY/5w5ITO5YDN"
query: "/rss/channel/item"
XmlRole {name: "title"; query: " title/string()"}
XmlRole {name: "description"; query: "description/string()"}
}
Column
{
id: mainContainer
ListView
{
id: list
model: xmlModel
delegate: ListDelegate {}
//delegate: Text {text: title }
}
}
}
The delegate should be correct, because the simple delegate I have commented out will also happen the same Things.
Your model and view are very good, this is your The layout is wrong. Try adding anchors.fill: parent to mainContainer. That should solve it:
Column
{
anchors.fill : parent
id: mainContainer
ListView
{
width: parent.width
height: parent.height
id : list
model: xmlModel
delegate: ListDelegate {}
//delegate: Text {text: title }
}
}