Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 4790

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" />
<!-- qabstractitemmodel.cpp -->
  <title>Qt 4.8: QAbstractItemModel Class Reference</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="modules.html">Modules</a></li>
<li><a href="qtcore.html">QtCore</a></li>
<li>QAbstractItemModel</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">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#protected-slots">Protected Slots</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#subclassing">Subclassing</a></li>
</ul>
</div>
<h1 class="title">QAbstractItemModel Class Reference</h1>
<!-- $$$QAbstractItemModel-brief -->
<p>The QAbstractItemModel class provides the abstract interface for item model classes. <a href="#details">More...</a></p>
<!-- @@@QAbstractItemModel -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QAbstractItemModel&gt;</span></pre><p><b>Inherits: </b><a href="qobject.html">QObject</a>.</p>
<p><b>Inherited by: </b><a href="qabstractlistmodel.html">QAbstractListModel</a>, <a href="qabstractproxymodel.html">QAbstractProxyModel</a>, <a href="qabstracttablemodel.html">QAbstractTableModel</a>, <a href="qdirmodel.html" class="obsolete">QDirModel</a>, <a href="qfilesystemmodel.html">QFileSystemModel</a>, <a href="qhelpcontentmodel.html">QHelpContentModel</a>, <a href="qproxymodel.html" class="obsolete">QProxyModel</a>, and <a href="qstandarditemmodel.html">QStandardItemModel</a>.</p>
<ul>
<li><a href="qabstractitemmodel-members.html">List of all members, including inherited members</a></li>
<li><a href="qabstractitemmodel-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#QAbstractItemModel">QAbstractItemModel</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#dtor.QAbstractItemModel">~QAbstractItemModel</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#buddy">buddy</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#canFetchMore">canFetchMore</a></b> ( const QModelIndex &amp; <i>parent</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#columnCount">columnCount</a></b> ( const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#data">data</a></b> ( const QModelIndex &amp; <i>index</i>, int <i>role</i> = Qt::DisplayRole ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#dropMimeData">dropMimeData</a></b> ( const QMimeData * <i>data</i>, Qt::DropAction <i>action</i>, int <i>row</i>, int <i>column</i>, const QModelIndex &amp; <i>parent</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#fetchMore">fetchMore</a></b> ( const QModelIndex &amp; <i>parent</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual Qt::ItemFlags </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#flags">flags</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#hasChildren">hasChildren</a></b> ( const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#hasIndex">hasIndex</a></b> ( int <i>row</i>, int <i>column</i>, const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#headerData">headerData</a></b> ( int <i>section</i>, Qt::Orientation <i>orientation</i>, int <i>role</i> = Qt::DisplayRole ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#index">index</a></b> ( int <i>row</i>, int <i>column</i>, const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#insertColumn">insertColumn</a></b> ( int <i>column</i>, const QModelIndex &amp; <i>parent</i> = QModelIndex() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#insertColumns">insertColumns</a></b> ( int <i>column</i>, int <i>count</i>, const QModelIndex &amp; <i>parent</i> = QModelIndex() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#insertRow">insertRow</a></b> ( int <i>row</i>, const QModelIndex &amp; <i>parent</i> = QModelIndex() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#insertRows">insertRows</a></b> ( int <i>row</i>, int <i>count</i>, const QModelIndex &amp; <i>parent</i> = QModelIndex() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QMap&lt;int, QVariant&gt; </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#itemData">itemData</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QModelIndexList </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#match">match</a></b> ( const QModelIndex &amp; <i>start</i>, int <i>role</i>, const QVariant &amp; <i>value</i>, int <i>hits</i> = 1, Qt::MatchFlags <i>flags</i> = Qt::MatchFlags( Qt::MatchStartsWith | Qt::MatchWrap ) ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QMimeData * </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#mimeData">mimeData</a></b> ( const QModelIndexList &amp; <i>indexes</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QStringList </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#mimeTypes">mimeTypes</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#parent">parent</a></b> ( const QModelIndex &amp; <i>index</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#removeColumn">removeColumn</a></b> ( int <i>column</i>, const QModelIndex &amp; <i>parent</i> = QModelIndex() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#removeColumns">removeColumns</a></b> ( int <i>column</i>, int <i>count</i>, const QModelIndex &amp; <i>parent</i> = QModelIndex() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#removeRow">removeRow</a></b> ( int <i>row</i>, const QModelIndex &amp; <i>parent</i> = QModelIndex() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#removeRows">removeRows</a></b> ( int <i>row</i>, int <i>count</i>, const QModelIndex &amp; <i>parent</i> = QModelIndex() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QHash&lt;int, QByteArray&gt; &amp; </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#roleNames">roleNames</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#rowCount">rowCount</a></b> ( const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#setData">setData</a></b> ( const QModelIndex &amp; <i>index</i>, const QVariant &amp; <i>value</i>, int <i>role</i> = Qt::EditRole )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#setHeaderData">setHeaderData</a></b> ( int <i>section</i>, Qt::Orientation <i>orientation</i>, const QVariant &amp; <i>value</i>, int <i>role</i> = Qt::EditRole )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#setItemData">setItemData</a></b> ( const QModelIndex &amp; <i>index</i>, const QMap&lt;int, QVariant&gt; &amp; <i>roles</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#setSupportedDragActions">setSupportedDragActions</a></b> ( Qt::DropActions <i>actions</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#sibling">sibling</a></b> ( int <i>row</i>, int <i>column</i>, const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#sort">sort</a></b> ( int <i>column</i>, Qt::SortOrder <i>order</i> = Qt::AscendingOrder )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#span">span</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::DropActions </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#supportedDragActions">supportedDragActions</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual Qt::DropActions </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#supportedDropActions">supportedDropActions</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#revert">revert</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#submit">submit</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#columnsAboutToBeInserted">columnsAboutToBeInserted</a></b> ( const QModelIndex &amp; <i>parent</i>, int <i>start</i>, int <i>end</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#columnsAboutToBeMoved">columnsAboutToBeMoved</a></b> ( const QModelIndex &amp; <i>sourceParent</i>, int <i>sourceStart</i>, int <i>sourceEnd</i>, const QModelIndex &amp; <i>destinationParent</i>, int <i>destinationColumn</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#columnsAboutToBeRemoved">columnsAboutToBeRemoved</a></b> ( const QModelIndex &amp; <i>parent</i>, int <i>start</i>, int <i>end</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#columnsInserted">columnsInserted</a></b> ( const QModelIndex &amp; <i>parent</i>, int <i>start</i>, int <i>end</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#columnsMoved">columnsMoved</a></b> ( const QModelIndex &amp; <i>sourceParent</i>, int <i>sourceStart</i>, int <i>sourceEnd</i>, const QModelIndex &amp; <i>destinationParent</i>, int <i>destinationColumn</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#columnsRemoved">columnsRemoved</a></b> ( const QModelIndex &amp; <i>parent</i>, int <i>start</i>, int <i>end</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#dataChanged">dataChanged</a></b> ( const QModelIndex &amp; <i>topLeft</i>, const QModelIndex &amp; <i>bottomRight</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#headerDataChanged">headerDataChanged</a></b> ( Qt::Orientation <i>orientation</i>, int <i>first</i>, int <i>last</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#layoutAboutToBeChanged">layoutAboutToBeChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#layoutChanged">layoutChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#modelAboutToBeReset">modelAboutToBeReset</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#modelReset">modelReset</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#rowsAboutToBeInserted">rowsAboutToBeInserted</a></b> ( const QModelIndex &amp; <i>parent</i>, int <i>start</i>, int <i>end</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#rowsAboutToBeMoved">rowsAboutToBeMoved</a></b> ( const QModelIndex &amp; <i>sourceParent</i>, int <i>sourceStart</i>, int <i>sourceEnd</i>, const QModelIndex &amp; <i>destinationParent</i>, int <i>destinationRow</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#rowsAboutToBeRemoved">rowsAboutToBeRemoved</a></b> ( const QModelIndex &amp; <i>parent</i>, int <i>start</i>, int <i>end</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#rowsInserted">rowsInserted</a></b> ( const QModelIndex &amp; <i>parent</i>, int <i>start</i>, int <i>end</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#rowsMoved">rowsMoved</a></b> ( const QModelIndex &amp; <i>sourceParent</i>, int <i>sourceStart</i>, int <i>sourceEnd</i>, const QModelIndex &amp; <i>destinationParent</i>, int <i>destinationRow</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#rowsRemoved">rowsRemoved</a></b> ( const QModelIndex &amp; <i>parent</i>, int <i>start</i>, int <i>end</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#beginInsertColumns">beginInsertColumns</a></b> ( const QModelIndex &amp; <i>parent</i>, int <i>first</i>, int <i>last</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows</a></b> ( const QModelIndex &amp; <i>parent</i>, int <i>first</i>, int <i>last</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#beginMoveColumns">beginMoveColumns</a></b> ( const QModelIndex &amp; <i>sourceParent</i>, int <i>sourceFirst</i>, int <i>sourceLast</i>, const QModelIndex &amp; <i>destinationParent</i>, int <i>destinationChild</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#beginMoveRows">beginMoveRows</a></b> ( const QModelIndex &amp; <i>sourceParent</i>, int <i>sourceFirst</i>, int <i>sourceLast</i>, const QModelIndex &amp; <i>destinationParent</i>, int <i>destinationChild</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#beginRemoveColumns">beginRemoveColumns</a></b> ( const QModelIndex &amp; <i>parent</i>, int <i>first</i>, int <i>last</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#beginRemoveRows">beginRemoveRows</a></b> ( const QModelIndex &amp; <i>parent</i>, int <i>first</i>, int <i>last</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#beginResetModel">beginResetModel</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#changePersistentIndex">changePersistentIndex</a></b> ( const QModelIndex &amp; <i>from</i>, const QModelIndex &amp; <i>to</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#changePersistentIndexList">changePersistentIndexList</a></b> ( const QModelIndexList &amp; <i>from</i>, const QModelIndexList &amp; <i>to</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#createIndex">createIndex</a></b> ( int <i>row</i>, int <i>column</i>, void * <i>ptr</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#createIndex-3">createIndex</a></b> ( int <i>row</i>, int <i>column</i>, quint32 <i>id</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#endInsertColumns">endInsertColumns</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#endInsertRows">endInsertRows</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#endMoveColumns">endMoveColumns</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#endMoveRows">endMoveRows</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#endRemoveColumns">endRemoveColumns</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#endRemoveRows">endRemoveRows</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#endResetModel">endResetModel</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QModelIndexList </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#persistentIndexList">persistentIndexList</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#reset">reset</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#setRoleNames">setRoleNames</a></b> ( const QHash&lt;int, QByteArray&gt; &amp; <i>roleNames</i> )</td></tr>
</table>
<ul>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="protected-slots"></a>
<h2>Protected Slots</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractitemmodel.html#resetInternalData">resetInternalData</a></b> ()</td></tr>
</table>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QAbstractItemModel-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QAbstractItemModel class provides the abstract interface for item model classes.</p>
<p>The QAbstractItemModel class defines the standard interface that item models must use to be able to interoperate with other components in the model/view architecture. It is not supposed to be instantiated directly. Instead, you should subclass it to create new models.</p>
<p>The QAbstractItemModel class is one of the <a href="model-view.html">Model/View Classes</a> and is part of Qt's <a href="model-view-programming.html">model/view framework</a>.</p>
<p>If you need a model to use with a <a href="qlistview.html">QListView</a> or a <a href="qtableview.html">QTableView</a>, you should consider subclassing <a href="qabstractlistmodel.html">QAbstractListModel</a> or <a href="qabstracttablemodel.html">QAbstractTableModel</a> instead of this class.</p>
<p>The underlying data model is exposed to views and delegates as a hierarchy of tables. If you do not make use of the hierarchy, then the model is a simple table of rows and columns. Each item has a unique index specified by a <a href="qmodelindex.html">QModelIndex</a>.</p>
<p class="centerAlign"><img src="images/modelindex-no-parent.png" alt="" /></p><p>Every item of data that can be accessed via a model has an associated model index. You can obtain this model index using the <a href="qabstractitemmodel.html#index">index</a>() function. Each index may have a <a href="qabstractitemmodel.html#sibling">sibling</a>() index; child items have a <a href="qabstractitemmodel.html#parent">parent</a>() index.</p>
<p>Each item has a number of data elements associated with it and they can be retrieved by specifying a role (see <a href="qt.html#ItemDataRole-enum">Qt::ItemDataRole</a>) to the model's <a href="qabstractitemmodel.html#data">data</a>() function. Data for all available roles can be obtained at the same time using the <a href="qabstractitemmodel.html#itemData">itemData</a>() function.</p>
<p>Data for each role is set using a particular <a href="qt.html#ItemDataRole-enum">Qt::ItemDataRole</a>. Data for individual roles are set individually with <a href="qabstractitemmodel.html#setData">setData</a>(), or they can be set for all roles with <a href="qabstractitemmodel.html#setItemData">setItemData</a>().</p>
<p>Items can be queried with <a href="qabstractitemmodel.html#flags">flags</a>() (see <a href="qt.html#ItemFlag-enum">Qt::ItemFlag</a>) to see if they can be selected, dragged, or manipulated in other ways.</p>
<p>If an item has child objects, <a href="qabstractitemmodel.html#hasChildren">hasChildren</a>() returns true for the corresponding index.</p>
<p>The model has a <a href="qabstractitemmodel.html#rowCount">rowCount</a>() and a <a href="qabstractitemmodel.html#columnCount">columnCount</a>() for each level of the hierarchy. Rows and columns can be inserted and removed with <a href="qabstractitemmodel.html#insertRows">insertRows</a>(), <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>(), <a href="qabstractitemmodel.html#removeRows">removeRows</a>(), and <a href="qabstractitemmodel.html#removeColumns">removeColumns</a>().</p>
<p>The model emits signals to indicate changes. For example, <a href="qabstractitemmodel.html#dataChanged">dataChanged</a>() is emitted whenever items of data made available by the model are changed. Changes to the headers supplied by the model cause <a href="qabstractitemmodel.html#headerDataChanged">headerDataChanged</a>() to be emitted. If the structure of the underlying data changes, the model can emit <a href="qabstractitemmodel.html#layoutChanged">layoutChanged</a>() to indicate to any attached views that they should redisplay any items shown, taking the new structure into account.</p>
<p>The items available through the model can be searched for particular data using the <a href="qabstractitemmodel.html#match">match</a>() function.</p>
<p>To sort the model, you can use <a href="qabstractitemmodel.html#sort">sort</a>().</p>
<a name="subclassing"></a>
<h3>Subclassing</h3>
<p><b>Note:</b> Some general guidelines for subclassing models are available in the <a href="model-view-programming.html#model-subclassing-reference">Model Subclassing Reference</a>.</p>
<p>When subclassing QAbstractItemModel, at the very least you must implement <a href="qabstractitemmodel.html#index">index</a>(), <a href="qabstractitemmodel.html#parent">parent</a>(), <a href="qabstractitemmodel.html#rowCount">rowCount</a>(), <a href="qabstractitemmodel.html#columnCount">columnCount</a>(), and <a href="qabstractitemmodel.html#data">data</a>(). These functions are used in all read-only models, and form the basis of editable models.</p>
<p>You can also reimplement <a href="qabstractitemmodel.html#hasChildren">hasChildren</a>() to provide special behavior for models where the implementation of <a href="qabstractitemmodel.html#rowCount">rowCount</a>() is expensive. This makes it possible for models to restrict the amount of data requested by views, and can be used as a way to implement lazy population of model data.</p>
<p>To enable editing in your model, you must also implement <a href="qabstractitemmodel.html#setData">setData</a>(), and reimplement <a href="qabstractitemmodel.html#flags">flags</a>() to ensure that <tt>ItemIsEditable</tt> is returned. You can also reimplement <a href="qabstractitemmodel.html#headerData">headerData</a>() and <a href="qabstractitemmodel.html#setHeaderData">setHeaderData</a>() to control the way the headers for your model are presented.</p>
<p>The <a href="qabstractitemmodel.html#dataChanged">dataChanged</a>() and <a href="qabstractitemmodel.html#headerDataChanged">headerDataChanged</a>() signals must be emitted explicitly when reimplementing the <a href="qabstractitemmodel.html#setData">setData</a>() and <a href="qabstractitemmodel.html#setHeaderData">setHeaderData</a>() functions, respectively.</p>
<p>Custom models need to create model indexes for other components to use. To do this, call <a href="qabstractitemmodel.html#createIndex">createIndex</a>() with suitable row and column numbers for the item, and an identifier for it, either as a pointer or as an integer value. The combination of these values must be unique for each item. Custom models typically use these unique identifiers in other reimplemented functions to retrieve item data and access information about the item's parents and children. See the <a href="itemviews-simpletreemodel.html">Simple Tree Model Example</a> for more information about unique identifiers.</p>
<p>It is not necessary to support every role defined in <a href="qt.html#ItemDataRole-enum">Qt::ItemDataRole</a>. Depending on the type of data contained within a model, it may only be useful to implement the <a href="qabstractitemmodel.html#data">data</a>() function to return valid information for some of the more common roles. Most models provide at least a textual representation of item data for the <a href="qt.html#ItemDataRole-enum">Qt::DisplayRole</a>, and well-behaved models should also provide valid information for the <a href="qt.html#ItemDataRole-enum">Qt::ToolTipRole</a> and <a href="qt.html#ItemDataRole-enum">Qt::WhatsThisRole</a>. Supporting these roles enables models to be used with standard Qt views. However, for some models that handle highly-specialized data, it may be appropriate to provide data only for user-defined roles.</p>
<p>Models that provide interfaces to resizable data structures can provide implementations of <a href="qabstractitemmodel.html#insertRows">insertRows</a>(), <a href="qabstractitemmodel.html#removeRows">removeRows</a>(), <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>(),and <a href="qabstractitemmodel.html#removeColumns">removeColumns</a>(). When implementing these functions, it is important to notify any connected views about changes to the model's dimensions both <i>before</i> and <i>after</i> they occur:</p>
<ul>
<li>An <a href="qabstractitemmodel.html#insertRows">insertRows</a>() implementation must call <a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows</a>() <i>before</i> inserting new rows into the data structure, and <a href="qabstractitemmodel.html#endInsertRows">endInsertRows</a>() <i>immediately afterwards</i>.</li>
<li>An <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>() implementation must call <a href="qabstractitemmodel.html#beginInsertColumns">beginInsertColumns</a>() <i>before</i> inserting new columns into the data structure, and <a href="qabstractitemmodel.html#endInsertColumns">endInsertColumns</a>() <i>immediately afterwards</i>.</li>
<li>A <a href="qabstractitemmodel.html#removeRows">removeRows</a>() implementation must call <a href="qabstractitemmodel.html#beginRemoveRows">beginRemoveRows</a>() <i>before</i> the rows are removed from the data structure, and <a href="qabstractitemmodel.html#endRemoveRows">endRemoveRows</a>() <i>immediately afterwards</i>.</li>
<li>A <a href="qabstractitemmodel.html#removeColumns">removeColumns</a>() implementation must call <a href="qabstractitemmodel.html#beginRemoveColumns">beginRemoveColumns</a>() <i>before</i> the columns are removed from the data structure, and <a href="qabstractitemmodel.html#endRemoveColumns">endRemoveColumns</a>() <i>immediately afterwards</i>.</li>
</ul>
<p>The <i>private</i> signals that these functions emit give attached components the chance to take action before any data becomes unavailable. The encapsulation of the insert and remove operations with these begin and end functions also enables the model to manage <a href="qpersistentmodelindex.html">persistent model indexes</a> correctly. <b>If you want selections to be handled properly, you must ensure that you call these functions.</b> If you insert or remove an item with children, you do not need to call these functions for the child items. In other words, the parent item will take care of its child items.</p>
<p>To create models that populate incrementally, you can reimplement <a href="qabstractitemmodel.html#fetchMore">fetchMore</a>() and <a href="qabstractitemmodel.html#canFetchMore">canFetchMore</a>(). If the reimplementation of <a href="qabstractitemmodel.html#fetchMore">fetchMore</a>() adds rows to the model, <a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows()</a> and <a href="qabstractitemmodel.html#endInsertRows">endInsertRows()</a> must be called.</p>
</div>
<p><b>See also </b><a href="model-view-programming.html#model-classes">Model Classes</a>, <a href="model-view-programming.html#model-subclassing-reference">Model Subclassing Reference</a>, <a href="qmodelindex.html">QModelIndex</a>, <a href="qabstractitemview.html">QAbstractItemView</a>, <a href="model-view-programming.html#using-drag-and-drop-with-item-views">Using drag and drop with item views</a>, <a href="itemviews-simpledommodel.html">Simple DOM Model Example</a>, <a href="itemviews-simpletreemodel.html">Simple Tree Model Example</a>, <a href="itemviews-editabletreemodel.html">Editable Tree Model Example</a>, and <a href="itemviews-fetchmore.html">Fetch More Example</a>.</p>
<!-- @@@QAbstractItemModel -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QAbstractItemModel[overload1]$$$QAbstractItemModelQObject* -->
<h3 class="fn"><a name="QAbstractItemModel"></a>QAbstractItemModel::<span class="name">QAbstractItemModel</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs an abstract item model with the given <i>parent</i>.</p>
<!-- @@@QAbstractItemModel -->
<!-- $$$~QAbstractItemModel[overload1]$$$~QAbstractItemModel -->
<h3 class="fn"><a name="dtor.QAbstractItemModel"></a>QAbstractItemModel::<span class="name">~QAbstractItemModel</span> ()<tt> [virtual]</tt></h3>
<p>Destroys the abstract item model.</p>
<!-- @@@~QAbstractItemModel -->
<!-- $$$beginInsertColumns[overload1]$$$beginInsertColumnsconstQModelIndex&intint -->
<h3 class="fn"><a name="beginInsertColumns"></a><span class="type">void</span> QAbstractItemModel::<span class="name">beginInsertColumns</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i>, <span class="type">int</span> <i>first</i>, <span class="type">int</span> <i>last</i> )<tt> [protected]</tt></h3>
<p>Begins a column insertion operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>() in a subclass, you must call this function <i>before</i> inserting data into the model's underlying data store.</p>
<p>The <i>parent</i> index corresponds to the parent into which the new columns are inserted; <i>first</i> and <i>last</i> are the column numbers of the new columns will have after they have been inserted.</p>
<table class="generic" width="80%">
 <tr valign="top" class="odd"><td ><img src="images/modelview-begin-insert-columns.png" alt="Inserting columns" /></td><td >Specify the first and last column numbers for the span of columns you want to insert into an item in a model.<p>For example, as shown in the diagram, we insert three columns before column 4, so <i>first</i> is 4 and <i>last</i> is 6:</p>
