Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 5835

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?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" />
<!-- qdeclarativegridview.cpp -->
  <title>Qt 4.8: QML GridView Element</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="qdeclarativeelements.html">QML Elements</a></li>
<li>QML GridView Element</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<p class="naviNextPrevious headerNavi">
</p><p/>
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#properties">Attached Properties</a></li>
<li class="level1"><a href="#signal-handlers">Attached Signal Handlers</a></li>
<li class="level1"><a href="#methods">Methods</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#example-usage">Example Usage</a></li>
</ul>
</div>
<h1 class="title">QML GridView Element</h1>
<span class="subtitle"></span>
<!-- $$$GridView-brief -->
<p>The GridView item provides a grid view of items provided by a model. <a href="#details">More...</a></p>
<!-- @@@GridView -->
<p>Inherits <a href="qml-flickable.html">Flickable</a></p>
<p>This element was introduced in Qt 4.7.</p>
<ul>
<li><a href="qml-gridview-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-gridview.html#cacheBuffer-prop">cacheBuffer</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-gridview.html#cellHeight-prop">cellHeight</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-gridview.html#cellWidth-prop">cellWidth</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-gridview.html#count-prop">count</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-gridview.html#currentIndex-prop">currentIndex</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-gridview.html#currentItem-prop">currentItem</a></b></b> : Item</li>
<li class="fn"><b><b><a href="qml-gridview.html#delegate-prop">delegate</a></b></b> : Component</li>
<li class="fn"><b><b><a href="qml-gridview.html#flow-prop">flow</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-gridview.html#footer-prop">footer</a></b></b> : Component</li>
<li class="fn"><b><b><a href="qml-gridview.html#header-prop">header</a></b></b> : Component</li>
<li class="fn"><b><b><a href="qml-gridview.html#highlight-prop">highlight</a></b></b> : Component</li>
<li class="fn"><b><b><a href="qml-gridview.html#highlightFollowsCurrentItem-prop">highlightFollowsCurrentItem</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-gridview.html#highlightItem-prop">highlightItem</a></b></b> : Item</li>
<li class="fn"><b><b><a href="qml-gridview.html#highlightMoveDuration-prop">highlightMoveDuration</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-gridview.html#highlightRangeMode-prop">highlightRangeMode</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-gridview.html#keyNavigationWraps-prop">keyNavigationWraps</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-gridview.html#layoutDirection-prop">layoutDirection</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-gridview.html#model-prop">model</a></b></b> : model</li>
<li class="fn"><b><b><a href="qml-gridview.html#preferredHighlightBegin-prop">preferredHighlightBegin</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-gridview.html#preferredHighlightEnd-prop">preferredHighlightEnd</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-gridview.html#snapMode-prop">snapMode</a></b></b> : enumeration</li>
</ul>
<a name="attached-properties"></a>
<h2>Attached Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-gridview.html#delayRemove-prop">delayRemove</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-gridview.html#isCurrentItem-prop">isCurrentItem</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-gridview.html#view-prop">view</a></b></b> : GridView</li>
</ul>
<a name="attached-signal-handlers"></a>
<h2>Attached Signal Handlers</h2>
<ul>
<li class="fn"><b><b><a href="qml-gridview.html#onAdd-signal">onAdd</a></b></b></li>
<li class="fn"><b><b><a href="qml-gridview.html#onRemove-signal">onRemove</a></b></b></li>
</ul>
<a name="methods"></a>
<h2>Methods</h2>
<ul>
<li class="fn"><b><b><a href="qml-gridview.html#indexAt-method">indexAt</a></b></b></li>
<li class="fn"><b><b><a href="qml-gridview.html#moveCurrentIndexDown-method">moveCurrentIndexDown</a></b></b></li>
<li class="fn"><b><b><a href="qml-gridview.html#moveCurrentIndexLeft-method">moveCurrentIndexLeft</a></b></b></li>
<li class="fn"><b><b><a href="qml-gridview.html#moveCurrentIndexRight-method">moveCurrentIndexRight</a></b></b></li>
<li class="fn"><b><b><a href="qml-gridview.html#moveCurrentIndexUp-method">moveCurrentIndexUp</a></b></b></li>
<li class="fn"><b><b><a href="qml-gridview.html#positionViewAtBeginning-method">positionViewAtBeginning</a></b></b></li>
<li class="fn"><b><b><a href="qml-gridview.html#positionViewAtEnd-method">positionViewAtEnd</a></b></b></li>
<li class="fn"><b><b><a href="qml-gridview.html#positionViewAtIndex-method">positionViewAtIndex</a></b></b></li>
</ul>
<!-- $$$GridView-description -->
<a name="details"></a>
<h2>Detailed Description</h2>
<p>A GridView displays data from models created from built-in QML elements like <a href="qml-listmodel.html">ListModel</a> and <a href="qml-xmllistmodel.html">XmlListModel</a>, or custom model classes defined in C++ that inherit from <a href="qabstractlistmodel.html">QAbstractListModel</a>.</p>
<p>A GridView has a <a href="qml-gridview.html#model-prop">model</a>, which defines the data to be displayed, and a <a href="qml-gridview.html#delegate-prop">delegate</a>, which defines how the data should be displayed. Items in a GridView are laid out horizontally or vertically. Grid views are inherently flickable as GridView inherits from <a href="qml-flickable.html">Flickable</a>.</p>
<a name="example-usage"></a>
<h2>Example Usage</h2>
<p>The following example shows the definition of a simple list model defined in a file called <tt>ContactModel.qml</tt>:</p>
<pre class="qml"> import QtQuick 1.0

 <span class="type"><a href="qml-listmodel.html">ListModel</a></span> {

     <span class="type"><a href="qml-listelement.html">ListElement</a></span> {
         <span class="name">name</span>: <span class="string">&quot;Jim Williams&quot;</span>
         <span class="name">portrait</span>: <span class="string">&quot;pics/portrait.png&quot;</span>
     }
     <span class="type"><a href="qml-listelement.html">ListElement</a></span> {
         <span class="name">name</span>: <span class="string">&quot;John Brown&quot;</span>
         <span class="name">portrait</span>: <span class="string">&quot;pics/portrait.png&quot;</span>
     }
     <span class="type"><a href="qml-listelement.html">ListElement</a></span> {
         <span class="name">name</span>: <span class="string">&quot;Bill Smyth&quot;</span>
         <span class="name">portrait</span>: <span class="string">&quot;pics/portrait.png&quot;</span>
     }
     <span class="type"><a href="qml-listelement.html">ListElement</a></span> {
         <span class="name">name</span>: <span class="string">&quot;Sam Wise&quot;</span>
         <span class="name">portrait</span>: <span class="string">&quot;pics/portrait.png&quot;</span>
     }
 }</pre>
