Only one line ListView is filled in the QML application, why?

I am trying to create a simple QML application that will use my active chess game to get an RSS feed and do something with it. At this time I am just trying to use the feed content to fill List view, but it only shows one item, even though there should be 11 items in the feed. Is this a mistake or I didn’t 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 Thing.

Your model and view are very good, this is your 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 }
}
}

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 }
}
}

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1831 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.