Sophie

Sophie

distrib > * > 2009.0 > i586 > by-pkgid > a6711891ce757817bba854bf3f25205a > files > 1957

qtjambi-doc-4.3.3-3mdv2008.1.i586.rpm

<class name="QDataWidgetMapper" doc="/**
&lt;p&gt;The &lt;a href=&quot;QDataWidgetMapper.html#QDataWidgetMapper(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QDataWidgetMapper&lt;/tt&gt;&lt;/a&gt; class provides mapping between a section of a data model to widgets.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QDataWidgetMapper.html#QDataWidgetMapper(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QDataWidgetMapper&lt;/tt&gt;&lt;/a&gt; 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.&lt;/p&gt;
&lt;p&gt;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 user property&lt;/tt&gt; is used to transfer data between the model and the widget. Since Qt 4.3, an additional &lt;a href=&quot;QDataWidgetMapper.html#addMapping(com.trolltech.qt.gui.QWidget, int)&quot;&gt;&lt;tt&gt;addMapping&lt;/tt&gt;&lt;/a&gt; function enables a named property to be used instead of the default user property.&lt;/p&gt;
&lt;p&gt;It is possible to set an item delegate to support custom widgets. By default, a &lt;a href=&quot;QItemDelegate.html&quot;&gt;&lt;tt&gt;QItemDelegate&lt;/tt&gt;&lt;/a&gt; is used to synchronize the model with the widgets.&lt;/p&gt;
&lt;p&gt;Let us assume that we have an item model named &lt;tt&gt;model&lt;/tt&gt; with the following contents:&lt;/p&gt;
&lt;p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; border=&quot;0&quot;&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;$TROLLTECH$&lt;/td&gt;&lt;td&gt;Oslo&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;Trolltech Pty&lt;/td&gt;&lt;td&gt;Brisbane&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;Trolltech Inc&lt;/td&gt;&lt;td&gt;Palo Alto&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;Trolltech China&lt;/td&gt;&lt;td&gt;Beijing&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;Trolltech GmbH&lt;/td&gt;&lt;td&gt;Berlin&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;The following code will map the columns of the model to widgets called &lt;tt&gt;mySpinBox&lt;/tt&gt;, &lt;tt&gt;myLineEdit&lt;/tt&gt; and &lt;tt&gt;myCountryChooser&lt;/tt&gt;:&lt;/p&gt;
&lt;pre&gt;    QDataWidgetMapper *mapper = new QDataWidgetMapper;
    mapper-&amp;gt;setModel(model);
    mapper-&amp;gt;addMapping(mySpinBox, 0);
    mapper-&amp;gt;addMapping(myLineEdit, 1);
    mapper-&amp;gt;addMapping(myCountryChooser, 2);
    mapper-&amp;gt;toFirst();&lt;/pre&gt;
&lt;p&gt;After the call to &lt;a href=&quot;QDataWidgetMapper.html#toFirst()&quot;&gt;&lt;tt&gt;toFirst&lt;/tt&gt;&lt;/a&gt;, &lt;tt&gt;mySpinBox&lt;/tt&gt; displays the value &lt;tt&gt;1&lt;/tt&gt;, &lt;tt&gt;myLineEdit&lt;/tt&gt; displays &lt;tt&gt;$TROLLTECH$&lt;/tt&gt; and &lt;tt&gt;myCountryChooser&lt;/tt&gt; displays &lt;tt&gt;Oslo&lt;/tt&gt;. The navigational functions &lt;a href=&quot;QDataWidgetMapper.html#toFirst()&quot;&gt;&lt;tt&gt;toFirst&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QDataWidgetMapper.html#toNext()&quot;&gt;&lt;tt&gt;toNext&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QDataWidgetMapper.html#toPrevious()&quot;&gt;&lt;tt&gt;toPrevious&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QDataWidgetMapper.html#toLast()&quot;&gt;&lt;tt&gt;toLast&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QDataWidgetMapper.html#setCurrentIndex(int)&quot;&gt;&lt;tt&gt;setCurrentIndex&lt;/tt&gt;&lt;/a&gt; can be used to navigate in the model and update the widgets with contents from the model.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;QDataWidgetMapper.html#setRootIndex(com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;setRootIndex&lt;/tt&gt;&lt;/a&gt; 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.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QDataWidgetMapper.html#QDataWidgetMapper(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QDataWidgetMapper&lt;/tt&gt;&lt;/a&gt; supports two submit policies, &lt;tt&gt;AutoSubmit&lt;/tt&gt; and &lt;tt&gt;ManualSubmit&lt;/tt&gt;. &lt;tt&gt;AutoSubmit&lt;/tt&gt; will update the model as soon as the current widget loses focus, &lt;tt&gt;ManualSubmit&lt;/tt&gt; will not update the model unless &lt;a href=&quot;QDataWidgetMapper.html#submit()&quot;&gt;&lt;tt&gt;submit&lt;/tt&gt;&lt;/a&gt; is called. &lt;tt&gt;ManualSubmit&lt;/tt&gt; 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.&lt;/p&gt;
&lt;p&gt;Note that &lt;a href=&quot;QDataWidgetMapper.html#QDataWidgetMapper(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QDataWidgetMapper&lt;/tt&gt;&lt;/a&gt; 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.&lt;/p&gt;