<div class="float-right"><p><img src="images/gridview-simple.png" alt="" /></p>
</div><p>This model can be referenced as <tt>ContactModel</tt> in other QML files. See <a href="qdeclarativemodules.html#qml-modules">QML Modules</a> for more information about creating reusable components like this.</p>
<p>Another component can display this model data in a GridView, as in the following example, which creates a <tt>ContactModel</tt> component for its model, and a <a href="qml-column.html">Column</a> element (containing <a href="qml-image.html">Image</a> and <a href="qml-text.html">Text</a> elements) for its delegate.</p>
<br style="clear: both" /><pre class="qml"> import QtQuick 1.0

 <span class="type">GridView</span> {
     <span class="name">width</span>: <span class="number">300</span>; <span class="name">height</span>: <span class="number">200</span>

     <span class="name">model</span>: <span class="name">ContactModel</span> {}
     <span class="name">delegate</span>: <span class="name">Column</span> {
         <span class="type"><a href="qml-image.html">Image</a></span> { <span class="name">source</span>: <span class="name">portrait</span>; <span class="name">anchors</span>.horizontalCenter: <span class="name">parent</span>.<span class="name">horizontalCenter</span> }
         <span class="type"><a href="qml-text.html">Text</a></span> { <span class="name">text</span>: <span class="name">name</span>; <span class="name">anchors</span>.horizontalCenter: <span class="name">parent</span>.<span class="name">horizontalCenter</span> }
     }
 }</pre>
<div class="float-right"><p><img src="images/gridview-highlight.png" alt="" /></p>
</div><p>The view will create a new delegate for each item in the model. Note that the delegate is able to access the model's <tt>name</tt> and <tt>portrait</tt> data directly.</p>
<p>An improved grid view is shown below. The delegate is visually improved and is moved into a separate <tt>contactDelegate</tt> component.</p>
<br style="clear: both" /><pre class="qml"> <span class="type"><a href="qml-rectangle.html">Rectangle</a></span> {
     <span class="name">width</span>: <span class="number">300</span>; <span class="name">height</span>: <span class="number">200</span>

     <span class="type"><a href="qml-component.html">Component</a></span> {
         <span class="name">id</span>: <span class="name">contactDelegate</span>
         <span class="type"><a href="qml-item.html">Item</a></span> {
             <span class="name">width</span>: <span class="name">grid</span>.<span class="name">cellWidth</span>; <span class="name">height</span>: <span class="name">grid</span>.<span class="name">cellHeight</span>
             <span class="type"><a href="qml-column.html">Column</a></span> {
                 <span class="name">anchors</span>.fill: <span class="name">parent</span>
                 <span class="type"><a href="qml-image.html">Image</a></span> { <span class="name">source</span>: <span class="name">portrait</span>; <span class="name">anchors</span>.horizontalCenter: <span class="name">parent</span>.<span class="name">horizontalCenter</span> }
                 <span class="type"><a href="qml-text.html">Text</a></span> { <span class="name">text</span>: <span class="name">name</span>; <span class="name">anchors</span>.horizontalCenter: <span class="name">parent</span>.<span class="name">horizontalCenter</span> }
             }
         }
     }

     <span class="type">GridView</span> {
         <span class="name">id</span>: <span class="name">grid</span>
         <span class="name">anchors</span>.fill: <span class="name">parent</span>
         <span class="name">cellWidth</span>: <span class="number">80</span>; <span class="name">cellHeight</span>: <span class="number">80</span>

         <span class="name">model</span>: <span class="name">ContactModel</span> {}
         <span class="name">delegate</span>: <span class="name">contactDelegate</span>
         <span class="name">highlight</span>: <span class="name">Rectangle</span> { <span class="name">color</span>: <span class="string">&quot;lightsteelblue&quot;</span>; <span class="name">radius</span>: <span class="number">5</span> }
         <span class="name">focus</span>: <span class="number">true</span>
     }
 }</pre>