<pre class="cpp"> beginInsertColumns(parent<span class="operator">,</span> <span class="number">4</span><span class="operator">,</span> <span class="number">6</span>);</pre>
<p>This inserts the three new columns as columns 4, 5, and 6.</p>
</td></tr>
<tr valign="top" class="even"><td ><img src="images/modelview-begin-append-columns.png" alt="Appending columns" /></td><td >To append columns, insert them after the last column.<p>For example, as shown in the diagram, we append three columns to a collection of six existing columns (ending in column 5), so <i>first</i> is 6 and <i>last</i> is 8:</p>
<pre class="cpp"> beginInsertColumns(parent<span class="operator">,</span> <span class="number">6</span><span class="operator">,</span> <span class="number">8</span>);</pre>
<p>This appends the two new columns as columns 6, 7, and 8.</p>
</td></tr>
</table>
<p><b>Note:</b> This function emits the <a href="qabstractitemmodel.html#columnsAboutToBeInserted">columnsAboutToBeInserted</a>() signal which connected views (or proxies) must handle before the data is inserted. Otherwise, the views may end up in an invalid state.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#endInsertColumns">endInsertColumns</a>().</p>
<!-- @@@beginInsertColumns -->
<!-- $$$beginInsertRows[overload1]$$$beginInsertRowsconstQModelIndex&intint -->
<h3 class="fn"><a name="beginInsertRows"></a><span class="type">void</span> QAbstractItemModel::<span class="name">beginInsertRows</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i>, <span class="type">int</span> <i>first</i>, <span class="type">int</span> <i>last</i> )<tt> [protected]</tt></h3>
<p>Begins a row insertion operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#insertRows">insertRows</a>() in a subclass, you must call this function <i>before</i> inserting data into the model's underlying data store.</p>
<p>The <i>parent</i> index corresponds to the parent into which the new rows are inserted; <i>first</i> and <i>last</i> are the row numbers that the new rows will have after they have been inserted.</p>
<table class="generic" width="80%">
 <tr valign="top" class="odd"><td ><img src="images/modelview-begin-insert-rows.png" alt="Inserting rows" /></td><td >Specify the first and last row numbers for the span of rows you want to insert into an item in a model.<p>For example, as shown in the diagram, we insert three rows before row 2, so <i>first</i> is 2 and <i>last</i> is 4:</p>