@see &lt;a href=&quot;%2E%2E/core/QAbstractItemModel.html&quot;&gt;&lt;tt&gt;QAbstractItemModel&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QAbstractItemDelegate.html&quot;&gt;&lt;tt&gt;QAbstractItemDelegate&lt;/tt&gt;&lt;/a&gt; */">
    <signal name="protected final void currentIndexChanged(int index)" doc="/**
&lt;p&gt;This signal is emitted after the current index has changed and all widgets were populated with new data. &lt;tt&gt;index&lt;/tt&gt; is the new current index.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(int index)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QDataWidgetMapper.html#currentIndex()&quot;&gt;&lt;tt&gt;currentIndex&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QDataWidgetMapper.html#setCurrentIndex(int)&quot;&gt;&lt;tt&gt;setCurrentIndex&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <method name="public QDataWidgetMapper(com.trolltech.qt.core.QObject parent)" doc="/**
&lt;p&gt;Constructs a new &lt;a href=&quot;QDataWidgetMapper.html#QDataWidgetMapper(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QDataWidgetMapper&lt;/tt&gt;&lt;/a&gt; with parent object &lt;tt&gt;parent&lt;/tt&gt;. By default, the orientation is horizontal and the submit policy is &lt;tt&gt;AutoSubmit&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#setOrientation(com.trolltech.qt.core.Qt.Orientation)&quot;&gt;&lt;tt&gt;setOrientation&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#setSubmitPolicy(com.trolltech.qt.gui.QDataWidgetMapper.SubmitPolicy)&quot;&gt;&lt;tt&gt;setSubmitPolicy&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public QDataWidgetMapper()" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QDataWidgetMapper.html#QDataWidgetMapper(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QDataWidgetMapper&lt;/tt&gt;&lt;/a&gt;(0). */"/>
    <method name="public final void addMapping(com.trolltech.qt.gui.QWidget widget, int section, com.trolltech.qt.core.QByteArray propertyName)" doc="/**
&lt;p&gt;Essentially the same as &lt;a href=&quot;QDataWidgetMapper.html#addMapping(com.trolltech.qt.gui.QWidget, int)&quot;&gt;&lt;tt&gt;addMapping&lt;/tt&gt;&lt;/a&gt;, but adds the possibility to specify the property to use specifying &lt;tt&gt;propertyName&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#addMapping(com.trolltech.qt.gui.QWidget, int)&quot;&gt;&lt;tt&gt;addMapping&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void addMapping(com.trolltech.qt.gui.QWidget widget, int section)" doc="/**
&lt;p&gt;Adds a mapping between a &lt;tt&gt;widget&lt;/tt&gt; and a &lt;tt&gt;section&lt;/tt&gt; from the model. The &lt;tt&gt;section&lt;/tt&gt; is a column in the model if the orientation is horizontal (the default), otherwise a row.&lt;/p&gt;
&lt;p&gt;For the following example, we assume a model &lt;tt&gt;myModel&lt;/tt&gt; 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 &lt;a href=&quot;QLineEdit.html&quot;&gt;&lt;tt&gt;QLineEdit&lt;/tt&gt;&lt;/a&gt; &lt;tt&gt;nameLineEdit&lt;/tt&gt;, and the second is mapped to the &lt;a href=&quot;QSpinBox.html&quot;&gt;&lt;tt&gt;QSpinBox&lt;/tt&gt;&lt;/a&gt; &lt;tt&gt;ageSpinBox&lt;/tt&gt;:&lt;/p&gt;
&lt;pre&gt;    QDataWidgetMapper *mapper = new QDataWidgetMapper();
    mapper-&amp;gt;setModel(myModel);
    mapper-&amp;gt;addMapping(nameLineEdit, 0);
    mapper-&amp;gt;addMapping(ageSpinBox, 1);&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;Notes:&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If the &lt;tt&gt;widget&lt;/tt&gt; is already mapped to a section, the old mapping will be replaced by the new one.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;/ul&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#removeMapping(com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;removeMapping&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#mappedSection(com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;mappedSection&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#clearMapping()&quot;&gt;&lt;tt&gt;clearMapping&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void clearMapping()" doc="/**