<p>The currently selected item is highlighted with a blue <a href="qml-rectangle.html">Rectangle</a> using the <a href="qml-gridview.html#highlight-prop">highlight</a> property, and <tt>focus</tt> is set to <tt>true</tt> to enable keyboard navigation for the grid view. The grid view itself is a focus scope (see <a href="qdeclarativefocus.html#acquiring-focus-and-focus-scopes">the focus documentation page</a> for more details).</p>
<p>Delegates are instantiated as needed and may be destroyed at any time. State should <i>never</i> be stored in a delegate.</p>
<p>GridView attaches a number of properties to the root item of the delegate, for example <tt>GridView.isCurrentItem</tt>. In the following example, the root delegate item can access this attached property directly as <tt>GridView.isCurrentItem</tt>, while the child <tt>contactInfo</tt> object must refer to this property as <tt>wrapper.GridView.isCurrentItem</tt>.</p>
<pre class="qml"> <span class="type">GridView</span> {
     <span class="name">width</span>: <span class="number">300</span>; <span class="name">height</span>: <span class="number">200</span>
     <span class="name">cellWidth</span>: <span class="number">80</span>; <span class="name">cellHeight</span>: <span class="number">80</span>

     <span class="type"><a href="qml-component.html">Component</a></span> {
         <span class="name">id</span>: <span class="name">contactsDelegate</span>
         <span class="type"><a href="qml-rectangle.html">Rectangle</a></span> {
             <span class="name">id</span>: <span class="name">wrapper</span>
             <span class="name">width</span>: <span class="number">80</span>
             <span class="name">height</span>: <span class="number">80</span>
             <span class="name">color</span>: <span class="name">GridView</span>.<span class="name">isCurrentItem</span> ? <span class="string">&quot;black&quot;</span> : <span class="string">&quot;red&quot;</span>
             <span class="type"><a href="qml-text.html">Text</a></span> {
                 <span class="name">id</span>: <span class="name">contactInfo</span>
                 <span class="name">text</span>: <span class="name">name</span> <span class="operator">+</span> <span class="string">&quot;: &quot;</span> <span class="operator">+</span> <span class="name">number</span>
                 <span class="name">color</span>: <span class="name">wrapper</span>.<span class="name">GridView</span>.<span class="name">isCurrentItem</span> ? <span class="string">&quot;red&quot;</span> : <span class="string">&quot;black&quot;</span>
             }
         }
     }

     <span class="name">model</span>: <span class="name">ContactModel</span> {}
     <span class="name">delegate</span>: <span class="name">contactsDelegate</span>
     <span class="name">focus</span>: <span class="number">true</span>
 }</pre>
