LomiriListView QML Type

A ListView with special features tailored for a look and feel fitting the Lomiri Touch platform. The LomiriListView works just like a regular ListView, but it adds special features such as expanding/collapsing items (when used together with the Expandable item). It provides features like automatically positioning the expanding item when it expands and collapsing it again when the user taps outside of it. More...

Import Statement: import Lomiri.Components 1.3
Inherits:

ListView

Properties

Detailed Description

Examples:

import Lomiri.Components 1.3
import Lomiri.Components.ListItems 1.3 as ListItem

Item {
    ListModel {
        id: listModel
    }

    LomiriListView {
        id: lomiriListView
        anchors { left: parent.left; right: parent.right }
        height: units.gu(24)
        model: listModel

        delegate: ListItem.Expandable {
            id: expandingItem

            expandedHeight: units.gu(30)

            onClicked: {
                lomiriListView.expandedIndex = index;
            }
        }
    }
}

Property Documentation

[read-only] pullToRefresh : pullToRefresh

Attached PullToRefresh to control manual model refresh. The component is disabled by default.

import QtQuick 2.4
import QtQuick.XmlListModel 2.0
import Lomiri.Components 1.3

LomiriListView {
    width: units.gu(40)
    height: units.gu(71)
    model: XmlListModel {
        source: "http://feeds.reuters.com/reuters/topNews"
        query: "/rss/channel/item"
        XmlRole { name: "title"; query: "title/string()" }
    }
    // let refresh control know when the refresh gets completed
    pullToRefresh {
        enabled: true
        refreshing: model.status === XmlListModel.Loading
        onRefresh: model.reload()
    }
    delegate: ListItem {
        ListItemLayout {
            title.text: modelData
        }
        onClicked: {
            ListView.view.model.reload();
        }
    }
}

This property was introduced in Lomiri.Components 1.1.