/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Free Documentation License ** Alternatively, this file may be used under the terms of the GNU Free ** Documentation License version 1.3 as published by the Free Software ** Foundation and appearing in the file included in the packaging of this ** file. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ /*! \page qml-views.html \ingroup qml-features \contentspage QML Features \previouspage {QML Data Models}{Structuring Data with Models} \nextpage {Extending QML Functionalities using C++} \title Presenting Data with Views \section1 Introduction Qt Quick contains a set of standard items that can be used to present data in a number of different ways. For simple user interfaces, \l{Using QML Positioner and Repeater Items#Repeaters}{Repeaters} can be used in combination with \l{Using QML Positioner and Repeater Items#Positioners}{Positioners} to obtain pieces of data and arrange them in a user interface. However, when large quantities of data are involved, it is often better to use models with the standard views since these contain many built-in display and navigation features. \section1 Views Views are scrolling containers for collections of items. They are feature-rich, supporting many of the use cases found in typical applications, and can be customized to meet requirements on style and behavior. A set of standard views are provided in the basic set of Qt Quick graphical elements: \list \o \l{#ListView}{ListView} arranges items in a horizontal or vertical list \o \l{#GridView}{GridView} arranges items in a grid within the available space \o \l{#PathView}{PathView} arranges items on a path \endlist Unlike these items, \l WebView is not a fully-featured view item, and needs to be combined with a \l Flickable item to create a view that performs like a Web browser. \section2 ListView \l ListView shows a classic list of items with horizontal or vertical placing of items. \beginfloatright \inlineimage qml-listview-snippet.png \endfloat The following example shows a minimal ListView displaying a sequence of numbers (using an \l{QML Data Models#An Integer}{integer as a model}). A simple delegate is used to define an items for each piece of data in the model. \clearfloat \snippet doc/src/snippets/declarative/listview/listview-snippet.qml document \section2 GridView \l GridView displays items in a grid like an file manager's icon view. \section2 PathView \l PathView displays items on a path, where the selection remains in the same place and the items move around it. \section1 Decorating Views \section2 Headers and Footers \section2 Sections \section2 Navigation In traditional user interfaces, views can be scrolled using standard controls, such as scroll bars and arrow buttons. In some situations, it is also possible to drag the view directly by pressing and holding a mouse button while moving the cursor. In touch-based user interfaces, this dragging action is often complemented with a flicking action, where scrolling continues after the user has stopped touching the view. \section1 Further Reading */