<p><b>Note:</b> Views do not set the <a href="qml-item.html#clip-prop">clip</a> property automatically. If the view is not clipped by another item or the screen, it will be necessary to set this property to true in order to clip the items that are partially or fully outside the view.</p>
<p><b>See also </b><a href="declarative-modelviews-gridview.html">GridView example</a>.</p>
<!-- @@@GridView -->
<h2>Property Documentation</h2>
<!-- $$$cacheBuffer -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="cacheBuffer-prop"></a><span class="name">cacheBuffer</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property determines whether delegates are retained outside the visible area of the view.</p>
<p>If non-zero the view will keep as many delegates instantiated as will fit within the buffer specified. For example, if in a vertical view the delegate is 20 pixels high and <tt>cacheBuffer</tt> is set to 40, then up to 2 delegates above and 2 delegates below the visible area may be retained.</p>
<p>Note that cacheBuffer is not a pixel buffer - it only maintains additional instantiated delegates.</p>
<p>Setting this value can make scrolling the list smoother at the expense of additional memory usage. It is not a substitute for creating efficient delegates; the fewer elements in a delegate, the faster a view may be scrolled.</p>
</div></div><!-- @@@cacheBuffer -->
<br/>
<!-- $$$cellWidth -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="cellWidth-prop"></a><span class="name">cellWidth</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr><tr valign="top" class="even"><td class="tblQmlPropNode"><p><a name="cellHeight-prop"></a><span class="name">cellHeight</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>These properties holds the width and height of each cell in the grid.</p>
<p>The default cell size is 100x100.</p>
</div></div><!-- @@@cellWidth -->
<br/>
<!-- $$$count -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="count-prop"></a><span class="qmlreadonly">read-only</span><span class="name">count</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the number of items in the view.</p>
</div></div><!-- @@@count -->
<br/>
<!-- $$$currentIndex -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="currentIndex-prop"></a><span class="name">currentIndex</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr><tr valign="top" class="even"><td class="tblQmlPropNode"><p><a name="currentItem-prop"></a><span class="name">currentItem</span> : <span class="type"><a href="qml-item.html">Item</a></span></p></td></tr></table></div><div class="qmldoc"><p>The <tt>currentIndex</tt> property holds the index of the current item, and <tt>currentItem</tt> holds the current item. Setting the currentIndex to -1 will clear the highlight and set <a href="qml-gridview.html#currentItem-prop">currentItem</a> to null.</p>
<p>If <a href="qml-gridview.html#highlightFollowsCurrentItem-prop">highlightFollowsCurrentItem</a> is <tt>true</tt>, setting either of these properties will smoothly scroll the <a href="qml-gridview.html">GridView</a> so that the current item becomes visible.</p>
<p>Note that the position of the current item may only be approximate until it becomes visible in the view.</p>
</div></div><!-- @@@currentIndex -->
<br/>
<!-- $$$delegate -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="delegate-prop"></a><span class="name">delegate</span> : <span class="type"><a href="qml-component.html">Component</a></span></p></td></tr></table></div><div class="qmldoc"><p>The delegate provides a template defining each item instantiated by the view. The index is exposed as an accessible <tt>index</tt> property. Properties of the model are also available depending upon the type of <a href="qdeclarativemodels.html#qmlmodels">Data Model</a>.</p>
<p>The number of elements in the delegate has a direct effect on the flicking performance of the view. If at all possible, place functionality that is not needed for the normal display of the delegate in a <a href="qml-loader.html">Loader</a> which can load additional elements when needed.</p>
<p>The <a href="qml-gridview.html">GridView</a> will layout the items based on the size of the root item in the delegate.</p>
<p><b>Note:</b> Delegates are instantiated as needed and may be destroyed at any time. State should <i>never</i> be stored in a delegate.</p>
</div></div><!-- @@@delegate -->
<br/>
<!-- $$$flow -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="flow-prop"></a><span class="name">flow</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the flow of the grid.</p>
<p>Possible values:</p>
<ul>
<li><a href="qml-gridview.html">GridView</a>.LeftToRight (default) - Items are laid out from left to right, and the view scrolls vertically</li>
<li><a href="qml-gridview.html">GridView</a>.TopToBottom - Items are laid out from top to bottom, and the view scrolls horizontally</li>
</ul>
</div></div><!-- @@@flow -->
<br/>
<!-- $$$footer -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="footer-prop"></a><span class="name">footer</span> : <span class="type"><a href="qml-component.html">Component</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the component to use as the footer.</p>
<p>An instance of the footer component is created for each view. The footer is positioned at the end of the view, after any items.</p>
<p><b>See also </b><a href="qml-gridview.html#header-prop">header</a>.</p>
</div></div><!-- @@@footer -->
<br/>
<!-- $$$header -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="header-prop"></a><span class="name">header</span> : <span class="type"><a href="qml-component.html">Component</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the component to use as the header.</p>
<p>An instance of the header component is created for each view. The header is positioned at the beginning of the view, before any items.</p>
<p><b>See also </b><a href="qml-gridview.html#footer-prop">footer</a>.</p>
</div></div><!-- @@@header -->
<br/>
<!-- $$$highlight -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="highlight-prop"></a><span class="name">highlight</span> : <span class="type"><a href="qml-component.html">Component</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the component to use as the highlight.</p>
<p>An instance of the highlight component is created for each view. The geometry of the resulting component instance will be managed by the view so as to stay with the current item, unless the <a href="qml-gridview.html#highlightFollowsCurrentItem-prop">highlightFollowsCurrentItem</a> property is false.</p>
<p><b>See also </b><a href="qml-gridview.html#highlightItem-prop">highlightItem</a> and <a href="qml-gridview.html#highlightFollowsCurrentItem-prop">highlightFollowsCurrentItem</a>.</p>
</div></div><!-- @@@highlight -->
<br/>
<!-- $$$highlightFollowsCurrentItem -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="highlightFollowsCurrentItem-prop"></a><span class="name">highlightFollowsCurrentItem</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property sets whether the highlight is managed by the view.</p>
<p>If this property is true (the default value), the highlight is moved smoothly to follow the current item. Otherwise, the highlight is not moved by the view, and any movement must be implemented by the highlight.</p>
<p>Here is a highlight with its motion defined by a <a href="qml-springanimation.html">SpringAnimation</a> item:</p>
<pre class="qml"> <span class="type"><a href="qml-component.html">Component</a></span> {
     <span class="name">id</span>: <span class="name">highlight</span>
     <span class="type"><a href="qml-rectangle.html">Rectangle</a></span> {
         <span class="name">width</span>: <span class="name">view</span>.<span class="name">cellWidth</span>; <span class="name">height</span>: <span class="name">view</span>.<span class="name">cellHeight</span>
         <span class="name">color</span>: <span class="string">&quot;lightsteelblue&quot;</span>; <span class="name">radius</span>: <span class="number">5</span>
         <span class="name">x</span>: <span class="name">view</span>.<span class="name">currentItem</span>.<span class="name">x</span>
         <span class="name">y</span>: <span class="name">view</span>.<span class="name">currentItem</span>.<span class="name">y</span>
         Behavior on <span class="name">x</span> { <span class="type"><a href="qml-springanimation.html">SpringAnimation</a></span> { <span class="name">spring</span>: <span class="number">3</span>; <span class="name">damping</span>: <span class="number">0.2</span> } }
         Behavior on <span class="name">y</span> { <span class="type"><a href="qml-springanimation.html">SpringAnimation</a></span> { <span class="name">spring</span>: <span class="number">3</span>; <span class="name">damping</span>: <span class="number">0.2</span> } }
     }
 }

 <span class="type"><a href="qml-gridview.html">GridView</a></span> {
     <span class="name">id</span>: <span class="name">view</span>
     <span class="name">width</span>: <span class="number">300</span>; <span class="name">height</span>: <span class="number">200</span>
     <span class="name">cellWidth</span>: <span class="number">80</span>; <span class="name">cellHeight</span>: <span class="number">80</span>

     <span class="name">model</span>: <span class="name">ContactModel</span> {}
     <span class="name">delegate</span>: <span class="name">Column</span> {
         <span class="type"><a href="qml-image.html">Image</a></span> { <span class="name">source</span>: <span class="name">portrait</span>; <span class="name">anchors</span>.horizontalCenter: <span class="name">parent</span>.<span class="name">horizontalCenter</span> }
         <span class="type"><a href="qml-text.html">Text</a></span> { <span class="name">text</span>: <span class="name">name</span>; <span class="name">anchors</span>.horizontalCenter: <span class="name">parent</span>.<span class="name">horizontalCenter</span> }
     }

     <span class="name">highlight</span>: <span class="name">highlight</span>
     <span class="name">highlightFollowsCurrentItem</span>: <span class="number">false</span>
     <span class="name">focus</span>: <span class="number">true</span>
 }</pre>
