Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 659

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qsortfilterproxymodel.cpp -->
  <title>QSortFilterProxyModel Class | Qt Core 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtcore-index.html">Qt Core</a></td><td ><a href="qtcore-module.html">C++ Classes</a></td><td >QSortFilterProxyModel</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#sorting">Sorting</a></li>
<li class="level2"><a href="#filtering">Filtering</a></li>
<li class="level2"><a href="#subclassing">Subclassing</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QSortFilterProxyModel Class</h1>
<!-- $$$QSortFilterProxyModel-brief -->
<p>The <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> class provides support for sorting and filtering data passed between another model and a view. <a href="#details">More...</a></p>
<!-- @@@QSortFilterProxyModel -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QSortFilterProxyModel&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += core</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.1</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qabstractproxymodel.html">QAbstractProxyModel</a></td></tr></table></div><ul>
<li><a href="qsortfilterproxymodel-members.html">List of all members, including inherited members</a></li>
<li><a href="qsortfilterproxymodel-obsolete.html">Obsolete members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<div class="table"><table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qsortfilterproxymodel.html#dynamicSortFilter-prop">dynamicSortFilter</a></b> : bool</li>
<li class="fn"><b><a href="qsortfilterproxymodel.html#filterCaseSensitivity-prop">filterCaseSensitivity</a></b> : Qt::CaseSensitivity</li>
<li class="fn"><b><a href="qsortfilterproxymodel.html#filterKeyColumn-prop">filterKeyColumn</a></b> : int</li>
<li class="fn"><b><a href="qsortfilterproxymodel.html#filterRegExp-prop">filterRegExp</a></b> : QRegExp</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qsortfilterproxymodel.html#filterRole-prop">filterRole</a></b> : int</li>
<li class="fn"><b><a href="qsortfilterproxymodel.html#isSortLocaleAware-prop">isSortLocaleAware</a></b> : bool</li>
<li class="fn"><b><a href="qsortfilterproxymodel.html#sortCaseSensitivity-prop">sortCaseSensitivity</a></b> : Qt::CaseSensitivity</li>
<li class="fn"><b><a href="qsortfilterproxymodel.html#sortRole-prop">sortRole</a></b> : int</li>
</ul>
</td></tr>
</table></div>
<ul>
<li class="fn">1 property inherited from <a href="qabstractproxymodel.html#properties">QAbstractProxyModel</a></li>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#QSortFilterProxyModel">QSortFilterProxyModel</a></b>(QObject *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#dtor.QSortFilterProxyModel">~QSortFilterProxyModel</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#dynamicSortFilter-prop">dynamicSortFilter</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::CaseSensitivity </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#filterCaseSensitivity-prop">filterCaseSensitivity</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#filterKeyColumn-prop">filterKeyColumn</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegExp </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#filterRegExp-prop">filterRegExp</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#filterRole-prop">filterRole</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#isSortLocaleAware-prop">isSortLocaleAware</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#dynamicSortFilter-prop">setDynamicSortFilter</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#filterCaseSensitivity-prop">setFilterCaseSensitivity</a></b>(Qt::CaseSensitivity <i>cs</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#filterKeyColumn-prop">setFilterKeyColumn</a></b>(int <i>column</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#filterRegExp-prop">setFilterRegExp</a></b>(const QRegExp &amp;<i>regExp</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#filterRole-prop">setFilterRole</a></b>(int <i>role</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#sortCaseSensitivity-prop">setSortCaseSensitivity</a></b>(Qt::CaseSensitivity <i>cs</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#isSortLocaleAware-prop">setSortLocaleAware</a></b>(bool <i>on</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#sortRole-prop">setSortRole</a></b>(int <i>role</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::CaseSensitivity </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#sortCaseSensitivity-prop">sortCaseSensitivity</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#sortColumn">sortColumn</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::SortOrder </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#sortOrder">sortOrder</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#sortRole-prop">sortRole</a></b>() const</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.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="qsortfilterproxymodel.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="qsortfilterproxymodel.html#columnCount">columnCount</a></b>(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="qsortfilterproxymodel.html#data">data</a></b>(const QModelIndex &amp;<i>index</i>, int <i>role</i> = Qt::DisplayRole) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.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="qsortfilterproxymodel.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="qsortfilterproxymodel.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="qsortfilterproxymodel.html#hasChildren">hasChildren</a></b>(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="qsortfilterproxymodel.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="qsortfilterproxymodel.html#index">index</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 bool </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.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"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.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 QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#mapFromSource">mapFromSource</a></b>(const QModelIndex &amp;<i>sourceIndex</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QItemSelection </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#mapSelectionFromSource">mapSelectionFromSource</a></b>(const QItemSelection &amp;<i>sourceSelection</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QItemSelection </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#mapSelectionToSource">mapSelectionToSource</a></b>(const QItemSelection &amp;<i>proxySelection</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#mapToSource">mapToSource</a></b>(const QModelIndex &amp;<i>proxyIndex</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QModelIndexList </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.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="qsortfilterproxymodel.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="qsortfilterproxymodel.html#mimeTypes">mimeTypes</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#parent">parent</a></b>(const QModelIndex &amp;<i>child</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.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"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.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"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#rowCount">rowCount</a></b>(const QModelIndex &amp;<i>parent</i> = QModelIndex()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.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="qsortfilterproxymodel.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 void </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#setSourceModel">setSourceModel</a></b>(QAbstractItemModel *<i>sourceModel</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#sibling">sibling</a></b>(int <i>row</i>, int <i>column</i>, const QModelIndex &amp;<i>idx</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.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="qsortfilterproxymodel.html#span">span</a></b>(const QModelIndex &amp;<i>index</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual Qt::DropActions </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#supportedDropActions">supportedDropActions</a></b>() const</td></tr>
</table></div>
<ul>
<li class="fn">28 public functions inherited from <a href="qabstractproxymodel.html#public-functions">QAbstractProxyModel</a></li>
<li class="fn">39 public functions inherited from <a href="qabstractitemmodel.html#public-functions">QAbstractItemModel</a></li>
<li class="fn">32 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#invalidate">invalidate</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#setFilterFixedString">setFilterFixedString</a></b>(const QString &amp;<i>pattern</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#setFilterRegExp-1">setFilterRegExp</a></b>(const QString &amp;<i>pattern</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#setFilterWildcard">setFilterWildcard</a></b>(const QString &amp;<i>pattern</i>)</td></tr>
</table></div>
<ul>
<li class="fn">2 public slots inherited from <a href="qabstractitemmodel.html#public-slots">QAbstractItemModel</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2 id="protected-functions">Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#filterAcceptsColumn">filterAcceptsColumn</a></b>(int <i>source_column</i>, const QModelIndex &amp;<i>source_parent</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#filterAcceptsRow">filterAcceptsRow</a></b>(int <i>source_row</i>, const QModelIndex &amp;<i>source_parent</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#invalidateFilter">invalidateFilter</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsortfilterproxymodel.html#lessThan">lessThan</a></b>(const QModelIndex &amp;<i>source_left</i>, const QModelIndex &amp;<i>source_right</i>) const</td></tr>
</table></div>
<ul>
<li class="fn">19 protected functions inherited from <a href="qabstractitemmodel.html#protected-functions">QAbstractItemModel</a></li>
<li class="fn">9 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 signal inherited from <a href="qabstractproxymodel.html#signals">QAbstractProxyModel</a></li>
<li class="fn">18 signals inherited from <a href="qabstractitemmodel.html#signals">QAbstractItemModel</a></li>
<li class="fn">2 signals inherited from <a href="qobject.html#signals">QObject</a></li>
<li class="fn">11 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li class="fn">1 protected slot inherited from <a href="qabstractproxymodel.html#protected-slots">QAbstractProxyModel</a></li>
<li class="fn">1 protected slot inherited from <a href="qabstractitemmodel.html#protected-slots">QAbstractItemModel</a></li>
</ul>
<a name="details"></a>
<!-- $$$QSortFilterProxyModel-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> class provides support for sorting and filtering data passed between another model and a view.</p>
<p><a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> can be used for sorting items, filtering out items, or both. The model transforms the structure of a source model by mapping the model indexes it supplies to new indexes, corresponding to different locations, for views to use. This approach allows a given source model to be restructured as far as views are concerned without requiring any transformations on the underlying data, and without duplicating the data in memory.</p>
<p>Let's assume that we want to sort and filter the items provided by a custom model. The code to set up the model and the view, <i>without</i> sorting and filtering, would look like this:</p>
<pre class="cpp">

          <span class="type"><a href="../qtwidgets/qtreeview.html">QTreeView</a></span> <span class="operator">*</span>treeView <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="../qtwidgets/qtreeview.html">QTreeView</a></span>;
          MyItemModel <span class="operator">*</span>model <span class="operator">=</span> <span class="keyword">new</span> MyItemModel(<span class="keyword">this</span>);

          treeView<span class="operator">-</span><span class="operator">&gt;</span>setModel(model);

