1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qdeclarativemodels.qdoc -->
<title>Qt 4.8: Presenting Data with QML</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li>Presenting Data with QML</li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#introduction">Introduction</a></li>
<li class="level1"><a href="#views">Views</a></li>
<li class="level2"><a href="#listview">ListView</a></li>
<li class="level2"><a href="#gridview">GridView</a></li>
<li class="level2"><a href="#pathview">PathView</a></li>
<li class="level1"><a href="#decorating-views">Decorating Views</a></li>
<li class="level2"><a href="#headers-and-footers">Headers and Footers</a></li>
<li class="level2"><a href="#sections">Sections</a></li>
<li class="level2"><a href="#navigation">Navigation</a></li>
<li class="level1"><a href="#further-reading">Further Reading</a></li>
</ul>
</div>
<h1 class="title">Presenting Data with QML</h1>
<span class="subtitle"></span>
<!-- $$$qml-presenting-data.html-description -->
<div class="descr"> <a name="details"></a>
<a name="introduction"></a>
<h2>Introduction</h2>
<p>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, <a href="qml-positioners.html#repeaters">Repeaters</a> can be used in combination with <a href="qml-positioners.html#positioners">Positioners</a> 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.</p>
<a name="views"></a>
<h2>Views</h2>
<p>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.</p>
<p>A set of standard views are provided in the basic set of Qt Quick graphical elements:</p>
<ul>
<li><a href="#listview">ListView</a> arranges items in a horizontal or vertical list</li>
<li><a href="#gridview">GridView</a> arranges items in a grid within the available space</li>
<li><a href="#pathview">PathView</a> arranges items on a path</li>
</ul>
<p>Unlike these items, <a href="qml-webview.html">WebView</a> is not a fully-featured view item, and needs to be combined with a <a href="qml-flickable.html">Flickable</a> item to create a view that performs like a Web browser.</p>
<a name="listview"></a>
<h3>ListView</h3>
<p><a href="qml-listview.html">ListView</a> shows a classic list of items with horizontal or vertical placing of items.</p>
<div style="float: right; margin-left: 2em"><p><img src="images/qml-listview-snippet.png" alt="" /> </div></p>
<p>The following example shows a minimal <a href="qml-listview.html">ListView</a> displaying a sequence of numbers (using an <a href="qdeclarativemodels.html#an-integer">integer as a model</a>). A simple delegate is used to define an items for each piece of data in the model.</p>
<br style="clear: both" /><pre class="qml"> import QtQuick 1.0
<span class="type"><a href="qml-listview.html">ListView</a></span> {
<span class="name">width</span>: <span class="number">50</span>; <span class="name">height</span>: <span class="number">200</span>
<span class="name">model</span>: <span class="number">4</span>
<span class="name">delegate</span>: <span class="name">Text</span> {
<span class="name">text</span>: <span class="name">index</span>;
<span class="name">font</span>.pixelSize: <span class="number">40</span>
}
}</pre>
<a name="gridview"></a>
<h3>GridView</h3>
<p><a href="qml-gridview.html">GridView</a> displays items in a grid like an file manager's icon view.</p>
<a name="pathview"></a>
<h3>PathView</h3>
<p><a href="qml-pathview.html">PathView</a> displays items on a path, where the selection remains in the same place and the items move around it.</p>
<a name="decorating-views"></a>
<h2>Decorating Views</h2>
<a name="headers-and-footers"></a>
<h3>Headers and Footers</h3>
<a name="sections"></a>
<h3>Sections</h3>
<a name="navigation"></a>
<h3>Navigation</h3>
<p>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.</p>
<a name="further-reading"></a>
<h2>Further Reading</h2>
</div>
<!-- @@@qml-presenting-data.html -->
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed under the terms of the
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
License version 1.3</a> as published by the Free Software Foundation.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|