</div></div><!-- @@@highlightFollowsCurrentItem -->
<br/>
<!-- $$$highlightItem -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="highlightItem-prop"></a><span class="qmlreadonly">read-only</span><span class="name">highlightItem</span> : <span class="type"><a href="qml-item.html">Item</a></span></p></td></tr></table></div><div class="qmldoc"><p>This holds the highlight item created from the <a href="qml-gridview.html#highlight-prop">highlight</a> component.</p>
<p>The highlightItem is managed by the view unless <a href="qml-gridview.html#highlightFollowsCurrentItem-prop">highlightFollowsCurrentItem</a> is set to false.</p>
<p><b>See also </b><a href="qml-gridview.html#highlight-prop">highlight</a> and <a href="qml-gridview.html#highlightFollowsCurrentItem-prop">highlightFollowsCurrentItem</a>.</p>
</div></div><!-- @@@highlightItem -->
<br/>
<!-- $$$highlightMoveDuration -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="highlightMoveDuration-prop"></a><span class="name">highlightMoveDuration</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the move animation duration of the highlight delegate.</p>
<p><a href="qml-gridview.html#highlightFollowsCurrentItem-prop">highlightFollowsCurrentItem</a> must be true for this property to have effect.</p>
<p>The default value for the duration is 150ms.</p>
<p><b>See also </b><a href="qml-gridview.html#highlightFollowsCurrentItem-prop">highlightFollowsCurrentItem</a>.</p>
</div></div><!-- @@@highlightMoveDuration -->
<br/>
<!-- $$$keyNavigationWraps -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="keyNavigationWraps-prop"></a><span class="name">keyNavigationWraps</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds whether the grid wraps key navigation</p>
<p>If this is true, key navigation that would move the current item selection past one end of the view instead wraps around and moves the selection to the other end of the view.</p>
<p>By default, key navigation is not wrapped.</p>
</div></div><!-- @@@keyNavigationWraps -->
<br/>
<!-- $$$layoutDirection -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="layoutDirection-prop"></a><span class="name">layoutDirection</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the layout direction of the grid.</p>
<p>Possible values:</p>
<ul>
<li>Qt.LeftToRight (default) - Items will be laid out starting in the top, left corner. The flow is dependent on the <a href="qml-gridview.html#flow-prop">GridView::flow</a> property.</li>
<li>Qt.RightToLeft - Items will be laid out starting in the top, right corner. The flow is dependent on the <a href="qml-gridview.html#flow-prop">GridView::flow</a> property.</li>
</ul>
<p>When using the attached property <a href="qml-layoutmirroring.html#enabled-prop">LayoutMirroring::enabled</a> for locale layouts, the layout direction of the grid view will be mirrored. However, the actual property <tt>layoutDirection</tt> will remain unchanged. You can use the property <a href="qml-layoutmirroring.html#enabled-prop">LayoutMirroring::enabled</a> to determine whether the direction has been mirrored.</p>
<p><b>See also </b><a href="qml-layoutmirroring.html">LayoutMirroring</a>.</p>
</div></div><!-- @@@layoutDirection -->
<br/>
<!-- $$$model -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="model-prop"></a><span class="name">model</span> : <span class="type">model</span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the model providing data for the grid.</p>
<p>The model provides the set of data that is used to create the items in the view. Models can be created directly in QML using <a href="qml-listmodel.html">ListModel</a>, <a href="qml-xmllistmodel.html">XmlListModel</a> or <a href="qml-visualitemmodel.html">VisualItemModel</a>, or provided by C++ model classes. If a C++ model class is used, it must be a subclass of <a href="qabstractitemmodel.html">QAbstractItemModel</a> or a simple list.</p>
<p><b>See also </b><a href="qdeclarativemodels.html#qmlmodels">Data Models</a>.</p>
</div></div><!-- @@@model -->
<br/>
<!-- $$$preferredHighlightBegin -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="preferredHighlightBegin-prop"></a><span class="name">preferredHighlightBegin</span> : <span class="type"><a href="qml-real.html">real</a></span></p></td></tr><tr valign="top" class="even"><td class="tblQmlPropNode"><p><a name="preferredHighlightEnd-prop"></a><span class="name">preferredHighlightEnd</span> : <span class="type"><a href="qml-real.html">real</a></span></p></td></tr><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="highlightRangeMode-prop"></a><span class="name">highlightRangeMode</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>These properties define the preferred range of the highlight (for the current item) within the view. The <tt>preferredHighlightBegin</tt> value must be less than the <tt>preferredHighlightEnd</tt> value.</p>
<p>These properties affect the position of the current item when the view is scrolled. For example, if the currently selected item should stay in the middle of the view when it is scrolled, set the <tt>preferredHighlightBegin</tt> and <tt>preferredHighlightEnd</tt> values to the top and bottom coordinates of where the middle item would be. If the <tt>currentItem</tt> is changed programmatically, the view will automatically scroll so that the current item is in the middle of the view. Furthermore, the behavior of the current item index will occur whether or not a highlight exists.</p>
<p>Valid values for <tt>highlightRangeMode</tt> are:</p>
<ul>
<li><a href="qml-gridview.html">GridView</a>.ApplyRange - the view attempts to maintain the highlight within the range. However, the highlight can move outside of the range at the ends of the view or due to mouse interaction.</li>
<li><a href="qml-gridview.html">GridView</a>.StrictlyEnforceRange - the highlight never moves outside of the range. The current item changes if a keyboard or mouse action would cause the highlight to move outside of the range.</li>
<li><a href="qml-gridview.html">GridView</a>.NoHighlightRange - this is the default value.</li>
</ul>
</div></div><!-- @@@preferredHighlightBegin -->
<br/>
<!-- $$$snapMode -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="snapMode-prop"></a><span class="name">snapMode</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property determines how the view scrolling will settle following a drag or flick. The possible values are:</p>
<ul>
<li><a href="qml-gridview.html">GridView</a>.NoSnap (default) - the view stops anywhere within the visible area.</li>
<li><a href="qml-gridview.html">GridView</a>.SnapToRow - the view settles with a row (or column for <tt>GridView.TopToBottom</tt> flow) aligned with the start of the view.</li>
<li><a href="qml-gridview.html">GridView</a>.SnapOneRow - the view will settle no more than one row (or column for <tt>GridView.TopToBottom</tt> flow) away from the first visible row at the time the mouse button is released. This mode is particularly useful for moving one page at a time.</li>
</ul>
</div></div><!-- @@@snapMode -->
<br/>
<h2>Attached Property Documentation</h2>
<!-- $$$delayRemove -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="delayRemove-prop"></a><span class="qmlreadonly">read-only</span><span class="name">GridView.delayRemove</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This attached property holds whether the delegate may be destroyed.</p>
<p>It is attached to each instance of the delegate.</p>
<p>It is sometimes necessary to delay the destruction of an item until an animation completes.</p>
<p>The example below ensures that the animation completes before the item is removed from the grid.</p>
<pre class="qml"> <span class="type"><a href="qml-component.html">Component</a></span> {
     <span class="name">id</span>: <span class="name">delegate</span>
     <span class="type"><a href="qml-item.html">Item</a></span> {
         <span class="name">GridView</span>.onRemove: <span class="name">SequentialAnimation</span> {
             <span class="type"><a href="qml-propertyaction.html">PropertyAction</a></span> { <span class="name">target</span>: <span class="name">wrapper</span>; <span class="name">property</span>: <span class="string">&quot;GridView.delayRemove&quot;</span>; <span class="name">value</span>: <span class="number">true</span> }
             <span class="type"><a href="qml-numberanimation.html">NumberAnimation</a></span> { <span class="name">target</span>: <span class="name">wrapper</span>; <span class="name">property</span>: <span class="string">&quot;scale&quot;</span>; <span class="name">to</span>: <span class="number">0</span>; <span class="name">duration</span>: <span class="number">250</span>; <span class="name">easing</span>.type: <span class="name">Easing</span>.<span class="name">InOutQuad</span> }
             <span class="type"><a href="qml-propertyaction.html">PropertyAction</a></span> { <span class="name">target</span>: <span class="name">wrapper</span>; <span class="name">property</span>: <span class="string">&quot;GridView.delayRemove&quot;</span>; <span class="name">value</span>: <span class="number">false</span> }
         }
     }
 }</pre>