</pre>
<p>To add sorting and filtering support to <code>MyItemModel</code>, we need to create a <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a>, call <a href="qsortfilterproxymodel.html#setSourceModel">setSourceModel</a>() with the <code>MyItemModel</code> as argument, and install the <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> on the view:</p>
<pre class="cpp">

          <span class="type"><a href="../qtwidgets/qtreeview.html">QTreeView</a></span> <span class="operator">*</span>treeView <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="../qtwidgets/qtreeview.html">QTreeView</a></span>;
          MyItemModel <span class="operator">*</span>sourceModel <span class="operator">=</span> <span class="keyword">new</span> MyItemModel(<span class="keyword">this</span>);
          <span class="type"><a href="qsortfilterproxymodel.html#QSortFilterProxyModel">QSortFilterProxyModel</a></span> <span class="operator">*</span>proxyModel <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qsortfilterproxymodel.html#QSortFilterProxyModel">QSortFilterProxyModel</a></span>(<span class="keyword">this</span>);

          proxyModel<span class="operator">-</span><span class="operator">&gt;</span>setSourceModel(sourceModel);
          treeView<span class="operator">-</span><span class="operator">&gt;</span>setModel(proxyModel);

</pre>
<p>At this point, neither sorting nor filtering is enabled; the original data is displayed in the view. Any changes made through the <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> are applied to the original model.</p>
<p>The <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> acts as a wrapper for the original model. If you need to convert source <a href="qmodelindex.html">QModelIndex</a>es to sorted/filtered model indexes or vice versa, use <a href="qsortfilterproxymodel.html#mapToSource">mapToSource</a>(), <a href="qsortfilterproxymodel.html#mapFromSource">mapFromSource</a>(), <a href="qsortfilterproxymodel.html#mapSelectionToSource">mapSelectionToSource</a>(), and <a href="qsortfilterproxymodel.html#mapSelectionFromSource">mapSelectionFromSource</a>().</p>
<p><b>Note: </b>By default, the model dynamically re-sorts and re-filters data whenever the original model changes. This behavior can be changed by setting the <a href="qsortfilterproxymodel.html#dynamicSortFilter-prop">dynamicSortFilter</a> property.</p><p>The <a href="../qtwidgets/qtwidgets-itemviews-basicsortfiltermodel-example.html">Basic Sort/Filter Model</a> and <a href="../qtwidgets/qtwidgets-itemviews-customsortfiltermodel-example.html">Custom Sort/Filter Model</a> examples illustrate how to use <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> to perform basic sorting and filtering and how to subclass it to implement custom behavior.</p>
<a name="sorting"></a>
<h3 >Sorting</h3>
<p><a href="../qtwidgets/qtableview.html">QTableView</a> and <a href="../qtwidgets/qtreeview.html">QTreeView</a> have a <a href="../qtwidgets/qtreeview.html#sortingEnabled-prop">sortingEnabled</a> property that controls whether the user can sort the view by clicking the view's horizontal header. For example:</p>
<pre class="cpp">

          treeView<span class="operator">-</span><span class="operator">&gt;</span>setSortingEnabled(<span class="keyword">true</span>);

