diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-12-30 13:20:24 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-01-16 15:46:28 +0000 |
commit | 8eada7ae7d41a2d93142ea1a6454ab2bbb0998ed (patch) | |
tree | 7cb0ecfa2f7036b4a25a0e147d07313d7fa64a40 /src/quick/doc | |
parent | 09dc5a0c4c08e8f13ddc81d82a9fc2d2af047165 (diff) |
ListView: allow flicking to both directions
Previously flicking was restricted to the orientation of the ListView.
[ChangeLog][QtQuick][ListView] Made it possible to enable horizontal
flicking in a vertical ListView, and vice versa. The only thing apps
must do is to specify the desired flick direction and the content
width (vertical ListView) or content height (horizontal ListView),
which is not calculated by ListView.
Change-Id: Ic370e57f5d18679940d48e7a2c20c200b2ef36d1
Task-number: QTBUG-52553
Task-number: QTBUG-56501
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/doc')
-rw-r--r-- | src/quick/doc/snippets/qml/listview/listview.qml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/quick/doc/snippets/qml/listview/listview.qml b/src/quick/doc/snippets/qml/listview/listview.qml index 31896626a4..ecb5fea076 100644 --- a/src/quick/doc/snippets/qml/listview/listview.qml +++ b/src/quick/doc/snippets/qml/listview/listview.qml @@ -146,4 +146,19 @@ ListView { } //![isCurrentItem] +//![flickBothDirections] +ListView { + width: 180; height: 200 + + contentWidth: 320 + flickableDirection: Flickable.AutoFlickDirection + + model: ContactModel {} + delegate: Row { + Text { text: '<b>Name:</b> ' + name; width: 160 } + Text { text: '<b>Number:</b> ' + number; width: 160 } + } +} +//![flickBothDirections] + } |