</div></div><!-- @@@delayRemove -->
<br/>
<!-- $$$isCurrentItem -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="isCurrentItem-prop"></a><span class="qmlreadonly">read-only</span><span class="name">GridView.isCurrentItem</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This attached property is true if this delegate is the current item; otherwise false.</p>
<p>It is attached to each instance of the delegate.</p>
</div></div><!-- @@@isCurrentItem -->
<br/>
<!-- $$$view -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="view-prop"></a><span class="qmlreadonly">read-only</span><span class="name">GridView.view</span> : <span class="type">GridView</span></p></td></tr></table></div><div class="qmldoc"><p>This attached property holds the view that manages this delegate instance.</p>
<p>It is attached to each instance of the delegate.</p>
<pre class="qml"> <span class="type"><a href="qml-gridview.html">GridView</a></span> {
     <span class="name">width</span>: <span class="number">300</span>; <span class="name">height</span>: <span class="number">200</span>
     <span class="name">cellWidth</span>: <span class="number">80</span>; <span class="name">cellHeight</span>: <span class="number">80</span>

     <span class="type"><a href="qml-component.html">Component</a></span> {
         <span class="name">id</span>: <span class="name">contactsDelegate</span>
         <span class="type"><a href="qml-rectangle.html">Rectangle</a></span> {
             <span class="name">id</span>: <span class="name">wrapper</span>
             <span class="name">width</span>: <span class="number">80</span>
             <span class="name">height</span>: <span class="number">80</span>
             <span class="name">color</span>: <span class="name">GridView</span>.<span class="name">isCurrentItem</span> ? <span class="string">&quot;black&quot;</span> : <span class="string">&quot;red&quot;</span>
             <span class="type"><a href="qml-text.html">Text</a></span> {
                 <span class="name">id</span>: <span class="name">contactInfo</span>
                 <span class="name">text</span>: <span class="name">name</span> <span class="operator">+</span> <span class="string">&quot;: &quot;</span> <span class="operator">+</span> <span class="name">number</span>
                 <span class="name">color</span>: <span class="name">wrapper</span>.<span class="name">GridView</span>.<span class="name">isCurrentItem</span> ? <span class="string">&quot;red&quot;</span> : <span class="string">&quot;black&quot;</span>
             }
         }
     }

     <span class="name">model</span>: <span class="name">ContactModel</span> {}
     <span class="name">delegate</span>: <span class="name">contactsDelegate</span>
     <span class="name">focus</span>: <span class="number">true</span>
 }</pre>