</pre>
<p>When this feature is on (the default is off), clicking on a header section sorts the items according to that column. By clicking repeatedly, the user can alternate between ascending and descending order.</p>
<p class="centerAlign"><img src="images/qsortfilterproxymodel-sorting.png" alt="A sorted QTreeView" /></p><p>Behind the scene, the view calls the <a href="qsortfilterproxymodel.html#sort">sort</a>() virtual function on the model to reorder the data in the model. To make your data sortable, you can either implement <a href="qsortfilterproxymodel.html#sort">sort</a>() in your model, or use a <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> to wrap your model -- <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> provides a generic <a href="qsortfilterproxymodel.html#sort">sort</a>() reimplementation that operates on the <a href="qsortfilterproxymodel.html#sortRole-prop">sortRole</a>() (<a href="qt.html#ItemDataRole-enum">Qt::DisplayRole</a> by default) of the items and that understands several data types, including <code>int</code>, <a href="qstring.html">QString</a>, and <a href="qdatetime.html">QDateTime</a>. For hierarchical models, sorting is applied recursively to all child items. String comparisons are case sensitive by default; this can be changed by setting the <a href="qsortfilterproxymodel.html#sortCaseSensitivity-prop">sortCaseSensitivity</a> property.</p>
<p>Custom sorting behavior is achieved by subclassing <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> and reimplementing <a href="qsortfilterproxymodel.html#lessThan">lessThan</a>(), which is used to compare items. For example:</p>
<pre class="cpp">

  bool MySortFilterProxyModel<span class="operator">::</span>lessThan(<span class="keyword">const</span> <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> <span class="operator">&amp;</span>left<span class="operator">,</span>
                                        <span class="keyword">const</span> <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> <span class="operator">&amp;</span>right) <span class="keyword">const</span>
  {
      <span class="type"><a href="qvariant.html">QVariant</a></span> leftData <span class="operator">=</span> sourceModel()<span class="operator">-</span><span class="operator">&gt;</span>data(left);
      <span class="type"><a href="qvariant.html">QVariant</a></span> rightData <span class="operator">=</span> sourceModel()<span class="operator">-</span><span class="operator">&gt;</span>data(right);

      <span class="keyword">if</span> (leftData<span class="operator">.</span>type() <span class="operator">=</span><span class="operator">=</span> <span class="type"><a href="qvariant.html">QVariant</a></span><span class="operator">::</span>DateTime) {
          <span class="keyword">return</span> leftData<span class="operator">.</span>toDateTime() <span class="operator">&lt;</span> rightData<span class="operator">.</span>toDateTime();
      } <span class="keyword">else</span> {
          <span class="keyword">static</span> <span class="type"><a href="qregexp.html">QRegExp</a></span> emailPattern(<span class="string">&quot;[\\w\\.]*@[\\w\\.]*)&quot;</span>);

          <span class="type"><a href="qstring.html">QString</a></span> leftString <span class="operator">=</span> leftData<span class="operator">.</span>toString();
          <span class="keyword">if</span>(left<span class="operator">.</span>column() <span class="operator">=</span><span class="operator">=</span> <span class="number">1</span> <span class="operator">&amp;</span><span class="operator">&amp;</span> emailPattern<span class="operator">.</span>indexIn(leftString) <span class="operator">!</span><span class="operator">=</span> <span class="operator">-</span><span class="number">1</span>)
              leftString <span class="operator">=</span> emailPattern<span class="operator">.</span>cap(<span class="number">1</span>);

          <span class="type"><a href="qstring.html">QString</a></span> rightString <span class="operator">=</span> rightData<span class="operator">.</span>toString();
          <span class="keyword">if</span>(right<span class="operator">.</span>column() <span class="operator">=</span><span class="operator">=</span> <span class="number">1</span> <span class="operator">&amp;</span><span class="operator">&amp;</span> emailPattern<span class="operator">.</span>indexIn(rightString) <span class="operator">!</span><span class="operator">=</span> <span class="operator">-</span><span class="number">1</span>)
              rightString <span class="operator">=</span> emailPattern<span class="operator">.</span>cap(<span class="number">1</span>);

          <span class="keyword">return</span> <span class="type"><a href="qstring.html">QString</a></span><span class="operator">::</span>localeAwareCompare(leftString<span class="operator">,</span> rightString) <span class="operator">&lt;</span> <span class="number">0</span>;
      }
  }

</pre>
<p>(This code snippet comes from the <a href="../qtwidgets/qtwidgets-itemviews-customsortfiltermodel-example.html">Custom Sort/Filter Model</a> example.)</p>
<p>An alternative approach to sorting is to disable sorting on the view and to impose a certain order to the user. This is done by explicitly calling <a href="qsortfilterproxymodel.html#sort">sort</a>() with the desired column and order as arguments on the <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> (or on the original model if it implements <a href="qsortfilterproxymodel.html#sort">sort</a>()). For example:</p>
<pre class="cpp">

          proxyModel<span class="operator">-</span><span class="operator">&gt;</span>sort(<span class="number">2</span><span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>AscendingOrder);

</pre>
<p><a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> can be sorted by column -1, in which case it returns to the sort order of the underlying source model.</p>
<a name="filtering"></a>
<h3 >Filtering</h3>
<p>In addition to sorting, <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> can be used to hide items that do not match a certain filter. The filter is specified using a <a href="qregexp.html">QRegExp</a> object and is applied to the <a href="qsortfilterproxymodel.html#filterRole-prop">filterRole</a>() (<a href="qt.html#ItemDataRole-enum">Qt::DisplayRole</a> by default) of each item, for a given column. The <a href="qregexp.html">QRegExp</a> object can be used to match a regular expression, a wildcard pattern, or a fixed string. For example:</p>
<pre class="cpp">

          proxyModel<span class="operator">-</span><span class="operator">&gt;</span>setFilterRegExp(<span class="type"><a href="qregexp.html">QRegExp</a></span>(<span class="string">&quot;.png&quot;</span><span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>CaseInsensitive<span class="operator">,</span>
                                              <span class="type"><a href="qregexp.html">QRegExp</a></span><span class="operator">::</span>FixedString));
          proxyModel<span class="operator">-</span><span class="operator">&gt;</span>setFilterKeyColumn(<span class="number">1</span>);

</pre>
<p>For hierarchical models, the filter is applied recursively to all children. If a parent item doesn't match the filter, none of its children will be shown.</p>
<p>A common use case is to let the user specify the filter regexp, wildcard pattern, or fixed string in a <a href="../qtwidgets/qlineedit.html">QLineEdit</a> and to connect the <a href="../qtwidgets/qlineedit.html#textChanged">textChanged()</a> signal to <a href="qsortfilterproxymodel.html#filterRegExp-prop">setFilterRegExp</a>(), <a href="qsortfilterproxymodel.html#setFilterWildcard">setFilterWildcard</a>(), or <a href="qsortfilterproxymodel.html#setFilterFixedString">setFilterFixedString</a>() to reapply the filter.</p>
<p>Custom filtering behavior can be achieved by reimplementing the <a href="qsortfilterproxymodel.html#filterAcceptsRow">filterAcceptsRow</a>() and <a href="qsortfilterproxymodel.html#filterAcceptsColumn">filterAcceptsColumn</a>() functions. For example (from the <a href="../qtwidgets/qtwidgets-itemviews-customsortfiltermodel-example.html">Custom Sort/Filter Model</a> example), the following implementation ignores the <a href="qsortfilterproxymodel.html#filterKeyColumn-prop">filterKeyColumn</a> property and performs filtering on columns 0, 1, and 2:</p>
<pre class="cpp">

  bool MySortFilterProxyModel<span class="operator">::</span>filterAcceptsRow(<span class="type">int</span> sourceRow<span class="operator">,</span>
          <span class="keyword">const</span> <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> <span class="operator">&amp;</span>sourceParent) <span class="keyword">const</span>
  {
      <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> index0 <span class="operator">=</span> sourceModel()<span class="operator">-</span><span class="operator">&gt;</span>index(sourceRow<span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> sourceParent);
      <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> index1 <span class="operator">=</span> sourceModel()<span class="operator">-</span><span class="operator">&gt;</span>index(sourceRow<span class="operator">,</span> <span class="number">1</span><span class="operator">,</span> sourceParent);
      <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> index2 <span class="operator">=</span> sourceModel()<span class="operator">-</span><span class="operator">&gt;</span>index(sourceRow<span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> sourceParent);

      <span class="keyword">return</span> (sourceModel()<span class="operator">-</span><span class="operator">&gt;</span>data(index0)<span class="operator">.</span>toString()<span class="operator">.</span>contains(filterRegExp())
              <span class="operator">|</span><span class="operator">|</span> sourceModel()<span class="operator">-</span><span class="operator">&gt;</span>data(index1)<span class="operator">.</span>toString()<span class="operator">.</span>contains(filterRegExp()))
              <span class="operator">&amp;</span><span class="operator">&amp;</span> dateInRange(sourceModel()<span class="operator">-</span><span class="operator">&gt;</span>data(index2)<span class="operator">.</span>toDate());
  }