<pre class="cpp"> beginInsertRows(parent<span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">4</span>);</pre>
<p>This inserts the three new rows as rows 2, 3, and 4.</p>
</td></tr>
<tr valign="top" class="even"><td ><img src="images/modelview-begin-append-rows.png" alt="Appending rows" /></td><td >To append rows, insert them after the last row.<p>For example, as shown in the diagram, we append two rows to a collection of 4 existing rows (ending in row 3), so <i>first</i> is 4 and <i>last</i> is 5:</p>
<pre class="cpp"> beginInsertRows(parent<span class="operator">,</span> <span class="number">4</span><span class="operator">,</span> <span class="number">5</span>);</pre>
<p>This appends the two new rows as rows 4 and 5.</p>
</td></tr>
</table>
<p><b>Note:</b> This function emits the <a href="qabstractitemmodel.html#rowsAboutToBeInserted">rowsAboutToBeInserted</a>() signal which connected views (or proxies) must handle before the data is inserted. Otherwise, the views may end up in an invalid state.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#endInsertRows">endInsertRows</a>().</p>
<!-- @@@beginInsertRows -->
<!-- $$$beginMoveColumns[overload1]$$$beginMoveColumnsconstQModelIndex&intintconstQModelIndex&int -->
<h3 class="fn"><a name="beginMoveColumns"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">beginMoveColumns</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>sourceParent</i>, <span class="type">int</span> <i>sourceFirst</i>, <span class="type">int</span> <i>sourceLast</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>destinationParent</i>, <span class="type">int</span> <i>destinationChild</i> )<tt> [protected]</tt></h3>
<p>Begins a column move operation.</p>
<p>When reimplementing a subclass, this method simplifies moving entities in your model. This method is responsible for moving persistent indexes in the model, which you would otherwise be required to do yourself. Using beginMoveRows and endMoveRows is an alternative to emitting layoutAboutToBeChanged and layoutChanged directly along with changePersistentIndexes. layoutAboutToBeChanged is emitted by this method for compatibility reasons.</p>
<p>The <i>sourceParent</i> index corresponds to the parent from which the columns are moved; <i>sourceFirst</i> and <i>sourceLast</i> are the first and last column numbers of the columns to be moved. The <i>destinationParent</i> index corresponds to the parent into which those columns are moved. The <i>destinationChild</i> is the column to which the columns will be moved. That is, the index at column <i>sourceFirst</i> in <i>sourceParent</i> will become column <i>destinationChild</i> in <i>destinationParent</i>, followed by all other columns up to <i>sourceLast</i>.</p>
<p>However, when moving columns down in the same parent (<i>sourceParent</i> and <i>destinationParent</i> are equal), the columnss will be placed before the <i>destinationChild</i> index. That is, if you wish to move columns 0 and 1 so they will become columns 1 and 2, <i>destinationChild</i> should be 3. In this case, the new index for the source column <tt>i</tt> (which is between <i>sourceFirst</i> and <i>sourceLast</i>) is equal to <tt>(destinationChild-sourceLast-1+i)</tt>.</p>
<p>Note that if <i>sourceParent</i> and <i>destinationParent</i> are the same, you must ensure that the <i>destinationChild</i> is not within the range of <i>sourceFirst</i> and <i>sourceLast</i> + 1. You must also ensure that you do not attempt to move a column to one of its own children or ancestors. This method returns false if either condition is true, in which case you should abort your move operation.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#endMoveColumns">endMoveColumns</a>().</p>
<!-- @@@beginMoveColumns -->
<!-- $$$beginMoveRows[overload1]$$$beginMoveRowsconstQModelIndex&intintconstQModelIndex&int -->
<h3 class="fn"><a name="beginMoveRows"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">beginMoveRows</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>sourceParent</i>, <span class="type">int</span> <i>sourceFirst</i>, <span class="type">int</span> <i>sourceLast</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>destinationParent</i>, <span class="type">int</span> <i>destinationChild</i> )<tt> [protected]</tt></h3>
<p>Begins a row move operation.</p>
<p>When reimplementing a subclass, this method simplifies moving entities in your model. This method is responsible for moving persistent indexes in the model, which you would otherwise be required to do yourself. Using beginMoveRows and endMoveRows is an alternative to emitting layoutAboutToBeChanged and layoutChanged directly along with changePersistentIndexes. layoutAboutToBeChanged is emitted by this method for compatibility reasons.</p>
<p>The <i>sourceParent</i> index corresponds to the parent from which the rows are moved; <i>sourceFirst</i> and <i>sourceLast</i> are the first and last row numbers of the rows to be moved. The <i>destinationParent</i> index corresponds to the parent into which those rows are moved. The <i>destinationChild</i> is the row to which the rows will be moved. That is, the index at row <i>sourceFirst</i> in <i>sourceParent</i> will become row <i>destinationChild</i> in <i>destinationParent</i>, followed by all other rows up to <i>sourceLast</i>.</p>
<p>However, when moving rows down in the same parent (<i>sourceParent</i> and <i>destinationParent</i> are equal), the rows will be placed before the <i>destinationChild</i> index. That is, if you wish to move rows 0 and 1 so they will become rows 1 and 2, <i>destinationChild</i> should be 3. In this case, the new index for the source row <tt>i</tt> (which is between <i>sourceFirst</i> and <i>sourceLast</i>) is equal to <tt>(destinationChild-sourceLast-1+i)</tt>.</p>
<p>Note that if <i>sourceParent</i> and <i>destinationParent</i> are the same, you must ensure that the <i>destinationChild</i> is not within the range of <i>sourceFirst</i> and <i>sourceLast</i> + 1. You must also ensure that you do not attempt to move a row to one of its own children or ancestors. This method returns false if either condition is true, in which case you should abort your move operation.</p>
<table class="generic" width="80%">
 <tr valign="top" class="odd"><td ><img src="images/modelview-move-rows-1.png" alt="Moving rows to another parent" /></td><td >Specify the first and last row numbers for the span of rows in the source parent you want to move in the model. Also specify the row in the destination parent to move the span to.<p>For example, as shown in the diagram, we move three rows from row 2 to 4 in the source, so <i>sourceFirst</i> is 2 and <i>sourceLast</i> is 4. We move those items to above row 2 in the destination, so <i>destinationChild</i> is 2.</p>
<pre class="cpp"> beginMoveRows(sourceParent<span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">4</span><span class="operator">,</span> destinationParent<span class="operator">,</span> <span class="number">2</span>);</pre>
<p>This moves the three rows rows 2, 3, and 4 in the source to become 2, 3 and 4 in the destination. Other affected siblings are displaced accordingly.</p>
</td></tr>
<tr valign="top" class="even"><td ><img src="images/modelview-move-rows-2.png" alt="Moving rows to append to another parent" /></td><td >To append rows to another parent, move them to after the last row.<p>For example, as shown in the diagram, we move three rows to a collection of 6 existing rows (ending in row 5), so <i>destinationChild</i> is 6:</p>
<pre class="cpp"> beginMoveRows(sourceParent<span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">4</span><span class="operator">,</span> destinationParent<span class="operator">,</span> <span class="number">6</span>);</pre>
<p>This moves the target rows to the end of the target parent as 6, 7 and 8.</p>
</td></tr>
<tr valign="top" class="odd"><td ><img src="images/modelview-move-rows-3.png" alt="Moving rows in the same parent up" /></td><td >To move rows within the same parent, specify the row to move them to.<p>For example, as shown in the diagram, we move one item from row 2 to row 0, so <i>sourceFirst</i> and <i>sourceLast</i> are 2 and <i>destinationChild</i> is 0.</p>
<pre class="cpp"> beginMoveRows(parent<span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> parent<span class="operator">,</span> <span class="number">0</span>);</pre>
<p>Note that other rows may be displaced accordingly. Note also that when moving items within the same parent you should not attempt invalid or no-op moves. In the above example, item 2 is at row 2 before the move, so it can not be moved to row 2 (where it is already) or row 3 (no-op as row 3 means above row 3, where it is already)</p>
</td></tr>
<tr valign="top" class="even"><td ><img src="images/modelview-move-rows-4.png" alt="Moving rows in the same parent down" /></td><td >To move rows within the same parent, specify the row to move them to.<p>For example, as shown in the diagram, we move one item from row 2 to row 4, so <i>sourceFirst</i> and <i>sourceLast</i> are 2 and <i>destinationChild</i> is 4.</p>
<pre class="cpp"> beginMoveRows(parent<span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> parent<span class="operator">,</span> <span class="number">4</span>);</pre>
<p>Note that other rows may be displaced accordingly.</p>
</td></tr>
</table>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#endMoveRows">endMoveRows</a>().</p>
<!-- @@@beginMoveRows -->
<!-- $$$beginRemoveColumns[overload1]$$$beginRemoveColumnsconstQModelIndex&intint -->
<h3 class="fn"><a name="beginRemoveColumns"></a><span class="type">void</span> QAbstractItemModel::<span class="name">beginRemoveColumns</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i>, <span class="type">int</span> <i>first</i>, <span class="type">int</span> <i>last</i> )<tt> [protected]</tt></h3>
<p>Begins a column removal operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#removeColumns">removeColumns</a>() in a subclass, you must call this function <i>before</i> removing data from the model's underlying data store.</p>
<p>The <i>parent</i> index corresponds to the parent from which the new columns are removed; <i>first</i> and <i>last</i> are the column numbers of the first and last columns to be removed.</p>
<table class="generic" width="80%">
 <tr valign="top" class="odd"><td ><img src="images/modelview-begin-remove-columns.png" alt="Removing columns" /></td><td >Specify the first and last column numbers for the span of columns you want to remove from an item in a model.<p>For example, as shown in the diagram, we remove the three columns from column 4 to column 6, so <i>first</i> is 4 and <i>last</i> is 6:</p>
<pre class="cpp"> beginRemoveColumns(parent<span class="operator">,</span> <span class="number">4</span><span class="operator">,</span> <span class="number">6</span>);</pre>
</td></tr>
</table>
<p><b>Note:</b> This function emits the <a href="qabstractitemmodel.html#columnsAboutToBeRemoved">columnsAboutToBeRemoved</a>() signal which connected views (or proxies) must handle before the data is removed. Otherwise, the views may end up in an invalid state.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#endRemoveColumns">endRemoveColumns</a>().</p>
<!-- @@@beginRemoveColumns -->
<!-- $$$beginRemoveRows[overload1]$$$beginRemoveRowsconstQModelIndex&intint -->
<h3 class="fn"><a name="beginRemoveRows"></a><span class="type">void</span> QAbstractItemModel::<span class="name">beginRemoveRows</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i>, <span class="type">int</span> <i>first</i>, <span class="type">int</span> <i>last</i> )<tt> [protected]</tt></h3>
<p>Begins a row removal operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#removeRows">removeRows</a>() in a subclass, you must call this function <i>before</i> removing data from the model's underlying data store.</p>
<p>The <i>parent</i> index corresponds to the parent from which the new rows are removed; <i>first</i> and <i>last</i> are the row numbers of the rows to be removed.</p>
<table class="generic" width="80%">
 <tr valign="top" class="odd"><td ><img src="images/modelview-begin-remove-rows.png" alt="Removing rows" /></td><td >Specify the first and last row numbers for the span of rows you want to remove from an item in a model.<p>For example, as shown in the diagram, we remove the two rows from row 2 to row 3, so <i>first</i> is 2 and <i>last</i> is 3:</p>
<pre class="cpp"> beginRemoveRows(parent<span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">3</span>);</pre>
</td></tr>
</table>
<p><b>Note:</b> This function emits the <a href="qabstractitemmodel.html#rowsAboutToBeRemoved">rowsAboutToBeRemoved</a>() signal which connected views (or proxies) must handle before the data is removed. Otherwise, the views may end up in an invalid state.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#endRemoveRows">endRemoveRows</a>().</p>
<!-- @@@beginRemoveRows -->
<!-- $$$beginResetModel[overload1]$$$beginResetModel -->
<h3 class="fn"><a name="beginResetModel"></a><span class="type">void</span> QAbstractItemModel::<span class="name">beginResetModel</span> ()<tt> [protected]</tt></h3>
<p>Begins a model reset operation.</p>
<p>A reset operation resets the model to its current state in any attached views.</p>
<p><b>Note:</b> Any views attached to this model will be reset as well.</p>
<p>When a model is reset it means that any previous data reported from the model is now invalid and has to be queried for again. This also means that the current item and any selected items will become invalid.</p>
<p>When a model radically changes its data it can sometimes be easier to just call this function rather than emit <a href="qabstractitemmodel.html#dataChanged">dataChanged</a>() to inform other components when the underlying data source, or its structure, has changed.</p>
<p>You must call this function before resetting any internal data structures in your model or proxy model.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#modelAboutToBeReset">modelAboutToBeReset</a>(), <a href="qabstractitemmodel.html#modelReset">modelReset</a>(), and <a href="qabstractitemmodel.html#endResetModel">endResetModel</a>().</p>
<!-- @@@beginResetModel -->
<!-- $$$buddy[overload1]$$$buddyconstQModelIndex& -->
<h3 class="fn"><a name="buddy"></a><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QAbstractItemModel::<span class="name">buddy</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const<tt> [virtual]</tt></h3>
<p>Returns a model index for the buddy of the item represented by <i>index</i>. When the user wants to edit an item, the view will call this function to check whether another item in the model should be edited instead. Then, the view will construct a delegate using the model index returned by the buddy item.</p>
<p>The default implementation of this function has each item as its own buddy.</p>
<!-- @@@buddy -->
<!-- $$$canFetchMore[overload1]$$$canFetchMoreconstQModelIndex& -->
<h3 class="fn"><a name="canFetchMore"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">canFetchMore</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> ) const<tt> [virtual]</tt></h3>
<p>Returns true if there is more data available for <i>parent</i>; otherwise returns false.</p>
<p>The default implementation always returns false.</p>
<p>If canFetchMore() returns true, <a href="qabstractitemview.html">QAbstractItemView</a> will call <a href="qabstractitemmodel.html#fetchMore">fetchMore</a>(). However, the <a href="qabstractitemmodel.html#fetchMore">fetchMore</a>() function is only called when the model is being populated incrementally.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#fetchMore">fetchMore</a>().</p>
<!-- @@@canFetchMore -->
<!-- $$$changePersistentIndex[overload1]$$$changePersistentIndexconstQModelIndex&constQModelIndex& -->
<h3 class="fn"><a name="changePersistentIndex"></a><span class="type">void</span> QAbstractItemModel::<span class="name">changePersistentIndex</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>from</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>to</i> )<tt> [protected]</tt></h3>
<p>Changes the <a href="qpersistentmodelindex.html">QPersistentModelIndex</a> that is equal to the given <i>from</i> model index to the given <i>to</i> model index.</p>
<p>If no persistent model index equal to the given <i>from</i> model index was found, nothing is changed.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#persistentIndexList">persistentIndexList</a>() and <a href="qabstractitemmodel.html#changePersistentIndexList">changePersistentIndexList</a>().</p>
<!-- @@@changePersistentIndex -->
<!-- $$$changePersistentIndexList[overload1]$$$changePersistentIndexListconstQModelIndexList&constQModelIndexList& -->
<h3 class="fn"><a name="changePersistentIndexList"></a><span class="type">void</span> QAbstractItemModel::<span class="name">changePersistentIndexList</span> ( const <span class="type"><a href="qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a></span> &amp; <i>from</i>, const <span class="type"><a href="qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a></span> &amp; <i>to</i> )<tt> [protected]</tt></h3>
<p>Changes the QPersistentModelIndexes that is equal to the indexes in the given <i>from</i> model index list to the given <i>to</i> model index list.</p>
<p>If no persistent model indexes equal to the indexes in the given <i>from</i> model index list was found, nothing is changed.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#persistentIndexList">persistentIndexList</a>() and <a href="qabstractitemmodel.html#changePersistentIndex">changePersistentIndex</a>().</p>
<!-- @@@changePersistentIndexList -->
<!-- $$$columnCount[overload1]$$$columnCountconstQModelIndex& -->
<h3 class="fn"><a name="columnCount"></a><span class="type">int</span> QAbstractItemModel::<span class="name">columnCount</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() ) const<tt> [pure virtual]</tt></h3>
<p>Returns the number of columns for the children of the given <i>parent</i>.</p>
<p>In most subclasses, the number of columns is independent of the <i>parent</i>.</p>
<p>For example:</p>
<pre class="cpp"> <span class="type">int</span> DomModel<span class="operator">::</span>columnCount(<span class="keyword">const</span> <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> <span class="operator">&amp;</span><span class="comment">/*parent*/</span>) <span class="keyword">const</span>
 {
     <span class="keyword">return</span> <span class="number">3</span>;
 }</pre>