</div></div><!-- @@@view -->
<br/>
<h2>Attached Signal Handler Documentation</h2>
<!-- $$$onAdd -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="onAdd-signal"></a>GridView::<span class="name">onAdd</span> ()</p></td></tr></table></div><div class="qmldoc"><p>This attached handler is called immediately after an item is added to the view.</p>
</div></div><!-- @@@onAdd -->
<br/>
<!-- $$$onRemove -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="onRemove-signal"></a>GridView::<span class="name">onRemove</span> ()</p></td></tr></table></div><div class="qmldoc"><p>This attached handler is called immediately before an item is removed from the view.</p>
</div></div><!-- @@@onRemove -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$indexAt -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="indexAt-method"></a><span class="type"><a href="qml-int.html">int</a></span> GridView::<span class="name">indexAt</span> ( <span class="type"><a href="qml-int.html">int</a></span> <i>x</i>, <span class="type"><a href="qml-int.html">int</a></span> <i>y</i> )</p></td></tr></table></div><div class="qmldoc"><p>Returns the index of the visible item containing the point <i>x</i>, <i>y</i> in content coordinates. If there is no item at the point specified, or the item is not visible -1 is returned.</p>
<p>If the item is outside the visible area, -1 is returned, regardless of whether an item will exist at that point when scrolled into view.</p>
<p><b>Note</b>: methods should only be called after the Component has completed.</p>
</div></div><!-- @@@indexAt -->
<br/>
<!-- $$$moveCurrentIndexDown -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="moveCurrentIndexDown-method"></a>GridView::<span class="name">moveCurrentIndexDown</span> ()</p></td></tr></table></div><div class="qmldoc"><p>Move the <a href="qml-gridview.html#currentIndex-prop">currentIndex</a> down one item in the view. The current index will wrap if <a href="qml-gridview.html#keyNavigationWraps-prop">keyNavigationWraps</a> is true and it is currently at the end. This method has no effect if the <a href="qml-gridview.html#count-prop">count</a> is zero.</p>
<p><b>Note</b>: methods should only be called after the Component has completed.</p>
</div></div><!-- @@@moveCurrentIndexDown -->
<br/>
<!-- $$$moveCurrentIndexLeft -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="moveCurrentIndexLeft-method"></a>GridView::<span class="name">moveCurrentIndexLeft</span> ()</p></td></tr></table></div><div class="qmldoc"><p>Move the <a href="qml-gridview.html#currentIndex-prop">currentIndex</a> left one item in the view. The current index will wrap if <a href="qml-gridview.html#keyNavigationWraps-prop">keyNavigationWraps</a> is true and it is currently at the end. This method has no effect if the <a href="qml-gridview.html#count-prop">count</a> is zero.</p>
<p><b>Note</b>: methods should only be called after the Component has completed.</p>
</div></div><!-- @@@moveCurrentIndexLeft -->
<br/>
<!-- $$$moveCurrentIndexRight -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="moveCurrentIndexRight-method"></a>GridView::<span class="name">moveCurrentIndexRight</span> ()</p></td></tr></table></div><div class="qmldoc"><p>Move the <a href="qml-gridview.html#currentIndex-prop">currentIndex</a> right one item in the view. The current index will wrap if <a href="qml-gridview.html#keyNavigationWraps-prop">keyNavigationWraps</a> is true and it is currently at the end. This method has no effect if the <a href="qml-gridview.html#count-prop">count</a> is zero.</p>
<p><b>Note</b>: methods should only be called after the Component has completed.</p>
</div></div><!-- @@@moveCurrentIndexRight -->
<br/>
<!-- $$$moveCurrentIndexUp -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="moveCurrentIndexUp-method"></a>GridView::<span class="name">moveCurrentIndexUp</span> ()</p></td></tr></table></div><div class="qmldoc"><p>Move the <a href="qml-gridview.html#currentIndex-prop">currentIndex</a> up one item in the view. The current index will wrap if <a href="qml-gridview.html#keyNavigationWraps-prop">keyNavigationWraps</a> is true and it is currently at the end. This method has no effect if the <a href="qml-gridview.html#count-prop">count</a> is zero.</p>
<p><b>Note</b>: methods should only be called after the Component has completed.</p>
</div></div><!-- @@@moveCurrentIndexUp -->
<br/>
<!-- $$$positionViewAtBeginning -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="positionViewAtBeginning-method"></a>GridView::<span class="name">positionViewAtBeginning</span> ()</p></td></tr></table></div><div class="qmldoc"><p>Positions the view at the beginning or end, taking into account any header or footer.</p>
<p>It is not recommended to use <a href="qml-flickable.html#contentX-prop">contentX</a> or <a href="qml-flickable.html#contentY-prop">contentY</a> to position the view at a particular index. This is unreliable since removing items from the start of the list does not cause all other items to be repositioned, and because the actual start of the view can vary based on the size of the delegates.</p>
<p><b>Note</b>: methods should only be called after the Component has completed. To position the view at startup, this method should be called by Component.onCompleted. For example, to position the view at the end on startup:</p>
<pre class="cpp"> Component<span class="operator">.</span>onCompleted: <a href="qml-gridview.html#positionViewAtEnd-method">positionViewAtEnd</a>()</pre>
<p>This documentation was introduced in  QtQuick 1.1.</p>
</div></div><!-- @@@positionViewAtBeginning -->
<br/>
<!-- $$$positionViewAtEnd -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="positionViewAtEnd-method"></a>GridView::<span class="name">positionViewAtEnd</span> ()</p></td></tr></table></div><div class="qmldoc"><p>Positions the view at the beginning or end, taking into account any header or footer.</p>
<p>It is not recommended to use <a href="qml-flickable.html#contentX-prop">contentX</a> or <a href="qml-flickable.html#contentY-prop">contentY</a> to position the view at a particular index. This is unreliable since removing items from the start of the list does not cause all other items to be repositioned, and because the actual start of the view can vary based on the size of the delegates.</p>
<p><b>Note</b>: methods should only be called after the Component has completed. To position the view at startup, this method should be called by Component.onCompleted. For example, to position the view at the end on startup:</p>
<pre class="cpp"> Component<span class="operator">.</span>onCompleted: positionViewAtEnd()</pre>
<p>This documentation was introduced in  QtQuick 1.1.</p>
</div></div><!-- @@@positionViewAtEnd -->
<br/>
<!-- $$$positionViewAtIndex -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="positionViewAtIndex-method"></a>GridView::<span class="name">positionViewAtIndex</span> ( <span class="type"><a href="qml-int.html">int</a></span> <i>index</i>, <span class="type">PositionMode</span> <i>mode</i> )</p></td></tr></table></div><div class="qmldoc"><p>Positions the view such that the <i>index</i> is at the position specified by <i>mode</i>:</p>
<ul>
<li><a href="qml-gridview.html">GridView</a>.Beginning - position item at the top (or left for <tt>GridView.TopToBottom</tt> flow) of the view.</li>
<li><a href="qml-gridview.html">GridView</a>.Center - position item in the center of the view.</li>
<li><a href="qml-gridview.html">GridView</a>.End - position item at bottom (or right for horizontal orientation) of the view.</li>
<li><a href="qml-gridview.html">GridView</a>.Visible - if any part of the item is visible then take no action, otherwise bring the item into view.</li>
<li><a href="qml-gridview.html">GridView</a>.Contain - ensure the entire item is visible. If the item is larger than the view the item is positioned at the top (or left for <tt>GridView.TopToBottom</tt> flow) of the view.</li>
</ul>
<p>If positioning the view at the index would cause empty space to be displayed at the beginning or end of the view, the view will be positioned at the boundary.</p>
<p>It is not recommended to use <a href="qml-flickable.html#contentX-prop">contentX</a> or <a href="qml-flickable.html#contentY-prop">contentY</a> to position the view at a particular index. This is unreliable since removing items from the start of the view does not cause all other items to be repositioned. The correct way to bring an item into view is with <tt>positionViewAtIndex</tt>.</p>
<p><b>Note</b>: methods should only be called after the Component has completed. To position the view at startup, this method should be called by Component.onCompleted. For example, to position the view at the end:</p>
<pre class="cpp"> Component<span class="operator">.</span>onCompleted: positionViewAtIndex(count <span class="operator">-</span> <span class="number">1</span><span class="operator">,</span> GridView<span class="operator">.</span>Beginning)</pre>
</div></div><!-- @@@positionViewAtIndex -->
<br/>
<p class="naviNextPrevious footerNavi">
</p>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      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>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      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>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>