&lt;p&gt;Clears all mappings.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#addMapping(com.trolltech.qt.gui.QWidget, int)&quot;&gt;&lt;tt&gt;addMapping&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#removeMapping(com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;removeMapping&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int currentIndex()" doc="/**
&lt;p&gt;Returns the current row or column.&lt;/p&gt;
&lt;p&gt;The widgets are populated with with data from the row at &lt;tt&gt;index&lt;/tt&gt; if the orientation is horizontal (the default), otherwise with data from the column at &lt;tt&gt;index&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#setCurrentIndex(int)&quot;&gt;&lt;tt&gt;setCurrentIndex&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#setCurrentModelIndex(com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;setCurrentModelIndex&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#toFirst()&quot;&gt;&lt;tt&gt;toFirst&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#toNext()&quot;&gt;&lt;tt&gt;toNext&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#toPrevious()&quot;&gt;&lt;tt&gt;toPrevious&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#toLast()&quot;&gt;&lt;tt&gt;toLast&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.gui.QAbstractItemDelegate itemDelegate()" doc="/**
&lt;p&gt;Returns the current item delegate.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#setItemDelegate(com.trolltech.qt.gui.QAbstractItemDelegate)&quot;&gt;&lt;tt&gt;setItemDelegate&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.core.QByteArray mappedPropertyName(com.trolltech.qt.gui.QWidget widget)" doc="/**
&lt;p&gt;Returns the name of the property that is used when mapping data to the given &lt;tt&gt;widget&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#mappedSection(com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;mappedSection&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#addMapping(com.trolltech.qt.gui.QWidget, int)&quot;&gt;&lt;tt&gt;addMapping&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#removeMapping(com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;removeMapping&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int mappedSection(com.trolltech.qt.gui.QWidget widget)" doc="/**
&lt;p&gt;Returns the section the &lt;tt&gt;widget&lt;/tt&gt; is mapped to or -1 if the widget is not mapped.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#addMapping(com.trolltech.qt.gui.QWidget, int)&quot;&gt;&lt;tt&gt;addMapping&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#removeMapping(com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;removeMapping&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.gui.QWidget mappedWidgetAt(int section)" doc="/**
&lt;p&gt;Returns the widget that is mapped at &lt;tt&gt;section&lt;/tt&gt;, or 0 if no widget is mapped at that section.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#addMapping(com.trolltech.qt.gui.QWidget, int)&quot;&gt;&lt;tt&gt;addMapping&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#removeMapping(com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;removeMapping&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.core.QAbstractItemModel model()" doc="/**
&lt;p&gt;Returns the current model.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#setModel(com.trolltech.qt.core.QAbstractItemModel)&quot;&gt;&lt;tt&gt;setModel&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.core.Qt.Orientation orientation()" doc="/**
&lt;p&gt;Returns the orientation of the model.&lt;/p&gt;
&lt;p&gt;If the orientation is Qt::Horizontal (the default), a widget is mapped to a column of a data model. The widget will be populated with the model's data from its mapped column and the row that &lt;a href=&quot;QDataWidgetMapper.html#currentIndex()&quot;&gt;&lt;tt&gt;currentIndex&lt;/tt&gt;&lt;/a&gt; points at.&lt;/p&gt;
&lt;p&gt;Use Qt::Horizontal for tabular data that looks like this:&lt;/p&gt;
&lt;p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; border=&quot;0&quot;&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;$TROLLTECH$&lt;/td&gt;&lt;td&gt;Oslo&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;Trolltech Pty&lt;/td&gt;&lt;td&gt;Brisbane&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;Trolltech Inc&lt;/td&gt;&lt;td&gt;Silicon Valley&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;Trolltech China&lt;/td&gt;&lt;td&gt;Beijing&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;Trolltech GmbH&lt;/td&gt;&lt;td&gt;Berlin&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;If the orientation is set to Qt::Vertical, a widget is mapped to a row. Calling &lt;a href=&quot;QDataWidgetMapper.html#setCurrentIndex(int)&quot;&gt;&lt;tt&gt;setCurrentIndex&lt;/tt&gt;&lt;/a&gt; will change the current column. The widget will be populates with the model's data from its mapped row and the column that &lt;a href=&quot;QDataWidgetMapper.html#currentIndex()&quot;&gt;&lt;tt&gt;currentIndex&lt;/tt&gt;&lt;/a&gt; points at.&lt;/p&gt;
&lt;p&gt;Use Qt::Vertical for tabular data that looks like this:&lt;/p&gt;
&lt;p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; border=&quot;0&quot;&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;5&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;$TROLLTECH$&lt;/td&gt;&lt;td&gt;Trolltech Pty&lt;/td&gt;&lt;td&gt;Trolltech Inc&lt;/td&gt;&lt;td&gt;Trolltech China&lt;/td&gt;&lt;td&gt;Trolltech GmbH&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;Oslo&lt;/td&gt;&lt;td&gt;Brisbane&lt;/td&gt;&lt;td&gt;Silicon Valley&lt;/td&gt;&lt;td&gt;Beijing&lt;/td&gt;&lt;td&gt;Berlin&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;Changing the orientation clears all existing mappings.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#setOrientation(com.trolltech.qt.core.Qt.Orientation)&quot;&gt;&lt;tt&gt;setOrientation&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void removeMapping(com.trolltech.qt.gui.QWidget widget)" doc="/**
&lt;p&gt;Removes the mapping for the given &lt;tt&gt;widget&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#addMapping(com.trolltech.qt.gui.QWidget, int)&quot;&gt;&lt;tt&gt;addMapping&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#clearMapping()&quot;&gt;&lt;tt&gt;clearMapping&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void revert()" doc="/**
&lt;p&gt;Repopulates all widgets with the current data of the model. All unsubmitted changes will be lost.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#submit()&quot;&gt;&lt;tt&gt;submit&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#setSubmitPolicy(com.trolltech.qt.gui.QDataWidgetMapper.SubmitPolicy)&quot;&gt;&lt;tt&gt;setSubmitPolicy&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.core.QModelIndex rootIndex()" doc="/**
&lt;p&gt;Returns the current root index.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#setRootIndex(com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;setRootIndex&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setCurrentModelIndex(com.trolltech.qt.core.QModelIndex index)" doc="/**
&lt;p&gt;Sets the current index to the row of the &lt;tt&gt;index&lt;/tt&gt; if the orientation is horizontal (the default), otherwise to the column of the &lt;tt&gt;index&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;Calls &lt;a href=&quot;QDataWidgetMapper.html#setCurrentIndex(int)&quot;&gt;&lt;tt&gt;setCurrentIndex&lt;/tt&gt;&lt;/a&gt; internally. This convenience slot can be connected to the signal currentRowChanged() or currentColumnChanged() of another view's &lt;a href=&quot;QItemSelectionModel.html&quot;&gt;selection model&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The following example illustrates how to update all widgets with new data whenever the selection of a &lt;a href=&quot;QTableView.html&quot;&gt;&lt;tt&gt;QTableView&lt;/tt&gt;&lt;/a&gt; named &lt;tt&gt;myTableView&lt;/tt&gt; changes:&lt;/p&gt;
&lt;pre&gt;    QDataWidgetMapper *mapper = new QDataWidgetMapper();
    connect(myTableView-&amp;gt;selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            mapper, SLOT(setCurrentModelIndex(QModelIndex)));&lt;/pre&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#currentIndex()&quot;&gt;&lt;tt&gt;currentIndex&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setItemDelegate(com.trolltech.qt.gui.QAbstractItemDelegate delegate)" doc="/**