<p><b>Note:</b> When implementing a table based model, columnCount() should return 0 when the parent is valid.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#rowCount">rowCount</a>().</p>
<!-- @@@columnCount -->
<!-- $$$columnsAboutToBeInserted[overload1]$$$columnsAboutToBeInsertedconstQModelIndex&intint -->
<h3 class="fn"><a name="columnsAboutToBeInserted"></a><span class="type">void</span> QAbstractItemModel::<span class="name">columnsAboutToBeInserted</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i>, <span class="type">int</span> <i>start</i>, <span class="type">int</span> <i>end</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted just before columns are inserted into the model. The new items will be positioned between <i>start</i> and <i>end</i> inclusive, under the given <i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the <a href="qabstractitemmodel.html">QAbstractItemModel</a> implementation, and cannot be explicitly emitted in subclass code.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#insertColumns">insertColumns</a>() and <a href="qabstractitemmodel.html#beginInsertColumns">beginInsertColumns</a>().</p>
<!-- @@@columnsAboutToBeInserted -->
<!-- $$$columnsAboutToBeMoved[overload1]$$$columnsAboutToBeMovedconstQModelIndex&intintconstQModelIndex&int -->
<h3 class="fn"><a name="columnsAboutToBeMoved"></a><span class="type">void</span> QAbstractItemModel::<span class="name">columnsAboutToBeMoved</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>sourceParent</i>, <span class="type">int</span> <i>sourceStart</i>, <span class="type">int</span> <i>sourceEnd</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>destinationParent</i>, <span class="type">int</span> <i>destinationColumn</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted just before columns are moved within the model. The items that will be moved are those between <i>sourceStart</i> and <i>sourceEnd</i> inclusive, under the given <i>sourceParent</i> item. They will be moved to <i>destinationParent</i> starting at the column <i>destinationColumn</i>.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the <a href="qabstractitemmodel.html">QAbstractItemModel</a> implementation, and cannot be explicitly emitted in subclass code.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#beginMoveRows">beginMoveRows</a>().</p>
<!-- @@@columnsAboutToBeMoved -->
<!-- $$$columnsAboutToBeRemoved[overload1]$$$columnsAboutToBeRemovedconstQModelIndex&intint -->
<h3 class="fn"><a name="columnsAboutToBeRemoved"></a><span class="type">void</span> QAbstractItemModel::<span class="name">columnsAboutToBeRemoved</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i>, <span class="type">int</span> <i>start</i>, <span class="type">int</span> <i>end</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted just before columns are removed from the model. The items to be removed are those between <i>start</i> and <i>end</i> inclusive, under the given <i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the <a href="qabstractitemmodel.html">QAbstractItemModel</a> implementation, and cannot be explicitly emitted in subclass code.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#removeColumns">removeColumns</a>() and <a href="qabstractitemmodel.html#beginRemoveColumns">beginRemoveColumns</a>().</p>
<!-- @@@columnsAboutToBeRemoved -->
<!-- $$$columnsInserted[overload1]$$$columnsInsertedconstQModelIndex&intint -->
<h3 class="fn"><a name="columnsInserted"></a><span class="type">void</span> QAbstractItemModel::<span class="name">columnsInserted</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i>, <span class="type">int</span> <i>start</i>, <span class="type">int</span> <i>end</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted after columns have been inserted into the model. The new items are those between <i>start</i> and <i>end</i> inclusive, under the given <i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the <a href="qabstractitemmodel.html">QAbstractItemModel</a> implementation, and cannot be explicitly emitted in subclass code.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#insertColumns">insertColumns</a>() and <a href="qabstractitemmodel.html#beginInsertColumns">beginInsertColumns</a>().</p>
<!-- @@@columnsInserted -->
<!-- $$$columnsMoved[overload1]$$$columnsMovedconstQModelIndex&intintconstQModelIndex&int -->
<h3 class="fn"><a name="columnsMoved"></a><span class="type">void</span> QAbstractItemModel::<span class="name">columnsMoved</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>sourceParent</i>, <span class="type">int</span> <i>sourceStart</i>, <span class="type">int</span> <i>sourceEnd</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>destinationParent</i>, <span class="type">int</span> <i>destinationColumn</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted after columns have been moved within the model. The items between <i>sourceStart</i> and <i>sourceEnd</i> inclusive, under the given <i>sourceParent</i> item have been moved to <i>destinationParent</i> starting at the column <i>destinationColumn</i>.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the <a href="qabstractitemmodel.html">QAbstractItemModel</a> implementation, and cannot be explicitly emitted in subclass code.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#beginMoveRows">beginMoveRows</a>().</p>
<!-- @@@columnsMoved -->
<!-- $$$columnsRemoved[overload1]$$$columnsRemovedconstQModelIndex&intint -->
<h3 class="fn"><a name="columnsRemoved"></a><span class="type">void</span> QAbstractItemModel::<span class="name">columnsRemoved</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i>, <span class="type">int</span> <i>start</i>, <span class="type">int</span> <i>end</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted after columns have been removed from the model. The removed items are those between <i>start</i> and <i>end</i> inclusive, under the given <i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the <a href="qabstractitemmodel.html">QAbstractItemModel</a> implementation, and cannot be explicitly emitted in subclass code.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#removeColumns">removeColumns</a>() and <a href="qabstractitemmodel.html#beginRemoveColumns">beginRemoveColumns</a>().</p>
<!-- @@@columnsRemoved -->
<!-- $$$createIndex[overload1]$$$createIndexintintvoid* -->
<h3 class="fn"><a name="createIndex"></a><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QAbstractItemModel::<span class="name">createIndex</span> ( <span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>column</i>, <span class="type">void</span> * <i>ptr</i> = 0 ) const<tt> [protected]</tt></h3>
<p>Creates a model index for the given <i>row</i> and <i>column</i> with the internal pointer <i>ptr</i>.</p>
<p>When using a <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a>, its indexes have their own internal pointer. It is not advisable to access this internal pointer outside of the model. Use the <a href="qabstractitemmodel.html#data">data</a>() function instead.</p>
<p>This function provides a consistent interface that model subclasses must use to create model indexes.</p>
<!-- @@@createIndex -->
<!-- $$$createIndex$$$createIndexintintquint32 -->
<h3 class="fn"><a name="createIndex-3"></a><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QAbstractItemModel::<span class="name">createIndex</span> ( <span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>column</i>, <span class="type"><a href="qtglobal.html#quint32-typedef">quint32</a></span> <i>id</i> ) const<tt> [protected]</tt></h3>
<p>Creates a model index for the given <i>row</i> and <i>column</i> with the internal identifier, <i>id</i>.</p>
<p>This function provides a consistent interface that model subclasses must use to create model indexes.</p>
<p><b>See also </b><a href="qmodelindex.html#internalId">QModelIndex::internalId</a>().</p>
<!-- @@@createIndex -->
<!-- $$$data[overload1]$$$dataconstQModelIndex&int -->
<h3 class="fn"><a name="data"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QAbstractItemModel::<span class="name">data</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i>, <span class="type">int</span> <i>role</i> = Qt::DisplayRole ) const<tt> [pure virtual]</tt></h3>
<p>Returns the data stored under the given <i>role</i> for the item referred to by the <i>index</i>.</p>
<p><b>Note:</b> If you do not have a value to return, return an <b>invalid</b> <a href="qvariant.html">QVariant</a> instead of returning 0.</p>
<p><b>See also </b><a href="qt.html#ItemDataRole-enum">Qt::ItemDataRole</a>, <a href="qabstractitemmodel.html#setData">setData</a>(), and <a href="qabstractitemmodel.html#headerData">headerData</a>().</p>
<!-- @@@data -->
<!-- $$$dataChanged[overload1]$$$dataChangedconstQModelIndex&constQModelIndex& -->
<h3 class="fn"><a name="dataChanged"></a><span class="type">void</span> QAbstractItemModel::<span class="name">dataChanged</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>topLeft</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>bottomRight</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the data in an existing item changes.</p>
<p>If the items are of the same parent, the affected ones are those between <i>topLeft</i> and <i>bottomRight</i> inclusive. If the items do not have the same parent, the behavior is undefined.</p>
<p>When reimplementing the <a href="qabstractitemmodel.html#setData">setData</a>() function, this signal must be emitted explicitly.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#headerDataChanged">headerDataChanged</a>(), <a href="qabstractitemmodel.html#setData">setData</a>(), and <a href="qabstractitemmodel.html#layoutChanged">layoutChanged</a>().</p>
<!-- @@@dataChanged -->
<!-- $$$dropMimeData[overload1]$$$dropMimeDataconstQMimeData*Qt::DropActionintintconstQModelIndex& -->
<h3 class="fn"><a name="dropMimeData"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">dropMimeData</span> ( const <span class="type"><a href="qmimedata.html">QMimeData</a></span> * <i>data</i>, <span class="type"><a href="qt.html#DropAction-enum">Qt::DropAction</a></span> <i>action</i>, <span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>column</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> )<tt> [virtual]</tt></h3>
<p>Handles the <i>data</i> supplied by a drag and drop operation that ended with the given <i>action</i>.</p>
<p>Returns true if the data and action can be handled by the model; otherwise returns false.</p>
<p>The specified <i>row</i>, <i>column</i> and <i>parent</i> indicate the location of an item in the model where the operation ended. It is the responsibility of the model to complete the action at the correct location.</p>
<p>For instance, a drop action on an item in a <a href="qtreeview.html">QTreeView</a> can result in new items either being inserted as children of the item specified by <i>row</i>, <i>column</i>, and <i>parent</i>, or as siblings of the item.</p>
<p>When <i>row</i> and <i>column</i> are -1 it means that the dropped data should be considered as dropped directly on <i>parent</i>. Usually this will mean appending the data as child items of <i>parent</i>. If <i>row</i> and column are greater than or equal zero, it means that the drop occurred just before the specified <i>row</i> and <i>column</i> in the specified <i>parent</i>.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#supportedDropActions">supportedDropActions</a>() and <a href="model-view-programming.html#using-drag-and-drop-with-item-views">Using drag and drop with item views</a>.</p>
<!-- @@@dropMimeData -->
<!-- $$$endInsertColumns[overload1]$$$endInsertColumns -->
<h3 class="fn"><a name="endInsertColumns"></a><span class="type">void</span> QAbstractItemModel::<span class="name">endInsertColumns</span> ()<tt> [protected]</tt></h3>
<p>Ends a column insertion operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>() in a subclass, you must call this function <i>after</i> inserting data into the model's underlying data store.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#beginInsertColumns">beginInsertColumns</a>().</p>
<!-- @@@endInsertColumns -->
<!-- $$$endInsertRows[overload1]$$$endInsertRows -->
<h3 class="fn"><a name="endInsertRows"></a><span class="type">void</span> QAbstractItemModel::<span class="name">endInsertRows</span> ()<tt> [protected]</tt></h3>
<p>Ends a row insertion operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#insertRows">insertRows</a>() in a subclass, you must call this function <i>after</i> inserting data into the model's underlying data store.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows</a>().</p>
<!-- @@@endInsertRows -->
<!-- $$$endMoveColumns[overload1]$$$endMoveColumns -->
<h3 class="fn"><a name="endMoveColumns"></a><span class="type">void</span> QAbstractItemModel::<span class="name">endMoveColumns</span> ()<tt> [protected]</tt></h3>
<p>Ends a column move operation.</p>
<p>When implementing a subclass, you must call this function <i>after</i> moving data within the model's underlying data store.</p>
<p>layoutChanged is emitted by this method for compatibility reasons.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#beginMoveColumns">beginMoveColumns</a>().</p>
<!-- @@@endMoveColumns -->
<!-- $$$endMoveRows[overload1]$$$endMoveRows -->
<h3 class="fn"><a name="endMoveRows"></a><span class="type">void</span> QAbstractItemModel::<span class="name">endMoveRows</span> ()<tt> [protected]</tt></h3>
<p>Ends a row move operation.</p>
<p>When implementing a subclass, you must call this function <i>after</i> moving data within the model's underlying data store.</p>
<p>layoutChanged is emitted by this method for compatibility reasons.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#beginMoveRows">beginMoveRows</a>().</p>
<!-- @@@endMoveRows -->
<!-- $$$endRemoveColumns[overload1]$$$endRemoveColumns -->
<h3 class="fn"><a name="endRemoveColumns"></a><span class="type">void</span> QAbstractItemModel::<span class="name">endRemoveColumns</span> ()<tt> [protected]</tt></h3>
<p>Ends a column removal operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#removeColumns">removeColumns</a>() in a subclass, you must call this function <i>after</i> removing data from the model's underlying data store.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#beginRemoveColumns">beginRemoveColumns</a>().</p>
<!-- @@@endRemoveColumns -->
<!-- $$$endRemoveRows[overload1]$$$endRemoveRows -->
<h3 class="fn"><a name="endRemoveRows"></a><span class="type">void</span> QAbstractItemModel::<span class="name">endRemoveRows</span> ()<tt> [protected]</tt></h3>
<p>Ends a row removal operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#removeRows">removeRows</a>() in a subclass, you must call this function <i>after</i> removing data from the model's underlying data store.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#beginRemoveRows">beginRemoveRows</a>().</p>
<!-- @@@endRemoveRows -->
<!-- $$$endResetModel[overload1]$$$endResetModel -->
<h3 class="fn"><a name="endResetModel"></a><span class="type">void</span> QAbstractItemModel::<span class="name">endResetModel</span> ()<tt> [protected]</tt></h3>
<p>Completes a model reset operation.</p>
<p>You must call this function after resetting any internal data structure in your model or proxy model.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#beginResetModel">beginResetModel</a>().</p>
<!-- @@@endResetModel -->
<!-- $$$fetchMore[overload1]$$$fetchMoreconstQModelIndex& -->
<h3 class="fn"><a name="fetchMore"></a><span class="type">void</span> QAbstractItemModel::<span class="name">fetchMore</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> )<tt> [virtual]</tt></h3>
<p>Fetches any available data for the items with the parent specified by the <i>parent</i> index.</p>
<p>Reimplement this if you are populating your model incrementally.</p>
<p>The default implementation does nothing.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#canFetchMore">canFetchMore</a>().</p>
<!-- @@@fetchMore -->
<!-- $$$flags[overload1]$$$flagsconstQModelIndex& -->
<h3 class="fn"><a name="flags"></a><span class="type"><a href="qt.html#ItemFlag-enum">Qt::ItemFlags</a></span> QAbstractItemModel::<span class="name">flags</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const<tt> [virtual]</tt></h3>
<p>Returns the item flags for the given <i>index</i>.</p>
<p>The base class implementation returns a combination of flags that enables the item (<tt>ItemIsEnabled</tt>) and allows it to be selected (<tt>ItemIsSelectable</tt>).</p>
<p><b>See also </b><a href="qt.html#ItemFlag-enum">Qt::ItemFlags</a>.</p>
<!-- @@@flags -->
<!-- $$$hasChildren[overload1]$$$hasChildrenconstQModelIndex& -->
<h3 class="fn"><a name="hasChildren"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">hasChildren</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() ) const<tt> [virtual]</tt></h3>
<p>Returns true if <i>parent</i> has any children; otherwise returns false.</p>
<p>Use <a href="qabstractitemmodel.html#rowCount">rowCount</a>() on the parent to find out the number of children.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#parent">parent</a>() and <a href="qabstractitemmodel.html#index">index</a>().</p>
<!-- @@@hasChildren -->
<!-- $$$hasIndex[overload1]$$$hasIndexintintconstQModelIndex& -->
<h3 class="fn"><a name="hasIndex"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">hasIndex</span> ( <span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>column</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() ) const</h3>
<p>Returns true if the model returns a valid <a href="qmodelindex.html">QModelIndex</a> for <i>row</i> and <i>column</i> with <i>parent</i>, otherwise returns false.</p>
<!-- @@@hasIndex -->
<!-- $$$headerData[overload1]$$$headerDataintQt::Orientationint -->
<h3 class="fn"><a name="headerData"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QAbstractItemModel::<span class="name">headerData</span> ( <span class="type">int</span> <i>section</i>, <span class="type"><a href="qt.html#Orientation-enum">Qt::Orientation</a></span> <i>orientation</i>, <span class="type">int</span> <i>role</i> = Qt::DisplayRole ) const<tt> [virtual]</tt></h3>
<p>Returns the data for the given <i>role</i> and <i>section</i> in the header with the specified <i>orientation</i>.</p>
<p>For horizontal headers, the section number corresponds to the column number. Similarly, for vertical headers, the section number corresponds to the row number.</p>
<p><b>See also </b><a href="qt.html#ItemDataRole-enum">Qt::ItemDataRole</a>, <a href="qabstractitemmodel.html#setHeaderData">setHeaderData</a>(), and <a href="qheaderview.html">QHeaderView</a>.</p>
<!-- @@@headerData -->
<!-- $$$headerDataChanged[overload1]$$$headerDataChangedQt::Orientationintint -->
<h3 class="fn"><a name="headerDataChanged"></a><span class="type">void</span> QAbstractItemModel::<span class="name">headerDataChanged</span> ( <span class="type"><a href="qt.html#Orientation-enum">Qt::Orientation</a></span> <i>orientation</i>, <span class="type">int</span> <i>first</i>, <span class="type">int</span> <i>last</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted whenever a header is changed. The <i>orientation</i> indicates whether the horizontal or vertical header has changed. The sections in the header from the <i>first</i> to the <i>last</i> need to be updated.</p>
<p>When reimplementing the <a href="qabstractitemmodel.html#setHeaderData">setHeaderData</a>() function, this signal must be emitted explicitly.</p>
<p>If you are changing the number of columns or rows you do not need to emit this signal, but use the begin/end functions (refer to the section on subclassing in the <a href="qabstractitemmodel.html">QAbstractItemModel</a> class description for details).</p>
<p><b>See also </b><a href="qabstractitemmodel.html#headerData">headerData</a>(), <a href="qabstractitemmodel.html#setHeaderData">setHeaderData</a>(), and <a href="qabstractitemmodel.html#dataChanged">dataChanged</a>().</p>
<!-- @@@headerDataChanged -->
<!-- $$$index[overload1]$$$indexintintconstQModelIndex& -->
<h3 class="fn"><a name="index"></a><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QAbstractItemModel::<span class="name">index</span> ( <span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>column</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() ) const<tt> [pure virtual]</tt></h3>
<p>Returns the index of the item in the model specified by the given <i>row</i>, <i>column</i> and <i>parent</i> index.</p>
<p>When reimplementing this function in a subclass, call <a href="qabstractitemmodel.html#createIndex">createIndex</a>() to generate model indexes that other components can use to refer to items in your model.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#createIndex">createIndex</a>().</p>
<!-- @@@index -->
<!-- $$$insertColumn[overload1]$$$insertColumnintconstQModelIndex& -->
<h3 class="fn"><a name="insertColumn"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">insertColumn</span> ( <span class="type">int</span> <i>column</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() )</h3>
<p>Inserts a single column before the given <i>column</i> in the child items of the <i>parent</i> specified.</p>
<p>Returns true if the column is inserted; otherwise returns false.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#insertColumns">insertColumns</a>(), <a href="qabstractitemmodel.html#insertRow">insertRow</a>(), and <a href="qabstractitemmodel.html#removeColumn">removeColumn</a>().</p>
<!-- @@@insertColumn -->
<!-- $$$insertColumns[overload1]$$$insertColumnsintintconstQModelIndex& -->
<h3 class="fn"><a name="insertColumns"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">insertColumns</span> ( <span class="type">int</span> <i>column</i>, <span class="type">int</span> <i>count</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() )<tt> [virtual]</tt></h3>
<p>On models that support this, inserts <i>count</i> new columns into the model before the given <i>column</i>. The items in each new column will be children of the item represented by the <i>parent</i> model index.</p>
<p>If <i>column</i> is 0, the columns are prepended to any existing columns.</p>
<p>If <i>column</i> is <a href="qabstractitemmodel.html#columnCount">columnCount</a>(), the columns are appended to any existing columns.</p>
<p>If <i>parent</i> has no children, a single row with <i>count</i> columns is inserted.</p>
<p>Returns true if the columns were successfully inserted; otherwise returns false.</p>
<p>The base class implementation does nothing and returns false.</p>
<p>If you implement your own model, you can reimplement this function if you want to support insertions. Alternatively, you can provide your own API for altering the data.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#insertRows">insertRows</a>(), <a href="qabstractitemmodel.html#removeColumns">removeColumns</a>(), <a href="qabstractitemmodel.html#beginInsertColumns">beginInsertColumns</a>(), and <a href="qabstractitemmodel.html#endInsertColumns">endInsertColumns</a>().</p>
<!-- @@@insertColumns -->
<!-- $$$insertRow[overload1]$$$insertRowintconstQModelIndex& -->
<h3 class="fn"><a name="insertRow"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">insertRow</span> ( <span class="type">int</span> <i>row</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() )</h3>
<p><b>Note:</b> The base class implementation of this function does nothing and returns false.</p>
<p>Inserts a single row before the given <i>row</i> in the child items of the <i>parent</i> specified.</p>
<p>Returns true if the row is inserted; otherwise returns false.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#insertRows">insertRows</a>(), <a href="qabstractitemmodel.html#insertColumn">insertColumn</a>(), and <a href="qabstractitemmodel.html#removeRow">removeRow</a>().</p>
<!-- @@@insertRow -->
<!-- $$$insertRows[overload1]$$$insertRowsintintconstQModelIndex& -->
<h3 class="fn"><a name="insertRows"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">insertRows</span> ( <span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>count</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() )<tt> [virtual]</tt></h3>
<p><b>Note:</b> The base class implementation of this function does nothing and returns false.</p>
<p>On models that support this, inserts <i>count</i> rows into the model before the given <i>row</i>. Items in the new row will be children of the item represented by the <i>parent</i> model index.</p>
<p>If <i>row</i> is 0, the rows are prepended to any existing rows in the parent.</p>
<p>If <i>row</i> is <a href="qabstractitemmodel.html#rowCount">rowCount</a>(), the rows are appended to any existing rows in the parent.</p>
<p>If <i>parent</i> has no children, a single column with <i>count</i> rows is inserted.</p>
<p>Returns true if the rows were successfully inserted; otherwise returns false.</p>
<p>If you implement your own model, you can reimplement this function if you want to support insertions. Alternatively, you can provide your own API for altering the data. In either case, you will need to call <a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows</a>() and <a href="qabstractitemmodel.html#endInsertRows">endInsertRows</a>() to notify other components that the model has changed.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#insertColumns">insertColumns</a>(), <a href="qabstractitemmodel.html#removeRows">removeRows</a>(), <a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows</a>(), and <a href="qabstractitemmodel.html#endInsertRows">endInsertRows</a>().</p>
<!-- @@@insertRows -->
<!-- $$$itemData[overload1]$$$itemDataconstQModelIndex& -->
<h3 class="fn"><a name="itemData"></a><span class="type"><a href="qmap.html">QMap</a></span>&lt;<span class="type">int</span>, <span class="type"><a href="qvariant.html">QVariant</a></span>&gt; QAbstractItemModel::<span class="name">itemData</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const<tt> [virtual]</tt></h3>
<p>Returns a map with values for all predefined roles in the model for the item at the given <i>index</i>.</p>
<p>Reimplement this function if you want to extend the default behavior of this function to include custom roles in the map.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#setItemData">setItemData</a>(), <a href="qt.html#ItemDataRole-enum">Qt::ItemDataRole</a>, and <a href="qabstractitemmodel.html#data">data</a>().</p>
<!-- @@@itemData -->
<!-- $$$layoutAboutToBeChanged[overload1]$$$layoutAboutToBeChanged -->
<h3 class="fn"><a name="layoutAboutToBeChanged"></a><span class="type">void</span> QAbstractItemModel::<span class="name">layoutAboutToBeChanged</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted just before the layout of a model is changed. Components connected to this signal use it to adapt to changes in the model's layout.</p>
<p>Subclasses should update any persistent model indexes after emitting layoutAboutToBeChanged().</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#layoutChanged">layoutChanged</a>() and <a href="qabstractitemmodel.html#changePersistentIndex">changePersistentIndex</a>().</p>
<!-- @@@layoutAboutToBeChanged -->
<!-- $$$layoutChanged[overload1]$$$layoutChanged -->
<h3 class="fn"><a name="layoutChanged"></a><span class="type">void</span> QAbstractItemModel::<span class="name">layoutChanged</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the layout of items exposed by the model has changed; for example, when the model has been sorted. When this signal is received by a view, it should update the layout of items to reflect this change.</p>
<p>When subclassing <a href="qabstractitemmodel.html">QAbstractItemModel</a> or <a href="qabstractproxymodel.html">QAbstractProxyModel</a>, ensure that you emit <a href="qabstractitemmodel.html#layoutAboutToBeChanged">layoutAboutToBeChanged</a>() before changing the order of items or altering the structure of the data you expose to views, and emit layoutChanged() after changing the layout.</p>
<p>Subclasses should update any persistent model indexes before emitting layoutChanged(). In other words, when the structure changes:</p>
<ul>
<li>emit layoutAboutToBeChanged</li>
<li>Remember the <a href="qmodelindex.html">QModelIndex</a> that will change</li>
<li>Update your internal data</li>
<li>Call <a href="qabstractitemmodel.html#changePersistentIndex">changePersistentIndex</a>()</li>
<li>emit layoutChanged</li>
</ul>
<p><b>See also </b><a href="qabstractitemmodel.html#layoutAboutToBeChanged">layoutAboutToBeChanged</a>(), <a href="qabstractitemmodel.html#dataChanged">dataChanged</a>(), <a href="qabstractitemmodel.html#headerDataChanged">headerDataChanged</a>(), <a href="qabstractitemmodel.html#modelReset">modelReset</a>(), and <a href="qabstractitemmodel.html#changePersistentIndex">changePersistentIndex</a>().</p>
<!-- @@@layoutChanged -->
<!-- $$$match[overload1]$$$matchconstQModelIndex&intconstQVariant&intQt::MatchFlags -->
<h3 class="fn"><a name="match"></a><span class="type"><a href="qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a></span> QAbstractItemModel::<span class="name">match</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>start</i>, <span class="type">int</span> <i>role</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> &amp; <i>value</i>, <span class="type">int</span> <i>hits</i> = 1, <span class="type"><a href="qt.html#MatchFlag-enum">Qt::MatchFlags</a></span> <i>flags</i> = Qt::MatchFlags( Qt::MatchStartsWith | Qt::MatchWrap ) ) const<tt> [virtual]</tt></h3>
<p>Returns a list of indexes for the items in the column of the <i>start</i> index where data stored under the given <i>role</i> matches the specified <i>value</i>. The way the search is performed is defined by the <i>flags</i> given. The list that is returned may be empty.</p>
<p>The search begins from the <i>start</i> index, and continues until the number of matching data items equals <i>hits</i>, the search reaches the last row, or the search reaches <i>start</i> again - depending on whether <tt>MatchWrap</tt> is specified in <i>flags</i>. If you want to search for all matching items, use <i>hits</i> = -1.</p>
<p>By default, this function will perform a wrapping, string-based comparison on all items, searching for items that begin with the search term specified by <i>value</i>.</p>
<p><b>Note:</b> The default implementation of this function only searches columns. Reimplement this function to include a different search behavior.</p>
<!-- @@@match -->
<!-- $$$mimeData[overload1]$$$mimeDataconstQModelIndexList& -->
<h3 class="fn"><a name="mimeData"></a><span class="type"><a href="qmimedata.html">QMimeData</a></span> * QAbstractItemModel::<span class="name">mimeData</span> ( const <span class="type"><a href="qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a></span> &amp; <i>indexes</i> ) const<tt> [virtual]</tt></h3>
<p>Returns an object that contains serialized items of data corresponding to the list of <i>indexes</i> specified. The formats used to describe the encoded data is obtained from the <a href="qabstractitemmodel.html#mimeTypes">mimeTypes</a>() function.</p>
<p>If the list of indexes is empty, or there are no supported MIME types, 0 is returned rather than a serialized empty list.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#mimeTypes">mimeTypes</a>() and <a href="qabstractitemmodel.html#dropMimeData">dropMimeData</a>().</p>
<!-- @@@mimeData -->
<!-- $$$mimeTypes[overload1]$$$mimeTypes -->
<h3 class="fn"><a name="mimeTypes"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> QAbstractItemModel::<span class="name">mimeTypes</span> () const<tt> [virtual]</tt></h3>
<p>Returns a list of MIME types that can be used to describe a list of model indexes.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#mimeData">mimeData</a>().</p>
<!-- @@@mimeTypes -->
<!-- $$$modelAboutToBeReset[overload1]$$$modelAboutToBeReset -->
<h3 class="fn"><a name="modelAboutToBeReset"></a><span class="type">void</span> QAbstractItemModel::<span class="name">modelAboutToBeReset</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted when <a href="qabstractitemmodel.html#reset">reset</a>() is called, before the model's internal state (e.g&#x2e; persistent model indexes) has been invalidated.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#beginResetModel">beginResetModel</a>() and <a href="qabstractitemmodel.html#modelReset">modelReset</a>().</p>
<!-- @@@modelAboutToBeReset -->
<!-- $$$modelReset[overload1]$$$modelReset -->
<h3 class="fn"><a name="modelReset"></a><span class="type">void</span> QAbstractItemModel::<span class="name">modelReset</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted when <a href="qabstractitemmodel.html#reset">reset</a>() is called, after the model's internal state (e.g&#x2e; persistent model indexes) has been invalidated.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#endResetModel">endResetModel</a>() and <a href="qabstractitemmodel.html#modelAboutToBeReset">modelAboutToBeReset</a>().</p>
<!-- @@@modelReset -->
<!-- $$$parent[overload1]$$$parentconstQModelIndex& -->
<h3 class="fn"><a name="parent"></a><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QAbstractItemModel::<span class="name">parent</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const<tt> [pure virtual]</tt></h3>
<p>Returns the parent of the model item with the given <i>index</i>. If the item has no parent, an invalid <a href="qmodelindex.html">QModelIndex</a> is returned.</p>
<p>A common convention used in models that expose tree data structures is that only items in the first column have children. For that case, when reimplementing this function in a subclass the column of the returned <a href="qmodelindex.html">QModelIndex</a> would be 0.</p>
<p>When reimplementing this function in a subclass, be careful to avoid calling <a href="qmodelindex.html">QModelIndex</a> member functions, such as <a href="qmodelindex.html#parent">QModelIndex::parent</a>(), since indexes belonging to your model will simply call your implementation, leading to infinite recursion.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#createIndex">createIndex</a>().</p>
<!-- @@@parent -->
<!-- $$$persistentIndexList[overload1]$$$persistentIndexList -->
<h3 class="fn"><a name="persistentIndexList"></a><span class="type"><a href="qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a></span> QAbstractItemModel::<span class="name">persistentIndexList</span> () const<tt> [protected]</tt></h3>
<p>Returns the list of indexes stored as persistent indexes in the model.</p>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@persistentIndexList -->
<!-- $$$removeColumn[overload1]$$$removeColumnintconstQModelIndex& -->
<h3 class="fn"><a name="removeColumn"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">removeColumn</span> ( <span class="type">int</span> <i>column</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() )</h3>
<p>Removes the given <i>column</i> from the child items of the <i>parent</i> specified.</p>
<p>Returns true if the column is removed; otherwise returns false.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#removeColumns">removeColumns</a>(), <a href="qabstractitemmodel.html#removeRow">removeRow</a>(), and <a href="qabstractitemmodel.html#insertColumn">insertColumn</a>().</p>
<!-- @@@removeColumn -->
<!-- $$$removeColumns[overload1]$$$removeColumnsintintconstQModelIndex& -->
<h3 class="fn"><a name="removeColumns"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">removeColumns</span> ( <span class="type">int</span> <i>column</i>, <span class="type">int</span> <i>count</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() )<tt> [virtual]</tt></h3>
<p>On models that support this, removes <i>count</i> columns starting with the given <i>column</i> under parent <i>parent</i> from the model.</p>
<p>Returns true if the columns were successfully removed; otherwise returns false.</p>
<p>The base class implementation does nothing and returns false.</p>
<p>If you implement your own model, you can reimplement this function if you want to support removing. Alternatively, you can provide your own API for altering the data.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#removeColumn">removeColumn</a>(), <a href="qabstractitemmodel.html#removeRows">removeRows</a>(), <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>(), <a href="qabstractitemmodel.html#beginRemoveColumns">beginRemoveColumns</a>(), and <a href="qabstractitemmodel.html#endRemoveColumns">endRemoveColumns</a>().</p>
<!-- @@@removeColumns -->
<!-- $$$removeRow[overload1]$$$removeRowintconstQModelIndex& -->
<h3 class="fn"><a name="removeRow"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">removeRow</span> ( <span class="type">int</span> <i>row</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() )</h3>
<p>Removes the given <i>row</i> from the child items of the <i>parent</i> specified.</p>
<p>Returns true if the row is removed; otherwise returns false.</p>
<p>This is a convenience function that calls <a href="qabstractitemmodel.html#removeRows">removeRows</a>(). The <a href="qabstractitemmodel.html">QAbstractItemModel</a> implementation of <a href="qabstractitemmodel.html#removeRows">removeRows</a>() does nothing.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#removeRows">removeRows</a>(), <a href="qabstractitemmodel.html#removeColumn">removeColumn</a>(), and <a href="qabstractitemmodel.html#insertRow">insertRow</a>().</p>
<!-- @@@removeRow -->
<!-- $$$removeRows[overload1]$$$removeRowsintintconstQModelIndex& -->
<h3 class="fn"><a name="removeRows"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">removeRows</span> ( <span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>count</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() )<tt> [virtual]</tt></h3>
<p>On models that support this, removes <i>count</i> rows starting with the given <i>row</i> under parent <i>parent</i> from the model.</p>
<p>Returns true if the rows were successfully removed; otherwise returns false.</p>
<p>The base class implementation does nothing and returns false.</p>
<p>If you implement your own model, you can reimplement this function if you want to support removing. Alternatively, you can provide your own API for altering the data.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#removeRow">removeRow</a>(), <a href="qabstractitemmodel.html#removeColumns">removeColumns</a>(), <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>(), <a href="qabstractitemmodel.html#beginRemoveRows">beginRemoveRows</a>(), and <a href="qabstractitemmodel.html#endRemoveRows">endRemoveRows</a>().</p>
<!-- @@@removeRows -->
<!-- $$$reset[overload1]$$$reset -->
<h3 class="fn"><a name="reset"></a><span class="type">void</span> QAbstractItemModel::<span class="name">reset</span> ()<tt> [protected]</tt></h3>
<p>Resets the model to its original state in any attached views.</p>
<p><b>Note:</b> Use <a href="qabstractitemmodel.html#beginResetModel">beginResetModel</a>() and <a href="qabstractitemmodel.html#endResetModel">endResetModel</a>() instead whenever possible. Use this method only if there is no way to call <a href="qabstractitemmodel.html#beginResetModel">beginResetModel</a>() before invalidating the model. Otherwise it could lead to unexpected behaviour, especially when used with proxy models.</p>
<!-- @@@reset -->
<!-- $$$resetInternalData[overload1]$$$resetInternalData -->
<h3 class="fn"><a name="resetInternalData"></a><span class="type">void</span> QAbstractItemModel::<span class="name">resetInternalData</span> ()<tt> [protected slot]</tt></h3>
<p>This slot is called just after the internal data of a model is cleared while it is being reset.</p>
<p>This slot is provided the convenience of subclasses of concrete proxy models, such as subclasses of <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> which maintain extra data.</p>
<pre class="cpp"> <span class="keyword">class</span> CustomDataProxy : <span class="keyword">public</span> <span class="type"><a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a></span>
 {
     Q_OBJECT
 <span class="keyword">public</span>:
     CustomDataProxy(<span class="type"><a href="qobject.html">QObject</a></span> <span class="operator">*</span>parent)
       : <span class="type"><a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a></span>(parent)
     {
     }

     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>

     <span class="type"><a href="qvariant.html">QVariant</a></span> data(<span class="keyword">const</span> <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> <span class="operator">&amp;</span>index<span class="operator">,</span> <span class="type">int</span> role)
     {
         <span class="keyword">if</span> (role <span class="operator">!</span><span class="operator">=</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>BackgroundRole)
             <span class="keyword">return</span> <span class="type"><a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a></span><span class="operator">::</span>data(index<span class="operator">,</span> role);

         <span class="keyword">if</span> (m_customData<span class="operator">.</span>contains(index<span class="operator">.</span>row()))
             <span class="keyword">return</span> m_customData<span class="operator">.</span>value(index<span class="operator">.</span>row());
         <span class="keyword">return</span> <span class="type"><a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a></span><span class="operator">::</span>data(index<span class="operator">,</span> role);
     }

 <span class="keyword">private</span> <span class="keyword">slots</span>:
     <span class="type">void</span> resetInternalData()
     {
         m_customData<span class="operator">.</span>clear();
     }

 <span class="keyword">private</span>:
   <span class="type"><a href="qhash.html">QHash</a></span><span class="operator">&lt;</span><span class="type">int</span><span class="operator">,</span> <span class="type"><a href="qvariant.html">QVariant</a></span><span class="operator">&gt;</span> m_customData;
 };</pre>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#modelAboutToBeReset">modelAboutToBeReset</a>() and <a href="qabstractitemmodel.html#modelReset">modelReset</a>().</p>
<!-- @@@resetInternalData -->
<!-- $$$revert[overload1]$$$revert -->
<h3 class="fn"><a name="revert"></a><span class="type">void</span> QAbstractItemModel::<span class="name">revert</span> ()<tt> [virtual slot]</tt></h3>
<p>Lets the model know that it should discard cached information. This function is typically used for row editing.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#submit">submit</a>().</p>
<!-- @@@revert -->
<!-- $$$roleNames[overload1]$$$roleNames -->
<h3 class="fn"><a name="roleNames"></a>const <span class="type"><a href="qhash.html">QHash</a></span>&lt;<span class="type">int</span>, <span class="type"><a href="qbytearray.html">QByteArray</a></span>&gt; &amp; QAbstractItemModel::<span class="name">roleNames</span> () const</h3>
<p>Returns the model's role names.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#setRoleNames">setRoleNames</a>().</p>
<!-- @@@roleNames -->
<!-- $$$rowCount[overload1]$$$rowCountconstQModelIndex& -->
<h3 class="fn"><a name="rowCount"></a><span class="type">int</span> QAbstractItemModel::<span class="name">rowCount</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() ) const<tt> [pure virtual]</tt></h3>
<p>Returns the number of rows under the given <i>parent</i>. When the parent is valid it means that rowCount is returning the number of children of parent.</p>
<p><b>Note:</b> When implementing a table based model, rowCount() should return 0 when the parent is valid.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#columnCount">columnCount</a>().</p>
<!-- @@@rowCount -->
<!-- $$$rowsAboutToBeInserted[overload1]$$$rowsAboutToBeInsertedconstQModelIndex&intint -->
<h3 class="fn"><a name="rowsAboutToBeInserted"></a><span class="type">void</span> QAbstractItemModel::<span class="name">rowsAboutToBeInserted</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i>, <span class="type">int</span> <i>start</i>, <span class="type">int</span> <i>end</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted just before rows are inserted into the model. The new items will be positioned between <i>start</i> and <i>end</i> inclusive, under the given <i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the <a href="qabstractitemmodel.html">QAbstractItemModel</a> implementation, and cannot be explicitly emitted in subclass code.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#insertRows">insertRows</a>() and <a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows</a>().</p>
<!-- @@@rowsAboutToBeInserted -->
<!-- $$$rowsAboutToBeMoved[overload1]$$$rowsAboutToBeMovedconstQModelIndex&intintconstQModelIndex&int -->
<h3 class="fn"><a name="rowsAboutToBeMoved"></a><span class="type">void</span> QAbstractItemModel::<span class="name">rowsAboutToBeMoved</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>sourceParent</i>, <span class="type">int</span> <i>sourceStart</i>, <span class="type">int</span> <i>sourceEnd</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>destinationParent</i>, <span class="type">int</span> <i>destinationRow</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted just before rows are moved within the model. The items that will be moved are those between <i>sourceStart</i> and <i>sourceEnd</i> inclusive, under the given <i>sourceParent</i> item. They will be moved to <i>destinationParent</i> starting at the row <i>destinationRow</i>.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the <a href="qabstractitemmodel.html">QAbstractItemModel</a> implementation, and cannot be explicitly emitted in subclass code.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#beginMoveRows">beginMoveRows</a>().</p>
<!-- @@@rowsAboutToBeMoved -->
<!-- $$$rowsAboutToBeRemoved[overload1]$$$rowsAboutToBeRemovedconstQModelIndex&intint -->
<h3 class="fn"><a name="rowsAboutToBeRemoved"></a><span class="type">void</span> QAbstractItemModel::<span class="name">rowsAboutToBeRemoved</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i>, <span class="type">int</span> <i>start</i>, <span class="type">int</span> <i>end</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted just before rows are removed from the model. The items that will be removed are those between <i>start</i> and <i>end</i> inclusive, under the given <i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the <a href="qabstractitemmodel.html">QAbstractItemModel</a> implementation, and cannot be explicitly emitted in subclass code.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#removeRows">removeRows</a>() and <a href="qabstractitemmodel.html#beginRemoveRows">beginRemoveRows</a>().</p>
<!-- @@@rowsAboutToBeRemoved -->
<!-- $$$rowsInserted[overload1]$$$rowsInsertedconstQModelIndex&intint -->
<h3 class="fn"><a name="rowsInserted"></a><span class="type">void</span> QAbstractItemModel::<span class="name">rowsInserted</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i>, <span class="type">int</span> <i>start</i>, <span class="type">int</span> <i>end</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted after rows have been inserted into the model. The new items are those between <i>start</i> and <i>end</i> inclusive, under the given <i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the <a href="qabstractitemmodel.html">QAbstractItemModel</a> implementation, and cannot be explicitly emitted in subclass code.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#insertRows">insertRows</a>() and <a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows</a>().</p>
<!-- @@@rowsInserted -->
<!-- $$$rowsMoved[overload1]$$$rowsMovedconstQModelIndex&intintconstQModelIndex&int -->
<h3 class="fn"><a name="rowsMoved"></a><span class="type">void</span> QAbstractItemModel::<span class="name">rowsMoved</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>sourceParent</i>, <span class="type">int</span> <i>sourceStart</i>, <span class="type">int</span> <i>sourceEnd</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>destinationParent</i>, <span class="type">int</span> <i>destinationRow</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted after rows have been moved within the model. The items between <i>sourceStart</i> and <i>sourceEnd</i> inclusive, under the given <i>sourceParent</i> item have been moved to <i>destinationParent</i> starting at the row <i>destinationRow</i>.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the <a href="qabstractitemmodel.html">QAbstractItemModel</a> implementation, and cannot be explicitly emitted in subclass code.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#beginMoveRows">beginMoveRows</a>().</p>
<!-- @@@rowsMoved -->
<!-- $$$rowsRemoved[overload1]$$$rowsRemovedconstQModelIndex&intint -->
<h3 class="fn"><a name="rowsRemoved"></a><span class="type">void</span> QAbstractItemModel::<span class="name">rowsRemoved</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i>, <span class="type">int</span> <i>start</i>, <span class="type">int</span> <i>end</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted after rows have been removed from the model. The removed items are those between <i>start</i> and <i>end</i> inclusive, under the given <i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the <a href="qabstractitemmodel.html">QAbstractItemModel</a> implementation, and cannot be explicitly emitted in subclass code.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#removeRows">removeRows</a>() and <a href="qabstractitemmodel.html#beginRemoveRows">beginRemoveRows</a>().</p>
<!-- @@@rowsRemoved -->
<!-- $$$setData[overload1]$$$setDataconstQModelIndex&constQVariant&int -->
<h3 class="fn"><a name="setData"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">setData</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> &amp; <i>value</i>, <span class="type">int</span> <i>role</i> = Qt::EditRole )<tt> [virtual]</tt></h3>
<p>Sets the <i>role</i> data for the item at <i>index</i> to <i>value</i>.</p>
<p>Returns true if successful; otherwise returns false.</p>
<p>The <a href="qabstractitemmodel.html#dataChanged">dataChanged</a>() signal should be emitted if the data was successfully set.</p>
<p>The base class implementation returns false. This function and <a href="qabstractitemmodel.html#data">data</a>() must be reimplemented for editable models.</p>
<p><b>See also </b><a href="qt.html#ItemDataRole-enum">Qt::ItemDataRole</a>, <a href="qabstractitemmodel.html#data">data</a>(), and <a href="qabstractitemmodel.html#itemData">itemData</a>().</p>
<!-- @@@setData -->
<!-- $$$setHeaderData[overload1]$$$setHeaderDataintQt::OrientationconstQVariant&int -->
<h3 class="fn"><a name="setHeaderData"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">setHeaderData</span> ( <span class="type">int</span> <i>section</i>, <span class="type"><a href="qt.html#Orientation-enum">Qt::Orientation</a></span> <i>orientation</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> &amp; <i>value</i>, <span class="type">int</span> <i>role</i> = Qt::EditRole )<tt> [virtual]</tt></h3>
<p>Sets the data for the given <i>role</i> and <i>section</i> in the header with the specified <i>orientation</i> to the <i>value</i> supplied.</p>
<p>Returns true if the header's data was updated; otherwise returns false.</p>
<p>When reimplementing this function, the <a href="qabstractitemmodel.html#headerDataChanged">headerDataChanged</a>() signal must be emitted explicitly.</p>
<p><b>See also </b><a href="qt.html#ItemDataRole-enum">Qt::ItemDataRole</a> and <a href="qabstractitemmodel.html#headerData">headerData</a>().</p>
<!-- @@@setHeaderData -->
<!-- $$$setItemData[overload1]$$$setItemDataconstQModelIndex&constQMap<int,QVariant>& -->
<h3 class="fn"><a name="setItemData"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">setItemData</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i>, const <span class="type"><a href="qmap.html">QMap</a></span>&lt;<span class="type">int</span>, <span class="type"><a href="qvariant.html">QVariant</a></span>&gt; &amp; <i>roles</i> )<tt> [virtual]</tt></h3>
<p>Sets the role data for the item at <i>index</i> to the associated value in <i>roles</i>, for every <a href="qt.html#ItemDataRole-enum">Qt::ItemDataRole</a>.</p>
<p>Returns true if successful; otherwise returns false.</p>
<p>Roles that are not in <i>roles</i> will not be modified.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#setData">setData</a>(), <a href="qabstractitemmodel.html#data">data</a>(), and <a href="qabstractitemmodel.html#itemData">itemData</a>().</p>
<!-- @@@setItemData -->
<!-- $$$setRoleNames[overload1]$$$setRoleNamesconstQHash<int,QByteArray>& -->
<h3 class="fn"><a name="setRoleNames"></a><span class="type">void</span> QAbstractItemModel::<span class="name">setRoleNames</span> ( const <span class="type"><a href="qhash.html">QHash</a></span>&lt;<span class="type">int</span>, <span class="type"><a href="qbytearray.html">QByteArray</a></span>&gt; &amp; <i>roleNames</i> )<tt> [protected]</tt></h3>
<p>Sets the model's role names to <i>roleNames</i>.</p>
<p>This function allows mapping of role identifiers to role property names in Declarative UI. This function must be called before the model is used. Modifying the role names after the model has been set may result in undefined behaviour.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#roleNames">roleNames</a>().</p>
<!-- @@@setRoleNames -->
<!-- $$$setSupportedDragActions[overload1]$$$setSupportedDragActionsQt::DropActions -->
<h3 class="fn"><a name="setSupportedDragActions"></a><span class="type">void</span> QAbstractItemModel::<span class="name">setSupportedDragActions</span> ( <span class="type"><a href="qt.html#DropAction-enum">Qt::DropActions</a></span> <i>actions</i> )</h3>
<p>Sets the supported drag <i>actions</i> for the items in the model.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#supportedDragActions">supportedDragActions</a>() and <a href="model-view-programming.html#using-drag-and-drop-with-item-views">Using drag and drop with item views</a>.</p>
<!-- @@@setSupportedDragActions -->
<!-- $$$sibling[overload1]$$$siblingintintconstQModelIndex& -->
<h3 class="fn"><a name="sibling"></a><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QAbstractItemModel::<span class="name">sibling</span> ( <span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>column</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const</h3>
<p>Returns the sibling at <i>row</i> and <i>column</i> for the item at <i>index</i>, or an invalid <a href="qmodelindex.html">QModelIndex</a> if there is no sibling at that location.</p>
<p>sibling() is just a convenience function that finds the item's parent, and uses it to retrieve the index of the child item in the specified <i>row</i> and <i>column</i>.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#index">index</a>(), <a href="qmodelindex.html#row">QModelIndex::row</a>(), and <a href="qmodelindex.html#column">QModelIndex::column</a>().</p>
<!-- @@@sibling -->
<!-- $$$sort[overload1]$$$sortintQt::SortOrder -->
<h3 class="fn"><a name="sort"></a><span class="type">void</span> QAbstractItemModel::<span class="name">sort</span> ( <span class="type">int</span> <i>column</i>, <span class="type"><a href="qt.html#SortOrder-enum">Qt::SortOrder</a></span> <i>order</i> = Qt::AscendingOrder )<tt> [virtual]</tt></h3>
<p>Sorts the model by <i>column</i> in the given <i>order</i>.</p>
<p>The base class implementation does nothing.</p>
<!-- @@@sort -->
<!-- $$$span[overload1]$$$spanconstQModelIndex& -->
<h3 class="fn"><a name="span"></a><span class="type"><a href="qsize.html">QSize</a></span> QAbstractItemModel::<span class="name">span</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const<tt> [virtual]</tt></h3>
<p>Returns the row and column span of the item represented by <i>index</i>.</p>
<p><b>Note:</b> Currently, span is not used.</p>
<!-- @@@span -->
<!-- $$$submit[overload1]$$$submit -->
<h3 class="fn"><a name="submit"></a><span class="type">bool</span> QAbstractItemModel::<span class="name">submit</span> ()<tt> [virtual slot]</tt></h3>
<p>Lets the model know that it should submit cached information to permanent storage. This function is typically used for row editing.</p>
<p>Returns true if there is no error; otherwise returns false.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#revert">revert</a>().</p>
<!-- @@@submit -->
<!-- $$$supportedDragActions[overload1]$$$supportedDragActions -->
<h3 class="fn"><a name="supportedDragActions"></a><span class="type"><a href="qt.html#DropAction-enum">Qt::DropActions</a></span> QAbstractItemModel::<span class="name">supportedDragActions</span> () const</h3>
<p>Returns the actions supported by the data in this model.</p>
<p>The default implementation returns <a href="qabstractitemmodel.html#supportedDropActions">supportedDropActions</a>() unless specific values have been set with <a href="qabstractitemmodel.html#setSupportedDragActions">setSupportedDragActions</a>().</p>
<p>supportedDragActions() is used by <a href="qabstractitemview.html#startDrag">QAbstractItemView::startDrag</a>() as the default values when a drag occurs.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#setSupportedDragActions">setSupportedDragActions</a>(), <a href="qt.html#DropAction-enum">Qt::DropActions</a>, and <a href="model-view-programming.html#using-drag-and-drop-with-item-views">Using drag and drop with item views</a>.</p>
<!-- @@@supportedDragActions -->
<!-- $$$supportedDropActions[overload1]$$$supportedDropActions -->
<h3 class="fn"><a name="supportedDropActions"></a><span class="type"><a href="qt.html#DropAction-enum">Qt::DropActions</a></span> QAbstractItemModel::<span class="name">supportedDropActions</span> () const<tt> [virtual]</tt></h3>
<p>Returns the drop actions supported by this model.</p>
<p>The default implementation returns <a href="qt.html#DropAction-enum">Qt::CopyAction</a>. Reimplement this function if you wish to support additional actions. You must also reimplement the <a href="qabstractitemmodel.html#dropMimeData">dropMimeData</a>() function to handle the additional operations.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qabstractitemmodel.html#dropMimeData">dropMimeData</a>(), <a href="qt.html#DropAction-enum">Qt::DropActions</a>, and <a href="model-view-programming.html#using-drag-and-drop-with-item-views">Using drag and drop with item views</a>.</p>
<!-- @@@supportedDropActions -->
</div>
      </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>