</pre>
<p>(This code snippet comes from the <a href="../qtwidgets/qtwidgets-itemviews-customsortfiltermodel-example.html">Custom Sort/Filter Model</a> example.)</p>
<p>If you are working with large amounts of filtering and have to invoke <a href="qsortfilterproxymodel.html#invalidateFilter">invalidateFilter</a>() repeatedly, using reset() may be more efficient, depending on the implementation of your model. However, reset() returns the proxy model to its original state, losing selection information, and will cause the proxy model to be repopulated.</p>
<a name="subclassing"></a>
<h3 >Subclassing</h3>
<p>Since <a href="qabstractproxymodel.html">QAbstractProxyModel</a> and its subclasses are derived from <a href="qabstractitemmodel.html">QAbstractItemModel</a>, much of the same advice about subclassing normal models also applies to proxy models. In addition, it is worth noting that many of the default implementations of functions in this class are written so that they call the equivalent functions in the relevant source model. This simple proxying mechanism may need to be overridden for source models with more complex behavior; for example, if the source model provides a custom <a href="qsortfilterproxymodel.html#hasChildren">hasChildren</a>() implementation, you should also provide one in the proxy model.</p>
<p><b>Note: </b>Some general guidelines for subclassing models are available in the <a href="../qtwidgets/model-view-programming.html#model-subclassing-reference">Model Subclassing Reference</a>.</p></div>
<p><b>See also </b><a href="qabstractproxymodel.html">QAbstractProxyModel</a>, <a href="qabstractitemmodel.html">QAbstractItemModel</a>, <a href="../qtwidgets/model-view-programming.html">Model/View Programming</a>, <a href="../qtwidgets/qtwidgets-itemviews-basicsortfiltermodel-example.html">Basic Sort/Filter Model Example</a>, <a href="../qtwidgets/qtwidgets-itemviews-customsortfiltermodel-example.html">Custom Sort/Filter Model Example</a>, and <a href="qidentityproxymodel.html">QIdentityProxyModel</a>.</p>
<!-- @@@QSortFilterProxyModel -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$dynamicSortFilter-prop$$$dynamicSortFilter$$$setDynamicSortFilterbool -->
<h3 class="fn" id="dynamicSortFilter-prop"><a name="dynamicSortFilter-prop"></a><span class="name">dynamicSortFilter</span> : <span class="type">bool</span></h3>
<p>This property holds whether the proxy model is dynamically sorted and filtered whenever the contents of the source model change</p>
<p>Note that you should not update the source model through the proxy model when dynamicSortFilter is true. For instance, if you set the proxy model on a <a href="../qtwidgets/qcombobox.html">QComboBox</a>, then using functions that update the model, e.g&#x2e;, <a href="../qtwidgets/qcombobox.html#addItem-1">addItem()</a>, will not work as expected. An alternative is to set dynamicSortFilter to false and call <a href="qsortfilterproxymodel.html#sort">sort()</a> after adding items to the <a href="../qtwidgets/qcombobox.html">QComboBox</a>.</p>
<p>The default value is true.</p>
<p>This property was introduced in  Qt 4.2.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>dynamicSortFilter</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDynamicSortFilter</b></span>(bool <i>enable</i>)</td></tr>
</table></div>
<!-- @@@dynamicSortFilter -->
<!-- $$$filterCaseSensitivity-prop$$$filterCaseSensitivity$$$setFilterCaseSensitivityQt::CaseSensitivity -->
<h3 class="fn" id="filterCaseSensitivity-prop"><a name="filterCaseSensitivity-prop"></a><span class="name">filterCaseSensitivity</span> : <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span></h3>
<p>This property holds the case sensitivity of the <a href="qregexp.html">QRegExp</a> pattern used to filter the contents of the source model</p>
<p>By default, the filter is case sensitive.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::CaseSensitivity </td><td class="memItemRight bottomAlign"><span class="name"><b>filterCaseSensitivity</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFilterCaseSensitivity</b></span>(Qt::CaseSensitivity <i>cs</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qsortfilterproxymodel.html#filterRegExp-prop">filterRegExp</a> and <a href="qsortfilterproxymodel.html#sortCaseSensitivity-prop">sortCaseSensitivity</a>.</p>
<!-- @@@filterCaseSensitivity -->
<!-- $$$filterKeyColumn-prop$$$filterKeyColumn$$$setFilterKeyColumnint -->
<h3 class="fn" id="filterKeyColumn-prop"><a name="filterKeyColumn-prop"></a><span class="name">filterKeyColumn</span> : <span class="type">int</span></h3>
<p>This property holds the column where the key used to filter the contents of the source model is read from.</p>
<p>The default value is 0. If the value is -1, the keys will be read from all columns.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>filterKeyColumn</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFilterKeyColumn</b></span>(int <i>column</i>)</td></tr>
</table></div>
<!-- @@@filterKeyColumn -->
<!-- $$$filterRegExp-prop$$$filterRegExp$$$setFilterRegExpconstQRegExp&$$$setFilterRegExpconstQString& -->
<h3 class="fn" id="filterRegExp-prop"><a name="filterRegExp-prop"></a><span class="name">filterRegExp</span> : <span class="type"><a href="qregexp.html">QRegExp</a></span></h3>
<p>This property holds the <a href="qregexp.html">QRegExp</a> used to filter the contents of the source model</p>
<p>Setting this property overwrites the current <a href="qsortfilterproxymodel.html#filterCaseSensitivity-prop">filterCaseSensitivity</a>. By default, the <a href="qregexp.html">QRegExp</a> is an empty string matching all contents.</p>
<p>If no <a href="qregexp.html">QRegExp</a> or an empty string is set, everything in the source model will be accepted.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QRegExp </td><td class="memItemRight bottomAlign"><span class="name"><b>filterRegExp</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFilterRegExp</b></span>(const QRegExp &amp;<i>regExp</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsortfilterproxymodel.html#setFilterRegExp-1">setFilterRegExp</a></b></span>(const QString &amp;<i>pattern</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qsortfilterproxymodel.html#filterCaseSensitivity-prop">filterCaseSensitivity</a>, <a href="qsortfilterproxymodel.html#setFilterWildcard">setFilterWildcard</a>(), and <a href="qsortfilterproxymodel.html#setFilterFixedString">setFilterFixedString</a>().</p>
<!-- @@@filterRegExp -->
<!-- $$$filterRole-prop$$$filterRole$$$setFilterRoleint -->
<h3 class="fn" id="filterRole-prop"><a name="filterRole-prop"></a><span class="name">filterRole</span> : <span class="type">int</span></h3>
<p>This property holds the item role that is used to query the source model's data when filtering items</p>
<p>The default value is <a href="qt.html#ItemDataRole-enum">Qt::DisplayRole</a>.</p>
<p>This property was introduced in  Qt 4.2.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>filterRole</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFilterRole</b></span>(int <i>role</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qsortfilterproxymodel.html#filterAcceptsRow">filterAcceptsRow</a>().</p>
<!-- @@@filterRole -->
<!-- $$$isSortLocaleAware-prop$$$isSortLocaleAware$$$setSortLocaleAwarebool -->
<h3 class="fn" id="isSortLocaleAware-prop"><a name="isSortLocaleAware-prop"></a><span class="name">isSortLocaleAware</span> : <span class="type">bool</span></h3>
<p>This property holds the local aware setting used for comparing strings when sorting</p>
<p>By default, sorting is not local aware.</p>
<p>This property was introduced in  Qt 4.3.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isSortLocaleAware</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSortLocaleAware</b></span>(bool <i>on</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qsortfilterproxymodel.html#sortCaseSensitivity-prop">sortCaseSensitivity</a> and <a href="qsortfilterproxymodel.html#lessThan">lessThan</a>().</p>
<!-- @@@isSortLocaleAware -->
<!-- $$$sortCaseSensitivity-prop$$$sortCaseSensitivity$$$setSortCaseSensitivityQt::CaseSensitivity -->
<h3 class="fn" id="sortCaseSensitivity-prop"><a name="sortCaseSensitivity-prop"></a><span class="name">sortCaseSensitivity</span> : <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span></h3>
<p>This property holds the case sensitivity setting used for comparing strings when sorting</p>
<p>By default, sorting is case sensitive.</p>
<p>This property was introduced in  Qt 4.2.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::CaseSensitivity </td><td class="memItemRight bottomAlign"><span class="name"><b>sortCaseSensitivity</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSortCaseSensitivity</b></span>(Qt::CaseSensitivity <i>cs</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qsortfilterproxymodel.html#filterCaseSensitivity-prop">filterCaseSensitivity</a> and <a href="qsortfilterproxymodel.html#lessThan">lessThan</a>().</p>
<!-- @@@sortCaseSensitivity -->
<!-- $$$sortRole-prop$$$sortRole$$$setSortRoleint -->
<h3 class="fn" id="sortRole-prop"><a name="sortRole-prop"></a><span class="name">sortRole</span> : <span class="type">int</span></h3>
<p>This property holds the item role that is used to query the source model's data when sorting items</p>
<p>The default value is <a href="qt.html#ItemDataRole-enum">Qt::DisplayRole</a>.</p>
<p>This property was introduced in  Qt 4.2.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>sortRole</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSortRole</b></span>(int <i>role</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qsortfilterproxymodel.html#lessThan">lessThan</a>().</p>
<!-- @@@sortRole -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QSortFilterProxyModel[overload1]$$$QSortFilterProxyModelQObject* -->
<h3 class="fn" id="QSortFilterProxyModel"><a name="QSortFilterProxyModel"></a>QSortFilterProxyModel::<span class="name">QSortFilterProxyModel</span>(<span class="type"><a href="qobject.html#QObject">QObject</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs a sorting filter model with the given <i>parent</i>.</p>
<!-- @@@QSortFilterProxyModel -->
<!-- $$$~QSortFilterProxyModel[overload1]$$$~QSortFilterProxyModel -->
<h3 class="fn" id="dtor.QSortFilterProxyModel"><a name="dtor.QSortFilterProxyModel"></a>QSortFilterProxyModel::<span class="name">~QSortFilterProxyModel</span>()</h3>
<p>Destroys this sorting filter model.</p>
<!-- @@@~QSortFilterProxyModel -->
<!-- $$$buddy[overload1]$$$buddyconstQModelIndex& -->
<h3 class="fn" id="buddy"><a name="buddy"></a><code>[virtual] </code><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QSortFilterProxyModel::<span class="name">buddy</span>(const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp;<i>index</i>) const</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#buddy">QAbstractItemModel::buddy</a>().</p>
<!-- @@@buddy -->
<!-- $$$canFetchMore[overload1]$$$canFetchMoreconstQModelIndex& -->
<h3 class="fn" id="canFetchMore"><a name="canFetchMore"></a><code>[virtual] </code><span class="type">bool</span> QSortFilterProxyModel::<span class="name">canFetchMore</span>(const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp;<i>parent</i>) const</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#canFetchMore">QAbstractItemModel::canFetchMore</a>().</p>
<!-- @@@canFetchMore -->
<!-- $$$columnCount[overload1]$$$columnCountconstQModelIndex& -->
<h3 class="fn" id="columnCount"><a name="columnCount"></a><code>[virtual] </code><span class="type">int</span> QSortFilterProxyModel::<span class="name">columnCount</span>(const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp;<i>parent</i> = QModelIndex()) const</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#columnCount">QAbstractItemModel::columnCount</a>().</p>
<!-- @@@columnCount -->
<!-- $$$data[overload1]$$$dataconstQModelIndex&int -->
<h3 class="fn" id="data"><a name="data"></a><code>[virtual] </code><span class="type"><a href="qvariant.html">QVariant</a></span> QSortFilterProxyModel::<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</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#data">QAbstractItemModel::data</a>().</p>
<p><b>See also </b><a href="qsortfilterproxymodel.html#setData">setData</a>().</p>
<!-- @@@data -->
<!-- $$$dropMimeData[overload1]$$$dropMimeDataconstQMimeData*Qt::DropActionintintconstQModelIndex& -->
<h3 class="fn" id="dropMimeData"><a name="dropMimeData"></a><code>[virtual] </code><span class="type">bool</span> QSortFilterProxyModel::<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>)</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#dropMimeData">QAbstractItemModel::dropMimeData</a>().</p>
<!-- @@@dropMimeData -->
<!-- $$$fetchMore[overload1]$$$fetchMoreconstQModelIndex& -->
<h3 class="fn" id="fetchMore"><a name="fetchMore"></a><code>[virtual] </code><span class="type">void</span> QSortFilterProxyModel::<span class="name">fetchMore</span>(const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp;<i>parent</i>)</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#fetchMore">QAbstractItemModel::fetchMore</a>().</p>
<!-- @@@fetchMore -->
<!-- $$$filterAcceptsColumn[overload1]$$$filterAcceptsColumnintconstQModelIndex& -->
<h3 class="fn" id="filterAcceptsColumn"><a name="filterAcceptsColumn"></a><code>[virtual protected] </code><span class="type">bool</span> QSortFilterProxyModel::<span class="name">filterAcceptsColumn</span>(<span class="type">int</span> <i>source_column</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp;<i>source_parent</i>) const</h3>
<p>Returns <code>true</code> if the item in the column indicated by the given <i>source_column</i> and <i>source_parent</i> should be included in the model; otherwise returns <code>false</code>.</p>
<p>The default implementation returns <code>true</code> if the value held by the relevant item matches the filter string, wildcard string or regular expression.</p>
<p><b>Note: </b>By default, the <a href="qt.html#ItemDataRole-enum">Qt::DisplayRole</a> is used to determine if the column should be accepted or not. This can be changed by setting the <a href="qsortfilterproxymodel.html#filterRole-prop">filterRole</a> property.</p><p><b>See also </b><a href="qsortfilterproxymodel.html#filterAcceptsRow">filterAcceptsRow</a>(), <a href="qsortfilterproxymodel.html#setFilterFixedString">setFilterFixedString</a>(), <a href="qsortfilterproxymodel.html#filterRegExp-prop">setFilterRegExp</a>(), and <a href="qsortfilterproxymodel.html#setFilterWildcard">setFilterWildcard</a>().</p>
<!-- @@@filterAcceptsColumn -->
<!-- $$$filterAcceptsRow[overload1]$$$filterAcceptsRowintconstQModelIndex& -->
<h3 class="fn" id="filterAcceptsRow"><a name="filterAcceptsRow"></a><code>[virtual protected] </code><span class="type">bool</span> QSortFilterProxyModel::<span class="name">filterAcceptsRow</span>(<span class="type">int</span> <i>source_row</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp;<i>source_parent</i>) const</h3>
<p>Returns <code>true</code> if the item in the row indicated by the given <i>source_row</i> and <i>source_parent</i> should be included in the model; otherwise returns false.</p>
<p>The default implementation returns <code>true</code> if the value held by the relevant item matches the filter string, wildcard string or regular expression.</p>
<p><b>Note: </b>By default, the <a href="qt.html#ItemDataRole-enum">Qt::DisplayRole</a> is used to determine if the row should be accepted or not. This can be changed by setting the <a href="qsortfilterproxymodel.html#filterRole-prop">filterRole</a> property.</p><p><b>See also </b><a href="qsortfilterproxymodel.html#filterAcceptsColumn">filterAcceptsColumn</a>(), <a href="qsortfilterproxymodel.html#setFilterFixedString">setFilterFixedString</a>(), <a href="qsortfilterproxymodel.html#filterRegExp-prop">setFilterRegExp</a>(), and <a href="qsortfilterproxymodel.html#setFilterWildcard">setFilterWildcard</a>().</p>
<!-- @@@filterAcceptsRow -->
<!-- $$$flags[overload1]$$$flagsconstQModelIndex& -->
<h3 class="fn" id="flags"><a name="flags"></a><code>[virtual] </code><span class="type"><a href="qt.html#ItemFlag-enum">Qt::ItemFlags</a></span> QSortFilterProxyModel::<span class="name">flags</span>(const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp;<i>index</i>) const</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#flags">QAbstractItemModel::flags</a>().</p>
<!-- @@@flags -->
<!-- $$$hasChildren[overload1]$$$hasChildrenconstQModelIndex& -->
<h3 class="fn" id="hasChildren"><a name="hasChildren"></a><code>[virtual] </code><span class="type">bool</span> QSortFilterProxyModel::<span class="name">hasChildren</span>(const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp;<i>parent</i> = QModelIndex()) const</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#hasChildren">QAbstractItemModel::hasChildren</a>().</p>
<!-- @@@hasChildren -->
<!-- $$$headerData[overload1]$$$headerDataintQt::Orientationint -->
<h3 class="fn" id="headerData"><a name="headerData"></a><code>[virtual] </code><span class="type"><a href="qvariant.html">QVariant</a></span> QSortFilterProxyModel::<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</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#headerData">QAbstractItemModel::headerData</a>().</p>
<p><b>See also </b><a href="qsortfilterproxymodel.html#setHeaderData">setHeaderData</a>().</p>
<!-- @@@headerData -->
<!-- $$$index[overload1]$$$indexintintconstQModelIndex& -->
<h3 class="fn" id="index"><a name="index"></a><code>[virtual] </code><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QSortFilterProxyModel::<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</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#index">QAbstractItemModel::index</a>().</p>
<!-- @@@index -->
<!-- $$$insertColumns[overload1]$$$insertColumnsintintconstQModelIndex& -->
<h3 class="fn" id="insertColumns"><a name="insertColumns"></a><code>[virtual] </code><span class="type">bool</span> QSortFilterProxyModel::<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())</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#insertColumns">QAbstractItemModel::insertColumns</a>().</p>
<!-- @@@insertColumns -->
<!-- $$$insertRows[overload1]$$$insertRowsintintconstQModelIndex& -->
<h3 class="fn" id="insertRows"><a name="insertRows"></a><code>[virtual] </code><span class="type">bool</span> QSortFilterProxyModel::<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())</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#insertRows">QAbstractItemModel::insertRows</a>().</p>
<!-- @@@insertRows -->
<!-- $$$invalidate[overload1]$$$invalidate -->
<h3 class="fn" id="invalidate"><a name="invalidate"></a><code>[slot] </code><span class="type">void</span> QSortFilterProxyModel::<span class="name">invalidate</span>()</h3>
<p>Invalidates the current sorting and filtering.</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qsortfilterproxymodel.html#invalidateFilter">invalidateFilter</a>().</p>
<!-- @@@invalidate -->
<!-- $$$invalidateFilter[overload1]$$$invalidateFilter -->
<h3 class="fn" id="invalidateFilter"><a name="invalidateFilter"></a><code>[protected] </code><span class="type">void</span> QSortFilterProxyModel::<span class="name">invalidateFilter</span>()</h3>
<p>Invalidates the current filtering.</p>
<p>This function should be called if you are implementing custom filtering (e.g&#x2e; <a href="qsortfilterproxymodel.html#filterAcceptsRow">filterAcceptsRow</a>()), and your filter parameters have changed.</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qsortfilterproxymodel.html#invalidate">invalidate</a>().</p>
<!-- @@@invalidateFilter -->
<!-- $$$lessThan[overload1]$$$lessThanconstQModelIndex&constQModelIndex& -->
<h3 class="fn" id="lessThan"><a name="lessThan"></a><code>[virtual protected] </code><span class="type">bool</span> QSortFilterProxyModel::<span class="name">lessThan</span>(const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp;<i>source_left</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp;<i>source_right</i>) const</h3>
<p>Returns <code>true</code> if the value of the item referred to by the given index <i>source_left</i> is less than the value of the item referred to by the given index <i>source_right</i>, otherwise returns <code>false</code>.</p>
<p>This function is used as the &lt; operator when sorting, and handles the following <a href="qvariant.html">QVariant</a> types:</p>
<ul>
<li><a href="qmetatype.html#Type-enum">QMetaType::Int</a></li>
<li><a href="qmetatype.html#Type-enum">QMetaType::UInt</a></li>
<li><a href="qmetatype.html#Type-enum">QMetaType::LongLong</a></li>
<li><a href="qmetatype.html#Type-enum">QMetaType::ULongLong</a></li>
<li><a href="qmetatype.html#Type-enum">QMetaType::Float</a></li>
<li><a href="qmetatype.html#Type-enum">QMetaType::Double</a></li>
<li><a href="qmetatype.html#Type-enum">QMetaType::QChar</a></li>
<li><a href="qmetatype.html#Type-enum">QMetaType::QDate</a></li>
<li><a href="qmetatype.html#Type-enum">QMetaType::QTime</a></li>
<li><a href="qmetatype.html#Type-enum">QMetaType::QDateTime</a></li>
<li><a href="qmetatype.html#Type-enum">QMetaType::QString</a></li>
</ul>
<p>Any other type will be converted to a <a href="qstring.html">QString</a> using <a href="qvariant.html#toString">QVariant::toString</a>().</p>
<p>Comparison of <a href="qstring.html">QString</a>s is case sensitive by default; this can be changed using the <a href="qsortfilterproxymodel.html#sortCaseSensitivity-prop">sortCaseSensitivity</a> property.</p>
<p>By default, the <a href="qt.html#ItemDataRole-enum">Qt::DisplayRole</a> associated with the <a href="qmodelindex.html">QModelIndex</a>es is used for comparisons. This can be changed by setting the <a href="qsortfilterproxymodel.html#sortRole-prop">sortRole</a> property.</p>
<p><b>Note: </b>The indices passed in correspond to the source model.</p><p><b>See also </b><a href="qsortfilterproxymodel.html#sortRole-prop">sortRole</a>, <a href="qsortfilterproxymodel.html#sortCaseSensitivity-prop">sortCaseSensitivity</a>, and <a href="qsortfilterproxymodel.html#dynamicSortFilter-prop">dynamicSortFilter</a>.</p>
<!-- @@@lessThan -->
<!-- $$$mapFromSource[overload1]$$$mapFromSourceconstQModelIndex& -->
<h3 class="fn" id="mapFromSource"><a name="mapFromSource"></a><code>[virtual] </code><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QSortFilterProxyModel::<span class="name">mapFromSource</span>(const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp;<i>sourceIndex</i>) const</h3>
<p>Reimplemented from <a href="qabstractproxymodel.html#mapFromSource">QAbstractProxyModel::mapFromSource</a>().</p>
<p>Returns the model index in the <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> given the <i>sourceIndex</i> from the source model.</p>
<p><b>See also </b><a href="qsortfilterproxymodel.html#mapToSource">mapToSource</a>().</p>
<!-- @@@mapFromSource -->
<!-- $$$mapSelectionFromSource[overload1]$$$mapSelectionFromSourceconstQItemSelection& -->
<h3 class="fn" id="mapSelectionFromSource"><a name="mapSelectionFromSource"></a><code>[virtual] </code><span class="type"><a href="qitemselection.html">QItemSelection</a></span> QSortFilterProxyModel::<span class="name">mapSelectionFromSource</span>(const <span class="type"><a href="qitemselection.html">QItemSelection</a></span> &amp;<i>sourceSelection</i>) const</h3>
<p>Reimplemented from <a href="qabstractproxymodel.html#mapSelectionFromSource">QAbstractProxyModel::mapSelectionFromSource</a>().</p>
<!-- @@@mapSelectionFromSource -->
<!-- $$$mapSelectionToSource[overload1]$$$mapSelectionToSourceconstQItemSelection& -->
<h3 class="fn" id="mapSelectionToSource"><a name="mapSelectionToSource"></a><code>[virtual] </code><span class="type"><a href="qitemselection.html">QItemSelection</a></span> QSortFilterProxyModel::<span class="name">mapSelectionToSource</span>(const <span class="type"><a href="qitemselection.html">QItemSelection</a></span> &amp;<i>proxySelection</i>) const</h3>
<p>Reimplemented from <a href="qabstractproxymodel.html#mapSelectionToSource">QAbstractProxyModel::mapSelectionToSource</a>().</p>
<!-- @@@mapSelectionToSource -->
<!-- $$$mapToSource[overload1]$$$mapToSourceconstQModelIndex& -->
<h3 class="fn" id="mapToSource"><a name="mapToSource"></a><code>[virtual] </code><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QSortFilterProxyModel::<span class="name">mapToSource</span>(const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp;<i>proxyIndex</i>) const</h3>
<p>Reimplemented from <a href="qabstractproxymodel.html#mapToSource">QAbstractProxyModel::mapToSource</a>().</p>
<p>Returns the source model index corresponding to the given <i>proxyIndex</i> from the sorting filter model.</p>
<p><b>See also </b><a href="qsortfilterproxymodel.html#mapFromSource">mapFromSource</a>().</p>
<!-- @@@mapToSource -->
<!-- $$$match[overload1]$$$matchconstQModelIndex&intconstQVariant&intQt::MatchFlags -->
<h3 class="fn" id="match"><a name="match"></a><code>[virtual] </code><span class="type"><a href="qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a></span> QSortFilterProxyModel::<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</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#match">QAbstractItemModel::match</a>().</p>
<!-- @@@match -->
<!-- $$$mimeData[overload1]$$$mimeDataconstQModelIndexList& -->
<h3 class="fn" id="mimeData"><a name="mimeData"></a><code>[virtual] </code><span class="type"><a href="qmimedata.html">QMimeData</a></span> *QSortFilterProxyModel::<span class="name">mimeData</span>(const <span class="type"><a href="qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a></span> &amp;<i>indexes</i>) const</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#mimeData">QAbstractItemModel::mimeData</a>().</p>
<!-- @@@mimeData -->
<!-- $$$mimeTypes[overload1]$$$mimeTypes -->
<h3 class="fn" id="mimeTypes"><a name="mimeTypes"></a><code>[virtual] </code><span class="type"><a href="qstringlist.html">QStringList</a></span> QSortFilterProxyModel::<span class="name">mimeTypes</span>() const</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#mimeTypes">QAbstractItemModel::mimeTypes</a>().</p>
<!-- @@@mimeTypes -->
<!-- $$$parent[overload1]$$$parentconstQModelIndex& -->
<h3 class="fn" id="parent"><a name="parent"></a><code>[virtual] </code><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QSortFilterProxyModel::<span class="name">parent</span>(const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp;<i>child</i>) const</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#parent">QAbstractItemModel::parent</a>().</p>
<!-- @@@parent -->
<!-- $$$removeColumns[overload1]$$$removeColumnsintintconstQModelIndex& -->
<h3 class="fn" id="removeColumns"><a name="removeColumns"></a><code>[virtual] </code><span class="type">bool</span> QSortFilterProxyModel::<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())</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#removeColumns">QAbstractItemModel::removeColumns</a>().</p>
<!-- @@@removeColumns -->
<!-- $$$removeRows[overload1]$$$removeRowsintintconstQModelIndex& -->
<h3 class="fn" id="removeRows"><a name="removeRows"></a><code>[virtual] </code><span class="type">bool</span> QSortFilterProxyModel::<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())</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#removeRows">QAbstractItemModel::removeRows</a>().</p>
<!-- @@@removeRows -->
<!-- $$$rowCount[overload1]$$$rowCountconstQModelIndex& -->
<h3 class="fn" id="rowCount"><a name="rowCount"></a><code>[virtual] </code><span class="type">int</span> QSortFilterProxyModel::<span class="name">rowCount</span>(const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp;<i>parent</i> = QModelIndex()) const</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#rowCount">QAbstractItemModel::rowCount</a>().</p>
<!-- @@@rowCount -->
<!-- $$$setData[overload1]$$$setDataconstQModelIndex&constQVariant&int -->
<h3 class="fn" id="setData"><a name="setData"></a><code>[virtual] </code><span class="type">bool</span> QSortFilterProxyModel::<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)</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#setData">QAbstractItemModel::setData</a>().</p>
<p><b>See also </b><a href="qsortfilterproxymodel.html#data">data</a>().</p>
<!-- @@@setData -->
<!-- $$$setFilterFixedString[overload1]$$$setFilterFixedStringconstQString& -->
<h3 class="fn" id="setFilterFixedString"><a name="setFilterFixedString"></a><code>[slot] </code><span class="type">void</span> QSortFilterProxyModel::<span class="name">setFilterFixedString</span>(const <span class="type"><a href="qstring.html">QString</a></span> &amp;<i>pattern</i>)</h3>
<p>Sets the fixed string used to filter the contents of the source model to the given <i>pattern</i>.</p>
<p><b>See also </b><a href="qsortfilterproxymodel.html#filterCaseSensitivity-prop">setFilterCaseSensitivity</a>(), <a href="qsortfilterproxymodel.html#filterRegExp-prop">setFilterRegExp</a>(), <a href="qsortfilterproxymodel.html#setFilterWildcard">setFilterWildcard</a>(), and <a href="qsortfilterproxymodel.html#filterRegExp-prop">filterRegExp</a>().</p>
<!-- @@@setFilterFixedString -->
<!-- $$$setFilterRegExp -->
<h3 class="fn" id="setFilterRegExp-1"><a name="setFilterRegExp-1"></a><code>[slot] </code><span class="type">void</span> QSortFilterProxyModel::<span class="name">setFilterRegExp</span>(const <span class="type"><a href="qstring.html">QString</a></span> &amp;<i>pattern</i>)</h3>
<p>This is an overloaded function.</p>
<p>Sets the regular expression used to filter the contents of the source model to <i>pattern</i>.</p>
<p><b>Note:</b> Setter function for property <a href="qsortfilterproxymodel.html#filterRegExp-prop">filterRegExp</a>. </p><p><b>See also </b><a href="qsortfilterproxymodel.html#filterCaseSensitivity-prop">setFilterCaseSensitivity</a>(), <a href="qsortfilterproxymodel.html#setFilterWildcard">setFilterWildcard</a>(), <a href="qsortfilterproxymodel.html#setFilterFixedString">setFilterFixedString</a>(), and <a href="qsortfilterproxymodel.html#filterRegExp-prop">filterRegExp</a>().</p>
<!-- @@@setFilterRegExp -->
<!-- $$$setFilterWildcard[overload1]$$$setFilterWildcardconstQString& -->
<h3 class="fn" id="setFilterWildcard"><a name="setFilterWildcard"></a><code>[slot] </code><span class="type">void</span> QSortFilterProxyModel::<span class="name">setFilterWildcard</span>(const <span class="type"><a href="qstring.html">QString</a></span> &amp;<i>pattern</i>)</h3>
<p>Sets the wildcard expression used to filter the contents of the source model to the given <i>pattern</i>.</p>
<p><b>See also </b><a href="qsortfilterproxymodel.html#filterCaseSensitivity-prop">setFilterCaseSensitivity</a>(), <a href="qsortfilterproxymodel.html#filterRegExp-prop">setFilterRegExp</a>(), <a href="qsortfilterproxymodel.html#setFilterFixedString">setFilterFixedString</a>(), and <a href="qsortfilterproxymodel.html#filterRegExp-prop">filterRegExp</a>().</p>
<!-- @@@setFilterWildcard -->
<!-- $$$setHeaderData[overload1]$$$setHeaderDataintQt::OrientationconstQVariant&int -->
<h3 class="fn" id="setHeaderData"><a name="setHeaderData"></a><code>[virtual] </code><span class="type">bool</span> QSortFilterProxyModel::<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)</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#setHeaderData">QAbstractItemModel::setHeaderData</a>().</p>
<p><b>See also </b><a href="qsortfilterproxymodel.html#headerData">headerData</a>().</p>
<!-- @@@setHeaderData -->
<!-- $$$setSourceModel[overload1]$$$setSourceModelQAbstractItemModel* -->
<h3 class="fn" id="setSourceModel"><a name="setSourceModel"></a><code>[virtual] </code><span class="type">void</span> QSortFilterProxyModel::<span class="name">setSourceModel</span>(<span class="type"><a href="qabstractitemmodel.html#QAbstractItemModel">QAbstractItemModel</a></span> *<i>sourceModel</i>)</h3>
<p>Reimplemented from <a href="qabstractproxymodel.html#setSourceModel">QAbstractProxyModel::setSourceModel</a>().</p>
<!-- @@@setSourceModel -->
<!-- $$$sibling[overload1]$$$siblingintintconstQModelIndex& -->
<h3 class="fn" id="sibling"><a name="sibling"></a><code>[virtual] </code><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QSortFilterProxyModel::<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>idx</i>) const</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#sibling">QAbstractItemModel::sibling</a>().</p>
<!-- @@@sibling -->
<!-- $$$sort[overload1]$$$sortintQt::SortOrder -->
<h3 class="fn" id="sort"><a name="sort"></a><code>[virtual] </code><span class="type">void</span> QSortFilterProxyModel::<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)</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#sort">QAbstractItemModel::sort</a>().</p>
<!-- @@@sort -->
<!-- $$$sortColumn[overload1]$$$sortColumn -->
<h3 class="fn" id="sortColumn"><a name="sortColumn"></a><span class="type">int</span> QSortFilterProxyModel::<span class="name">sortColumn</span>() const</h3>
<p>the column currently used for sorting</p>
<p>This returns the most recently used sort column.</p>
<p>This function was introduced in  Qt 4.5.</p>
<!-- @@@sortColumn -->
<!-- $$$sortOrder[overload1]$$$sortOrder -->
<h3 class="fn" id="sortOrder"><a name="sortOrder"></a><span class="type"><a href="qt.html#SortOrder-enum">Qt::SortOrder</a></span> QSortFilterProxyModel::<span class="name">sortOrder</span>() const</h3>
<p>the order currently used for sorting</p>
<p>This returns the most recently used sort order.</p>
<p>This function was introduced in  Qt 4.5.</p>
<!-- @@@sortOrder -->
<!-- $$$span[overload1]$$$spanconstQModelIndex& -->
<h3 class="fn" id="span"><a name="span"></a><code>[virtual] </code><span class="type"><a href="qsize.html">QSize</a></span> QSortFilterProxyModel::<span class="name">span</span>(const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp;<i>index</i>) const</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#span">QAbstractItemModel::span</a>().</p>
<!-- @@@span -->
<!-- $$$supportedDropActions[overload1]$$$supportedDropActions -->
<h3 class="fn" id="supportedDropActions"><a name="supportedDropActions"></a><code>[virtual] </code><span class="type"><a href="qt.html#DropAction-enum">Qt::DropActions</a></span> QSortFilterProxyModel::<span class="name">supportedDropActions</span>() const</h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#supportedDropActions">QAbstractItemModel::supportedDropActions</a>().</p>
<!-- @@@supportedDropActions -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    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.<br>    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. </p>
</div>
</body>
</html>