<?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>QDataWidgetMapper 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">QDataWidgetMapper Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QDataWidgetMapper class provides mapping between a section of a data model to widgets. <a href="#details">More...</a></p> <p>Inherits <a href="qobject.html">QObject</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qdatawidgetmapper.html#SubmitPolicy-enum">SubmitPolicy</a></b> { AutoSubmit, ManualSubmit }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdatawidgetmapper.html#QDataWidgetMapper">__init__</a></b> (<i>self</i>, QObject <i>parent</i> = None)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#addMapping">addMapping</a></b> (<i>self</i>, QWidget <i>widget</i>, int <i>section</i>)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#addMapping-2">addMapping</a></b> (<i>self</i>, QWidget <i>widget</i>, int <i>section</i>, QByteArray <i>propertyName</i>)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#clearMapping">clearMapping</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdatawidgetmapper.html#currentIndex">currentIndex</a></b> (<i>self</i>)</li><li><div class="fn" />QAbstractItemDelegate <b><a href="qdatawidgetmapper.html#itemDelegate">itemDelegate</a></b> (<i>self</i>)</li><li><div class="fn" />QByteArray <b><a href="qdatawidgetmapper.html#mappedPropertyName">mappedPropertyName</a></b> (<i>self</i>, QWidget <i>widget</i>)</li><li><div class="fn" />int <b><a href="qdatawidgetmapper.html#mappedSection">mappedSection</a></b> (<i>self</i>, QWidget <i>widget</i>)</li><li><div class="fn" />QWidget <b><a href="qdatawidgetmapper.html#mappedWidgetAt">mappedWidgetAt</a></b> (<i>self</i>, int <i>section</i>)</li><li><div class="fn" />QAbstractItemModel <b><a href="qdatawidgetmapper.html#model">model</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.Orientation <b><a href="qdatawidgetmapper.html#orientation">orientation</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#removeMapping">removeMapping</a></b> (<i>self</i>, QWidget <i>widget</i>)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#revert">revert</a></b> (<i>self</i>)</li><li><div class="fn" />QModelIndex <b><a href="qdatawidgetmapper.html#rootIndex">rootIndex</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#setCurrentIndex">setCurrentIndex</a></b> (<i>self</i>, int <i>index</i>)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#setCurrentModelIndex">setCurrentModelIndex</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#setItemDelegate">setItemDelegate</a></b> (<i>self</i>, QAbstractItemDelegate <i>delegate</i>)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#setModel">setModel</a></b> (<i>self</i>, QAbstractItemModel <i>model</i>)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#setOrientation">setOrientation</a></b> (<i>self</i>, Qt.Orientation <i>aOrientation</i>)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#setRootIndex">setRootIndex</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#setSubmitPolicy">setSubmitPolicy</a></b> (<i>self</i>, SubmitPolicy <i>policy</i>)</li><li><div class="fn" />bool <b><a href="qdatawidgetmapper.html#submit">submit</a></b> (<i>self</i>)</li><li><div class="fn" />SubmitPolicy <b><a href="qdatawidgetmapper.html#submitPolicy">submitPolicy</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#toFirst">toFirst</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#toLast">toLast</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#toNext">toNext</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdatawidgetmapper.html#toPrevious">toPrevious</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qdatawidgetmapper.html#currentIndexChanged">currentIndexChanged</a></b> (int)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QDataWidgetMapper class provides mapping between a section of a data model to widgets.</p> <p>QDataWidgetMapper can be used to create data-aware widgets by mapping them to sections of an item model. A section is a column of a model if the orientation is horizontal (the default), otherwise a row.</p> <p>Every time the current index changes, each widget is updated with data from the model via the property specified when its mapping was made. If the user edits the contents of a widget, the changes are read using the same property and written back to the model. By default, each widget's <a href="qobject.html#Q_PROPERTY">user property</a> is used to transfer data between the model and the widget. Since Qt 4.3, an additional <a href="qdatawidgetmapper.html#addMapping">addMapping</a>() function enables a named property to be used instead of the default user property.</p> <p>It is possible to set an item delegate to support custom widgets. By default, a <a href="qitemdelegate.html">QItemDelegate</a> is used to synchronize the model with the widgets.</p> <p>Let us assume that we have an item model named <tt>model</tt> with the following contents:</p> <table class="generic"> <tr class="odd" valign="top"> <td>1</td> <td>Qt Norway</td> <td>Oslo</td> </tr> <tr class="even" valign="top"> <td>2</td> <td>Qt Australia</td> <td>Brisbane</td> </tr> <tr class="odd" valign="top"> <td>3</td> <td>Qt USA</td> <td>Palo Alto</td> </tr> <tr class="even" valign="top"> <td>4</td> <td>Qt China</td> <td>Beijing</td> </tr> <tr class="odd" valign="top"> <td>5</td> <td>Qt Germany</td> <td>Berlin</td> </tr> </table> <p>The following code will map the columns of the model to widgets called <tt>mySpinBox</tt>, <tt>myLineEdit</tt> and <tt>myCountryChooser</tt>:</p> <pre class="cpp"> <span class="type">QDataWidgetMapper</span> <span class="operator">*</span>mapper <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QDataWidgetMapper</span>; mapper<span class="operator">-</span><span class="operator">></span><a href="qdatawidgetmapper.html#setModel">setModel</a>(model); mapper<span class="operator">-</span><span class="operator">></span><a href="qdatawidgetmapper.html#addMapping">addMapping</a>(mySpinBox<span class="operator">,</span> <span class="number">0</span>); mapper<span class="operator">-</span><span class="operator">></span><a href="qdatawidgetmapper.html#addMapping">addMapping</a>(myLineEdit<span class="operator">,</span> <span class="number">1</span>); mapper<span class="operator">-</span><span class="operator">></span><a href="qdatawidgetmapper.html#addMapping">addMapping</a>(myCountryChooser<span class="operator">,</span> <span class="number">2</span>); mapper<span class="operator">-</span><span class="operator">></span><a href="qdatawidgetmapper.html#toFirst">toFirst</a>(); </pre> <p>After the call to <a href="qdatawidgetmapper.html#toFirst">toFirst</a>(), <tt>mySpinBox</tt> displays the value <tt>1</tt>, <tt>myLineEdit</tt> displays <tt>Qt Norway</tt> and <tt>myCountryChooser</tt> displays <tt>Oslo</tt>. The navigational functions <a href="qdatawidgetmapper.html#toFirst">toFirst</a>(), <a href="qdatawidgetmapper.html#toNext">toNext</a>(), <a href="qdatawidgetmapper.html#toPrevious">toPrevious</a>(), <a href="qdatawidgetmapper.html#toLast">toLast</a>() and <a href="qdatawidgetmapper.html#currentIndex-prop">setCurrentIndex</a>() can be used to navigate in the model and update the widgets with contents from the model.</p> <p>The <a href="qdatawidgetmapper.html#setRootIndex">setRootIndex</a>() function enables a particular item in a model to be specified as the root index - children of this item will be mapped to the relevant widgets in the user interface.</p> <p>QDataWidgetMapper supports two submit policies, <tt>AutoSubmit</tt> and <tt>ManualSubmit</tt>. <tt>AutoSubmit</tt> will update the model as soon as the current widget loses focus, <tt>ManualSubmit</tt> will not update the model unless <a href="qdatawidgetmapper.html#submit">submit</a>() is called. <tt>ManualSubmit</tt> is useful when displaying a dialog that lets the user cancel all modifications. Also, other views that display the model won't update until the user finishes all their modifications and submits.</p> <p>Note that QDataWidgetMapper keeps track of external modifications. If the contents of the model are updated in another module of the application, the widgets are updated as well.</p> <hr /><h2>Type Documentation</h2><h3 class="fn"><a name="SubmitPolicy-enum" />QDataWidgetMapper.SubmitPolicy</h3><p>This enum describes the possible submit policies a <a href="qdatawidgetmapper.html">QDataWidgetMapper</a> supports.</p> <table class="valuelist"> <tr class="odd" valign="top"> <th class="tblConst">Constant</th> <th class="tblval">Value</th> <th class="tbldscr">Description</th> </tr> <tr> <td class="topAlign"><tt>QDataWidgetMapper.AutoSubmit</tt></td> <td class="topAlign"><tt>0</tt></td> <td class="topAlign">Whenever a widget loses focus, the widget's current value is set to the item model.</td> </tr> <tr> <td class="topAlign"><tt>QDataWidgetMapper.ManualSubmit</tt></td> <td class="topAlign"><tt>1</tt></td> <td class="topAlign">The model is not updated until <a href="qdatawidgetmapper.html#submit">submit</a>() is called.</td> </tr> </table> <hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDataWidgetMapper" />QDataWidgetMapper.__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 new <a href="qdatawidgetmapper.html">QDataWidgetMapper</a> with parent object <i>parent</i>. By default, the orientation is horizontal and the submit policy is <tt>AutoSubmit</tt>.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#orientation-prop">setOrientation</a>() and <a href="qdatawidgetmapper.html#submitPolicy-prop">setSubmitPolicy</a>().</p> <h3 class="fn"><a name="addMapping" />QDataWidgetMapper.addMapping (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>widget</i>, int <i>section</i>)</h3><p>Adds a mapping between a <i>widget</i> and a <i>section</i> from the model. The <i>section</i> is a column in the model if the orientation is horizontal (the default), otherwise a row.</p> <p>For the following example, we assume a model <tt>myModel</tt> that has two columns: the first one contains the names of people in a group, and the second column contains their ages. The first column is mapped to the <a href="qlineedit.html">QLineEdit</a> <tt>nameLineEdit</tt>, and the second is mapped to the <a href="qspinbox.html">QSpinBox</a> <tt>ageSpinBox</tt>:</p> <pre class="cpp"> <span class="type"><a href="qdatawidgetmapper.html">QDataWidgetMapper</a></span> <span class="operator">*</span>mapper <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qdatawidgetmapper.html">QDataWidgetMapper</a></span>(); mapper<span class="operator">-</span><span class="operator">></span><a href="qdatawidgetmapper.html#setModel">setModel</a>(myModel); mapper<span class="operator">-</span><span class="operator">></span>addMapping(nameLineEdit<span class="operator">,</span> <span class="number">0</span>); mapper<span class="operator">-</span><span class="operator">></span>addMapping(ageSpinBox<span class="operator">,</span> <span class="number">1</span>); </pre> <p><b>Notes:</b></p> <ul> <li>If the <i>widget</i> is already mapped to a section, the old mapping will be replaced by the new one.</li> <li>Only one-to-one mappings between sections and widgets are allowed. It is not possible to map a single section to multiple widgets, or to map a single widget to multiple sections.</li> </ul> <p><b>See also</b> <a href="qdatawidgetmapper.html#removeMapping">removeMapping</a>(), <a href="qdatawidgetmapper.html#mappedSection">mappedSection</a>(), and <a href="qdatawidgetmapper.html#clearMapping">clearMapping</a>().</p> <h3 class="fn"><a name="addMapping-2" />QDataWidgetMapper.addMapping (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>widget</i>, int <i>section</i>, <a href="qbytearray.html">QByteArray</a> <i>propertyName</i>)</h3><p>Essentially the same as <a href="qdatawidgetmapper.html#addMapping">addMapping</a>(), but adds the possibility to specify the property to use specifying <i>propertyName</i>.</p> <p>This function was introduced in Qt 4.3.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#addMapping">addMapping</a>().</p> <h3 class="fn"><a name="clearMapping" />QDataWidgetMapper.clearMapping (<i>self</i>)</h3><p>Clears all mappings.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#addMapping">addMapping</a>() and <a href="qdatawidgetmapper.html#removeMapping">removeMapping</a>().</p> <h3 class="fn"><a name="currentIndex" />int QDataWidgetMapper.currentIndex (<i>self</i>)</h3><h3 class="fn"><a name="itemDelegate" /><a href="qabstractitemdelegate.html">QAbstractItemDelegate</a> QDataWidgetMapper.itemDelegate (<i>self</i>)</h3><p>Returns the current item delegate.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#setItemDelegate">setItemDelegate</a>().</p> <h3 class="fn"><a name="mappedPropertyName" /><a href="qbytearray.html">QByteArray</a> QDataWidgetMapper.mappedPropertyName (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>widget</i>)</h3><p>Returns the name of the property that is used when mapping data to the given <i>widget</i>.</p> <p>This function was introduced in Qt 4.3.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#mappedSection">mappedSection</a>(), <a href="qdatawidgetmapper.html#addMapping">addMapping</a>(), and <a href="qdatawidgetmapper.html#removeMapping">removeMapping</a>().</p> <h3 class="fn"><a name="mappedSection" />int QDataWidgetMapper.mappedSection (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>widget</i>)</h3><p>Returns the section the <i>widget</i> is mapped to or -1 if the widget is not mapped.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#addMapping">addMapping</a>() and <a href="qdatawidgetmapper.html#removeMapping">removeMapping</a>().</p> <h3 class="fn"><a name="mappedWidgetAt" /><a href="qwidget.html">QWidget</a> QDataWidgetMapper.mappedWidgetAt (<i>self</i>, int <i>section</i>)</h3><p>Returns the widget that is mapped at <i>section</i>, or 0 if no widget is mapped at that section.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#addMapping">addMapping</a>() and <a href="qdatawidgetmapper.html#removeMapping">removeMapping</a>().</p> <h3 class="fn"><a name="model" /><a href="qabstractitemmodel.html">QAbstractItemModel</a> QDataWidgetMapper.model (<i>self</i>)</h3><p>Returns the current model.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#setModel">setModel</a>().</p> <h3 class="fn"><a name="orientation" /><a href="qt.html#Orientation-enum">Qt.Orientation</a> QDataWidgetMapper.orientation (<i>self</i>)</h3><h3 class="fn"><a name="removeMapping" />QDataWidgetMapper.removeMapping (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>widget</i>)</h3><p>Removes the mapping for the given <i>widget</i>.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#addMapping">addMapping</a>() and <a href="qdatawidgetmapper.html#clearMapping">clearMapping</a>().</p> <h3 class="fn"><a name="revert" />QDataWidgetMapper.revert (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void revert()</tt>.</p><p>Repopulates all widgets with the current data of the model. All unsubmitted changes will be lost.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#submit">submit</a>() and <a href="qdatawidgetmapper.html#submitPolicy-prop">setSubmitPolicy</a>().</p> <h3 class="fn"><a name="rootIndex" /><a href="qmodelindex.html">QModelIndex</a> QDataWidgetMapper.rootIndex (<i>self</i>)</h3><p>Returns the current root index.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#setRootIndex">setRootIndex</a>().</p> <h3 class="fn"><a name="setCurrentIndex" />QDataWidgetMapper.setCurrentIndex (<i>self</i>, int <i>index</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setCurrentIndex(int)</tt>.</p><h3 class="fn"><a name="setCurrentModelIndex" />QDataWidgetMapper.setCurrentModelIndex (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setCurrentModelIndex(const QModelIndex&)</tt>.</p><p>Sets the current index to the row of the <i>index</i> if the orientation is horizontal (the default), otherwise to the column of the <i>index</i>.</p> <p>Calls <a href="qdatawidgetmapper.html#currentIndex-prop">setCurrentIndex</a>() internally. This convenience slot can be connected to the signal <a href="qitemselectionmodel.html#currentRowChanged">currentRowChanged()</a> or <a href="qitemselectionmodel.html#currentColumnChanged">currentColumnChanged()</a> of another view's <a href="qitemselectionmodel.html">selection model</a>.</p> <p>The following example illustrates how to update all widgets with new data whenever the selection of a <a href="qtableview.html">QTableView</a> named <tt>myTableView</tt> changes:</p> <pre class="cpp"> <span class="type"><a href="qdatawidgetmapper.html">QDataWidgetMapper</a></span> <span class="operator">*</span>mapper <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qdatawidgetmapper.html">QDataWidgetMapper</a></span>(); <a href="qobject.html#connect">connect</a>(myTableView<span class="operator">-</span><span class="operator">></span>selectionModel()<span class="operator">,</span> SIGNAL(currentRowChanged(<span class="type"><a href="qmodelindex.html">QModelIndex</a></span><span class="operator">,</span><span class="type"><a href="qmodelindex.html">QModelIndex</a></span>))<span class="operator">,</span> mapper<span class="operator">,</span> SLOT(setCurrentModelIndex(<span class="type"><a href="qmodelindex.html">QModelIndex</a></span>))); </pre> <p><b>See also</b> <a href="qdatawidgetmapper.html#currentIndex-prop">currentIndex</a>().</p> <h3 class="fn"><a name="setItemDelegate" />QDataWidgetMapper.setItemDelegate (<i>self</i>, <a href="qabstractitemdelegate.html">QAbstractItemDelegate</a> <i>delegate</i>)</h3><p>Sets the item delegate to <i>delegate</i>. The delegate will be used to write data from the model into the widget and from the widget to the model, using <a href="qabstractitemdelegate.html#setEditorData">QAbstractItemDelegate.setEditorData</a>() and <a href="qabstractitemdelegate.html#setModelData">QAbstractItemDelegate.setModelData</a>().</p> <p>The delegate also decides when to apply data and when to change the editor, using <a href="qabstractitemdelegate.html#commitData">QAbstractItemDelegate.commitData</a>() and <a href="qabstractitemdelegate.html#closeEditor">QAbstractItemDelegate.closeEditor</a>().</p> <p><b>Warning:</b> You should not share the same instance of a delegate between widget mappers or views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the <a href="qabstractitemdelegate.html#closeEditor">closeEditor()</a> signal, and attempt to access, modify or close an editor that has already been closed.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#itemDelegate">itemDelegate</a>().</p> <h3 class="fn"><a name="setModel" />QDataWidgetMapper.setModel (<i>self</i>, <a href="qabstractitemmodel.html">QAbstractItemModel</a> <i>model</i>)</h3><p>Sets the current model to <i>model</i>. If another model was set, all mappings to that old model are cleared.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#model">model</a>().</p> <h3 class="fn"><a name="setOrientation" />QDataWidgetMapper.setOrientation (<i>self</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a> <i>aOrientation</i>)</h3><h3 class="fn"><a name="setRootIndex" />QDataWidgetMapper.setRootIndex (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>Sets the root item to <i>index</i>. This can be used to display a branch of a tree. Pass an invalid model index to display the top-most branch.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#rootIndex">rootIndex</a>().</p> <h3 class="fn"><a name="setSubmitPolicy" />QDataWidgetMapper.setSubmitPolicy (<i>self</i>, <a href="qdatawidgetmapper.html#SubmitPolicy-enum">SubmitPolicy</a> <i>policy</i>)</h3><h3 class="fn"><a name="submit" />bool QDataWidgetMapper.submit (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>bool submit()</tt>.</p><p>Submits all changes from the mapped widgets to the model.</p> <p>For every mapped section, the item delegate reads the current value from the widget and sets it in the model. Finally, the model's <a href="qabstractitemmodel.html#submit">submit()</a> method is invoked.</p> <p>Returns true if all the values were submitted, otherwise false.</p> <p>Note: For database models, <a href="qsqlquerymodel.html#lastError">QSqlQueryModel.lastError</a>() can be used to retrieve the last error.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#revert">revert</a>() and <a href="qdatawidgetmapper.html#submitPolicy-prop">setSubmitPolicy</a>().</p> <h3 class="fn"><a name="submitPolicy" /><a href="qdatawidgetmapper.html#SubmitPolicy-enum">SubmitPolicy</a> QDataWidgetMapper.submitPolicy (<i>self</i>)</h3><h3 class="fn"><a name="toFirst" />QDataWidgetMapper.toFirst (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void toFirst()</tt>.</p><p>Populates the widgets with data from the first row of the model if the orientation is horizontal (the default), otherwise with data from the first column.</p> <p>This is equivalent to calling <tt>setCurrentIndex(0)</tt>.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#toLast">toLast</a>() and <a href="qdatawidgetmapper.html#currentIndex-prop">setCurrentIndex</a>().</p> <h3 class="fn"><a name="toLast" />QDataWidgetMapper.toLast (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void toLast()</tt>.</p><p>Populates the widgets with data from the last row of the model if the orientation is horizontal (the default), otherwise with data from the last column.</p> <p>Calls <a href="qdatawidgetmapper.html#currentIndex-prop">setCurrentIndex</a>() internally.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#toFirst">toFirst</a>() and <a href="qdatawidgetmapper.html#currentIndex-prop">setCurrentIndex</a>().</p> <h3 class="fn"><a name="toNext" />QDataWidgetMapper.toNext (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void toNext()</tt>.</p><p>Populates the widgets with data from the next row of the model if the orientation is horizontal (the default), otherwise with data from the next column.</p> <p>Calls <a href="qdatawidgetmapper.html#currentIndex-prop">setCurrentIndex</a>() internally. Does nothing if there is no next row in the model.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#toPrevious">toPrevious</a>() and <a href="qdatawidgetmapper.html#currentIndex-prop">setCurrentIndex</a>().</p> <h3 class="fn"><a name="toPrevious" />QDataWidgetMapper.toPrevious (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void toPrevious()</tt>.</p><p>Populates the widgets with data from the previous row of the model if the orientation is horizontal (the default), otherwise with data from the previous column.</p> <p>Calls <a href="qdatawidgetmapper.html#currentIndex-prop">setCurrentIndex</a>() internally. Does nothing if there is no previous row in the model.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#toNext">toNext</a>() and <a href="qdatawidgetmapper.html#currentIndex-prop">setCurrentIndex</a>().</p> <hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="currentIndexChanged" />void currentIndexChanged (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted after the current index has changed and all widgets were populated with new data. <i>index</i> is the new current index.</p> <p><b>See also</b> <a href="qdatawidgetmapper.html#currentIndex-prop">currentIndex</a>() and <a href="qdatawidgetmapper.html#currentIndex-prop">setCurrentIndex</a>().</p> <address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.10.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.5</td></tr></table></div></address></body></html>