~zsombi/+junk/embedded-styling

« back to all changes in this revision

Viewing changes to modules/Ubuntu/Components/10/UbuntuListView.qml

  • Committer: Zsombor Egri
  • Date: 2014-09-22 15:58:10 UTC
  • Revision ID: zsombor.egri@canonical.com-20140922155810-ogqupi4pdm6c6rg4
documentation fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 */
16
16
 
17
17
import QtQuick 2.0
18
 
import Ubuntu.Components 1.1 as Toolkit
19
 
 
20
 
/*!
21
 
    \qmltype UbuntuListView
22
 
    \inqmlmodule Ubuntu.Components 1.1
23
 
    \ingroup ubuntu
24
 
    \brief A ListView with special features tailored for a look and feel fitting the
25
 
    Ubuntu Touch platform.
26
 
    The UbuntuListView works just like a regular ListView, but it adds special features
27
 
    such as expanding/collapsing items (when used together with the Expandable item).
28
 
    It provides features like automatically positioning the expanding item when it
29
 
    expands and collapsing it again when the user taps outside of it.
30
 
 
31
 
    Examples:
32
 
    \qml
33
 
        import Ubuntu.Components 1.1
34
 
        import Ubuntu.Components.ListItems 1.0 as ListItem
35
 
 
36
 
        Item {
37
 
            ListModel {
38
 
                id: listModel
39
 
            }
40
 
 
41
 
            UbuntuListView {
42
 
                id: ubuntuListView
43
 
                anchors { left: parent.left; right: parent.right }
44
 
                height: units.gu(24)
45
 
                model: listModel
46
 
 
47
 
                delegate: ListItem.Expandable {
48
 
                    id: expandingItem
49
 
 
50
 
                    expandedHeight: units.gu(30)
51
 
 
52
 
                    onClicked: {
53
 
                        ubuntuListView.expandedIndex = index;
54
 
                    }
55
 
                }
56
 
            }
57
 
        }
58
 
    \endqml
59
 
 
60
 
    \b{This component is under heavy development.}
61
 
*/
 
18
import Ubuntu.Components 1.0 as Toolkit
62
19
 
63
20
ListView {
64
21
    id: root
65
22
 
66
 
    /*!
67
 
      The index of the currently expanded item. -1 if no item is expanded.
68
 
     */
69
23
    property int expandedIndex: -1
70
24
 
71
25
    QtObject {