1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QAbstractProxyModel Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QAbstractProxyModel Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QAbstractProxyModel class provides a base class for proxy
item models that can do sorting, filtering or other data processing
tasks. <a href="#details">More...</a></p>
<p>Inherits <a href="qabstractitemmodel.html">QAbstractItemModel</a>.</p><p>Inherited by <a href="qidentityproxymodel.html">QIdentityProxyModel</a> and <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qabstractproxymodel.html#QAbstractProxyModel">__init__</a></b> (<i>self</i>, QObject <i>parent</i> = None)</li><li><div class="fn" />QModelIndex <b><a href="qabstractproxymodel.html#buddy">buddy</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" />bool <b><a href="qabstractproxymodel.html#canFetchMore">canFetchMore</a></b> (<i>self</i>, QModelIndex <i>parent</i>)</li><li><div class="fn" />QVariant <b><a href="qabstractproxymodel.html#data">data</a></b> (<i>self</i>, QModelIndex <i>proxyIndex</i>, int <i>role</i> = Qt.DisplayRole)</li><li><div class="fn" /><b><a href="qabstractproxymodel.html#fetchMore">fetchMore</a></b> (<i>self</i>, QModelIndex <i>parent</i>)</li><li><div class="fn" />Qt.ItemFlags <b><a href="qabstractproxymodel.html#flags">flags</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" />bool <b><a href="qabstractproxymodel.html#hasChildren">hasChildren</a></b> (<i>self</i>, QModelIndex <i>parent</i> = QModelIndex())</li><li><div class="fn" />QVariant <b><a href="qabstractproxymodel.html#headerData">headerData</a></b> (<i>self</i>, int <i>section</i>, Qt.Orientation <i>orientation</i>, int <i>role</i>)</li><li><div class="fn" />unknown-type <b><a href="qabstractproxymodel.html#itemData">itemData</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" />QModelIndex <b><a href="qabstractproxymodel.html#mapFromSource">mapFromSource</a></b> (<i>self</i>, QModelIndex <i>sourceIndex</i>)</li><li><div class="fn" />QItemSelection <b><a href="qabstractproxymodel.html#mapSelectionFromSource">mapSelectionFromSource</a></b> (<i>self</i>, QItemSelection <i>selection</i>)</li><li><div class="fn" />QItemSelection <b><a href="qabstractproxymodel.html#mapSelectionToSource">mapSelectionToSource</a></b> (<i>self</i>, QItemSelection <i>selection</i>)</li><li><div class="fn" />QModelIndex <b><a href="qabstractproxymodel.html#mapToSource">mapToSource</a></b> (<i>self</i>, QModelIndex <i>proxyIndex</i>)</li><li><div class="fn" />QMimeData <b><a href="qabstractproxymodel.html#mimeData">mimeData</a></b> (<i>self</i>, unknown-type <i>indexes</i>)</li><li><div class="fn" />QStringList <b><a href="qabstractproxymodel.html#mimeTypes">mimeTypes</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractproxymodel.html#revert">revert</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qabstractproxymodel.html#setData">setData</a></b> (<i>self</i>, QModelIndex <i>index</i>, QVariant <i>value</i>, int <i>role</i> = Qt.EditRole)</li><li><div class="fn" />bool <b><a href="qabstractproxymodel.html#setHeaderData">setHeaderData</a></b> (<i>self</i>, int <i>section</i>, Qt.Orientation <i>orientation</i>, QVariant <i>value</i>, int <i>role</i> = Qt.EditRole)</li><li><div class="fn" />bool <b><a href="qabstractproxymodel.html#setItemData">setItemData</a></b> (<i>self</i>, QModelIndex <i>index</i>, unknown-type <i>roles</i>)</li><li><div class="fn" /><b><a href="qabstractproxymodel.html#setSourceModel">setSourceModel</a></b> (<i>self</i>, QAbstractItemModel <i>sourceModel</i>)</li><li><div class="fn" /><b><a href="qabstractproxymodel.html#sort">sort</a></b> (<i>self</i>, int <i>column</i>, Qt.SortOrder <i>order</i> = Qt.AscendingOrder)</li><li><div class="fn" />QAbstractItemModel <b><a href="qabstractproxymodel.html#sourceModel">sourceModel</a></b> (<i>self</i>)</li><li><div class="fn" />QSize <b><a href="qabstractproxymodel.html#span">span</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" />bool <b><a href="qabstractproxymodel.html#submit">submit</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.DropActions <b><a href="qabstractproxymodel.html#supportedDropActions">supportedDropActions</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QAbstractProxyModel class provides a base class for proxy
item models that can do sorting, filtering or other data processing
tasks.</p>
<p>This class defines the standard interface that proxy models must
use to be able to interoperate correctly with other model/view
components. It is not supposed to be instantiated directly.</p>
<p>All standard proxy models are derived from the
QAbstractProxyModel class. If you need to create a new proxy model
class, it is usually better to subclass an existing class that
provides the closest behavior to the one you want to provide.</p>
<p>Proxy models that filter or sort items of data from a source
model should be created by using or subclassing <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a>.</p>
<p>To subclass QAbstractProxyModel, you need to implement <a href="qabstractproxymodel.html#mapFromSource">mapFromSource</a>() and
<a href="qabstractproxymodel.html#mapToSource">mapToSource</a>().
The <a href="qabstractproxymodel.html#mapSelectionFromSource">mapSelectionFromSource</a>()
and <a href="qabstractproxymodel.html#mapSelectionToSource">mapSelectionToSource</a>()
functions only need to be reimplemented if you need a behavior
different from the default behavior.</p>
<p><b>Note:</b> If the source model is deleted or no source model
is specified, the proxy model operates on a empty placeholder
model.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QAbstractProxyModel" />QAbstractProxyModel.__init__ (<i>self</i>, <a href="qobject.html">QObject</a> <i>parent</i> = None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a proxy model with the given <i>parent</i>.</p>
<h3 class="fn"><a name="buddy" /><a href="qmodelindex.html">QModelIndex</a> QAbstractProxyModel.buddy (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#buddy">QAbstractItemModel.buddy</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<h3 class="fn"><a name="canFetchMore" />bool QAbstractProxyModel.canFetchMore (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>parent</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#canFetchMore">QAbstractItemModel.canFetchMore</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<h3 class="fn"><a name="data" />QVariant QAbstractProxyModel.data (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>proxyIndex</i>, int <i>role</i> = Qt.DisplayRole)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#data">QAbstractItemModel.data</a>().</p>
<p><b>See also</b> <a href="qabstractproxymodel.html#setData">setData</a>().</p>
<h3 class="fn"><a name="fetchMore" />QAbstractProxyModel.fetchMore (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>parent</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#fetchMore">QAbstractItemModel.fetchMore</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<h3 class="fn"><a name="flags" /><a href="qt-itemflags.html">Qt.ItemFlags</a> QAbstractProxyModel.flags (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#flags">QAbstractItemModel.flags</a>().</p>
<h3 class="fn"><a name="hasChildren" />bool QAbstractProxyModel.hasChildren (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>parent</i> = QModelIndex())</h3><p>Reimplemented from <a href="qabstractitemmodel.html#hasChildren">QAbstractItemModel.hasChildren</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<h3 class="fn"><a name="headerData" />QVariant QAbstractProxyModel.headerData (<i>self</i>, int <i>section</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a> <i>orientation</i>, int <i>role</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#headerData">QAbstractItemModel.headerData</a>().</p>
<p><b>See also</b> <a href="qabstractproxymodel.html#setHeaderData">setHeaderData</a>().</p>
<h3 class="fn"><a name="itemData" />unknown-type QAbstractProxyModel.itemData (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#itemData">QAbstractItemModel.itemData</a>().</p>
<p><b>See also</b> <a href="qabstractproxymodel.html#setItemData">setItemData</a>().</p>
<h3 class="fn"><a name="mapFromSource" /><a href="qmodelindex.html">QModelIndex</a> QAbstractProxyModel.mapFromSource (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>sourceIndex</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Reimplement this function to return the model index in the proxy
model that corresponds to the <i>sourceIndex</i> from the source
model.</p>
<p><b>See also</b> <a href="qabstractproxymodel.html#mapToSource">mapToSource</a>().</p>
<h3 class="fn"><a name="mapSelectionFromSource" /><a href="qitemselection.html">QItemSelection</a> QAbstractProxyModel.mapSelectionFromSource (<i>self</i>, <a href="qitemselection.html">QItemSelection</a> <i>selection</i>)</h3><p>Returns a proxy selection mapped from the specified
<i>sourceSelection</i>.</p>
<p>Reimplement this method to map source selections to proxy
selections.</p>
<h3 class="fn"><a name="mapSelectionToSource" /><a href="qitemselection.html">QItemSelection</a> QAbstractProxyModel.mapSelectionToSource (<i>self</i>, <a href="qitemselection.html">QItemSelection</a> <i>selection</i>)</h3><p>Returns a source selection mapped from the specified
<i>proxySelection</i>.</p>
<p>Reimplement this method to map proxy selections to source
selections.</p>
<h3 class="fn"><a name="mapToSource" /><a href="qmodelindex.html">QModelIndex</a> QAbstractProxyModel.mapToSource (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>proxyIndex</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Reimplement this function to return the model index in the
source model that corresponds to the <i>proxyIndex</i> in the proxy
model.</p>
<p><b>See also</b> <a href="qabstractproxymodel.html#mapFromSource">mapFromSource</a>().</p>
<h3 class="fn"><a name="mimeData" /><a href="qmimedata.html">QMimeData</a> QAbstractProxyModel.mimeData (<i>self</i>, unknown-type <i>indexes</i>)</h3><p>The <i>QMimeData</i> result</p><p>Reimplemented from <a href="qabstractitemmodel.html#mimeData">QAbstractItemModel.mimeData</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<h3 class="fn"><a name="mimeTypes" />QStringList QAbstractProxyModel.mimeTypes (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#mimeTypes">QAbstractItemModel.mimeTypes</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<h3 class="fn"><a name="revert" />QAbstractProxyModel.revert (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#revert">QAbstractItemModel.revert</a>().</p>
<h3 class="fn"><a name="setData" />bool QAbstractProxyModel.setData (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>, QVariant <i>value</i>, int <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="qabstractproxymodel.html#data">data</a>().</p>
<h3 class="fn"><a name="setHeaderData" />bool QAbstractProxyModel.setHeaderData (<i>self</i>, int <i>section</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a> <i>orientation</i>, QVariant <i>value</i>, int <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="qabstractproxymodel.html#headerData">headerData</a>().</p>
<h3 class="fn"><a name="setItemData" />bool QAbstractProxyModel.setItemData (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>, unknown-type <i>roles</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#setItemData">QAbstractItemModel.setItemData</a>().</p>
<p><b>See also</b> <a href="qabstractproxymodel.html#itemData">itemData</a>().</p>
<h3 class="fn"><a name="setSourceModel" />QAbstractProxyModel.setSourceModel (<i>self</i>, <a href="qabstractitemmodel.html">QAbstractItemModel</a> <i>sourceModel</i>)</h3><p>Sets the given <i>sourceModel</i> to be processed by the proxy
model.</p>
<p><b>See also</b> <a href="qabstractproxymodel.html#sourceModel">sourceModel</a>().</p>
<h3 class="fn"><a name="sort" />QAbstractProxyModel.sort (<i>self</i>, int <i>column</i>, <a href="qt.html#SortOrder-enum">Qt.SortOrder</a> <i>order</i> = Qt.AscendingOrder)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#sort">QAbstractItemModel.sort</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<h3 class="fn"><a name="sourceModel" /><a href="qabstractitemmodel.html">QAbstractItemModel</a> QAbstractProxyModel.sourceModel (<i>self</i>)</h3><p>Returns the model that contains the data that is available
through the proxy model.</p>
<p><b>See also</b> <a href="qabstractproxymodel.html#setSourceModel">setSourceModel</a>().</p>
<h3 class="fn"><a name="span" /><a href="qsize.html">QSize</a> QAbstractProxyModel.span (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#span">QAbstractItemModel.span</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<h3 class="fn"><a name="submit" />bool QAbstractProxyModel.submit (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#submit">QAbstractItemModel.submit</a>().</p>
<h3 class="fn"><a name="supportedDropActions" /><a href="qt-dropactions.html">Qt.DropActions</a> QAbstractProxyModel.supportedDropActions (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#supportedDropActions">QAbstractItemModel.supportedDropActions</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.12.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qt.io">The Qt Company</a> 2015</td><td align="right" width="25%">Qt 4.8.7</td></tr></table></div></address></body></html>
|