&lt;p&gt;Sets the item delegate to &lt;tt&gt;delegate&lt;/tt&gt;. The delegate will be used to write data from the model into the widget and from the widget to the model, using QAbstractItemDelegate::setEditorData() and QAbstractItemDelegate::setModelData().&lt;/p&gt;
&lt;p&gt;The delegate also decides when to apply data and when to change the editor, using QAbstractItemDelegate::commitData() and QAbstractItemDelegate::closeEditor().&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Warning:&lt;/b&gt; 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 closeEditor() signal, and attempt to access, modify or close an editor that has already been closed.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#itemDelegate()&quot;&gt;&lt;tt&gt;itemDelegate&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setModel(com.trolltech.qt.core.QAbstractItemModel model)" doc="/**
&lt;p&gt;Sets the current model to &lt;tt&gt;model&lt;/tt&gt;. If another model was set, all mappings to that old model are cleared.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#model()&quot;&gt;&lt;tt&gt;model&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setOrientation(com.trolltech.qt.core.Qt.Orientation aOrientation)" doc="/**
&lt;p&gt;Sets the orientation of the model to &lt;tt&gt;aOrientation&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;If the orientation is Qt::Horizontal (the default), a widget is mapped to a column of a data model. The widget will be populated with the model's data from its mapped column and the row that &lt;a href=&quot;QDataWidgetMapper.html#currentIndex()&quot;&gt;&lt;tt&gt;currentIndex&lt;/tt&gt;&lt;/a&gt; points at.&lt;/p&gt;
&lt;p&gt;Use Qt::Horizontal for tabular data that looks like this:&lt;/p&gt;
&lt;p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; border=&quot;0&quot;&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;$TROLLTECH$&lt;/td&gt;&lt;td&gt;Oslo&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;Trolltech Pty&lt;/td&gt;&lt;td&gt;Brisbane&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;Trolltech Inc&lt;/td&gt;&lt;td&gt;Silicon Valley&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;Trolltech China&lt;/td&gt;&lt;td&gt;Beijing&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;Trolltech GmbH&lt;/td&gt;&lt;td&gt;Berlin&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;If the orientation is set to Qt::Vertical, a widget is mapped to a row. Calling &lt;a href=&quot;QDataWidgetMapper.html#setCurrentIndex(int)&quot;&gt;&lt;tt&gt;setCurrentIndex&lt;/tt&gt;&lt;/a&gt; will change the current column. The widget will be populates with the model's data from its mapped row and the column that &lt;a href=&quot;QDataWidgetMapper.html#currentIndex()&quot;&gt;&lt;tt&gt;currentIndex&lt;/tt&gt;&lt;/a&gt; points at.&lt;/p&gt;
&lt;p&gt;Use Qt::Vertical for tabular data that looks like this:&lt;/p&gt;
&lt;p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; border=&quot;0&quot;&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;5&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;$TROLLTECH$&lt;/td&gt;&lt;td&gt;Trolltech Pty&lt;/td&gt;&lt;td&gt;Trolltech Inc&lt;/td&gt;&lt;td&gt;Trolltech China&lt;/td&gt;&lt;td&gt;Trolltech GmbH&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;Oslo&lt;/td&gt;&lt;td&gt;Brisbane&lt;/td&gt;&lt;td&gt;Silicon Valley&lt;/td&gt;&lt;td&gt;Beijing&lt;/td&gt;&lt;td&gt;Berlin&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;Changing the orientation clears all existing mappings.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#orientation()&quot;&gt;&lt;tt&gt;orientation&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setRootIndex(com.trolltech.qt.core.QModelIndex index)" doc="/**
&lt;p&gt;Sets the root item to &lt;tt&gt;index&lt;/tt&gt;. This can be used to display a branch of a tree. Pass an invalid model index to display the top-most branch.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#rootIndex()&quot;&gt;&lt;tt&gt;rootIndex&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setSubmitPolicy(com.trolltech.qt.gui.QDataWidgetMapper.SubmitPolicy policy)" doc="/**
&lt;p&gt;Sets the current submit policy to &lt;tt&gt;policy&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;Changing the current submit policy will revert all widgets to the current data from the model.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#submitPolicy()&quot;&gt;&lt;tt&gt;submitPolicy&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final boolean submit()" doc="/**
&lt;p&gt;Submits all changes from the mapped widgets to the model.&lt;/p&gt;
&lt;p&gt;For every mapped section, the item delegate reads the current value from the widget and sets it in the model. Finally, the model's submit() method is invoked.&lt;/p&gt;
&lt;p&gt;Returns true if all the values were submitted, otherwise false.&lt;/p&gt;
&lt;p&gt;Note: For database models, QSqlQueryModel::lastError() can be used to retrieve the last error.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#revert()&quot;&gt;&lt;tt&gt;revert&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#setSubmitPolicy(com.trolltech.qt.gui.QDataWidgetMapper.SubmitPolicy)&quot;&gt;&lt;tt&gt;setSubmitPolicy&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.gui.QDataWidgetMapper.SubmitPolicy submitPolicy()" doc="/**
&lt;p&gt;Returns the current submit policy.&lt;/p&gt;
&lt;p&gt;Changing the current submit policy will revert all widgets to the current data from the model.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#setSubmitPolicy(com.trolltech.qt.gui.QDataWidgetMapper.SubmitPolicy)&quot;&gt;&lt;tt&gt;setSubmitPolicy&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void toFirst()" doc="/**
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;This is equivalent to calling &lt;tt&gt;setCurrentIndex(0)&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#toLast()&quot;&gt;&lt;tt&gt;toLast&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#setCurrentIndex(int)&quot;&gt;&lt;tt&gt;setCurrentIndex&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void toLast()" doc="/**
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Calls &lt;a href=&quot;QDataWidgetMapper.html#setCurrentIndex(int)&quot;&gt;&lt;tt&gt;setCurrentIndex&lt;/tt&gt;&lt;/a&gt; internally.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#toFirst()&quot;&gt;&lt;tt&gt;toFirst&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#setCurrentIndex(int)&quot;&gt;&lt;tt&gt;setCurrentIndex&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void toNext()" doc="/**
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Calls &lt;a href=&quot;QDataWidgetMapper.html#setCurrentIndex(int)&quot;&gt;&lt;tt&gt;setCurrentIndex&lt;/tt&gt;&lt;/a&gt; internally. Does nothing if there is no next row in the model.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#toPrevious()&quot;&gt;&lt;tt&gt;toPrevious&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#setCurrentIndex(int)&quot;&gt;&lt;tt&gt;setCurrentIndex&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void toPrevious()" doc="/**
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Calls &lt;a href=&quot;QDataWidgetMapper.html#setCurrentIndex(int)&quot;&gt;&lt;tt&gt;setCurrentIndex&lt;/tt&gt;&lt;/a&gt; internally. Does nothing if there is no previous row in the model.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#toNext()&quot;&gt;&lt;tt&gt;toNext&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#setCurrentIndex(int)&quot;&gt;&lt;tt&gt;setCurrentIndex&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public void setCurrentIndex(int index)" doc="/**
&lt;p&gt;Sets the current row or column to &lt;tt&gt;index&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The widgets are populated with with data from the row at &lt;tt&gt;index&lt;/tt&gt; if the orientation is horizontal (the default), otherwise with data from the column at &lt;tt&gt;index&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QDataWidgetMapper.html#currentIndex()&quot;&gt;&lt;tt&gt;currentIndex&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#setCurrentModelIndex(com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;setCurrentModelIndex&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#toFirst()&quot;&gt;&lt;tt&gt;toFirst&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#toNext()&quot;&gt;&lt;tt&gt;toNext&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#toPrevious()&quot;&gt;&lt;tt&gt;toPrevious&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDataWidgetMapper.html#toLast()&quot;&gt;&lt;tt&gt;toLast&lt;/tt&gt;&lt;/a&gt; */"/>
    <enum name="SubmitPolicy" doc="/**
&lt;p&gt;This enum describes the possible submit policies a &lt;a href=&quot;QDataWidgetMapper.html#QDataWidgetMapper(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QDataWidgetMapper&lt;/tt&gt;&lt;/a&gt; supports.&lt;/p&gt;
 */">
        <enum-value name="AutoSubmit" doc="/**
&lt;p&gt;Whenever a widget loses focus, the widget's current value is set to the item model.&lt;/p&gt;
 */"/>
        <enum-value name="ManualSubmit" doc="/**
&lt;p&gt;The model is not updated until &lt;a href=&quot;QDataWidgetMapper.html#submit()&quot;&gt;&lt;tt&gt;submit&lt;/tt&gt;&lt;/a&gt; is called.&lt;/p&gt;
 */"/>
</enum>
</class>