Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working at app for ubuntu touch. I have a code with listView in it. But when I run it the page is simply empty (tehre is a title and a tabs switcher). Where is the mistake?

import QtQuick 2.0
import Ubuntu.Components 0.1
import Ubuntu.Components.ListItems 0.1 as ListItem
import QtQuick.XmlListModel 2.0

MainView {

applicationName: "El Wohust"
objectName: "elwohust"

XmlListModel {
    id: portals
    source: "http://localhost/feed.xml"
    query: "/portals/item"

    XmlRole { name: "title"; query: "title/string()" }
    XmlRole { name: "pubDate"; query: "pubDate/string()" }

// Here

           Tab {
               title:"2nd list")
               Page {
                   id: subreddits
                   anchors.fill: parent

                   ListView {
                       id: articleList

                       model: portals
                       delegate: ListItem.Subtitled {
                                   text: title
                                   subText: pubDate
                                   progression: true
                                   onClicked: pageStack.push(articleView)




Here is how the XML file looks like:

<?xml version="1.0" encoding="utf-8"?>

        <title>Karlův most</title>
        <pubDate>Sat, 07 Sep 2010 10:00:01 GMT</pubDate>
        <title>Sv. Vít</title>
        <pubDate>Sat, 07 Sep 2010 15:35:01 GMT</pubDate>

share|improve this question
up vote 1 down vote accepted

I think you need anchors.fill: parent on the ListView as well.

share|improve this answer
Thanks! Now it works! – Cactux Apr 23 '13 at 15:15

I think you must do as the following for a ListView to work perfectly...

Column {
        anchors.centerIn: parent.Center

        ListView {
            width: page.width
            height: page.height
            model: dictXMLList
            delegate: ListItem.Subtitled {
                text: word
                subText: meaning
                progression: true


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.