[][src]Struct qt_widgets::QDataWidgetMapper

#[repr(C)]pub struct QDataWidgetMapper { /* fields omitted */ }

The QDataWidgetMapper class provides mapping between a section of a data model to widgets.

C++ class: QDataWidgetMapper.

C++ documentation:

The QDataWidgetMapper class provides mapping between a section of a data model to widgets.

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.

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 is used to transfer data between the model and the widget. Since Qt 4.3, an additional addMapping() function enables a named property to be used instead of the default user property.

It is possible to set an item delegate to support custom widgets. By default, a QItemDelegate is used to synchronize the model with the widgets.

Let us assume that we have an item model named model with the following contents:

1Qt NorwayOslo
2Qt AustraliaBrisbane
3Qt USAPalo Alto
4Qt ChinaBeijing
5Qt GermanyBerlin

The following code will map the columns of the model to widgets called mySpinBox, myLineEdit and myCountryChooser:

QDataWidgetMapper *mapper = new QDataWidgetMapper; mapper->setModel(model); mapper->addMapping(mySpinBox, 0); mapper->addMapping(myLineEdit, 1); mapper->addMapping(myCountryChooser, 2); mapper->toFirst();

After the call to toFirst(), mySpinBox displays the value 1, myLineEdit displays Qt Norway and myCountryChooser displays Oslo. The navigational functions toFirst(), toNext(), toPrevious(), toLast() and setCurrentIndex() can be used to navigate in the model and update the widgets with contents from the model.

The setRootIndex() 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.

QDataWidgetMapper supports two submit policies, AutoSubmit and ManualSubmit. AutoSubmit will update the model as soon as the current widget loses focus, ManualSubmit will not update the model unless submit() is called. ManualSubmit 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.

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.

Methods

impl QDataWidgetMapper[src]

pub fn slot_revert(&self) -> Receiver<()>[src]

Repopulates all widgets with the current data of the model. All unsubmitted changes will be lost.

Returns a built-in Qt slot QDataWidgetMapper::revert that can be passed to qt_core::Signal::connect.

C++ documentation:

Repopulates all widgets with the current data of the model. All unsubmitted changes will be lost.

See also submit() and setSubmitPolicy().

pub fn slot_submit(&self) -> Receiver<()>[src]

Submits all changes from the mapped widgets to the model.

Returns a built-in Qt slot QDataWidgetMapper::submit that can be passed to qt_core::Signal::connect.

C++ documentation:

Submits all changes from the mapped widgets to the model.

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.

Returns true if all the values were submitted, otherwise false.

Note: For database models, QSqlQueryModel::lastError() can be used to retrieve the last error.

See also revert() and setSubmitPolicy().

pub fn slot_to_first(&self) -> Receiver<()>[src]

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.

Returns a built-in Qt slot QDataWidgetMapper::toFirst that can be passed to qt_core::Signal::connect.

C++ documentation:

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.

This is equivalent to calling setCurrentIndex(0).

See also toLast() and setCurrentIndex().

pub fn slot_to_last(&self) -> Receiver<()>[src]

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.

Returns a built-in Qt slot QDataWidgetMapper::toLast that can be passed to qt_core::Signal::connect.

C++ documentation:

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.

Calls setCurrentIndex() internally.

See also toFirst() and setCurrentIndex().

pub fn slot_to_next(&self) -> Receiver<()>[src]

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.

Returns a built-in Qt slot QDataWidgetMapper::toNext that can be passed to qt_core::Signal::connect.

C++ documentation:

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.

Calls setCurrentIndex() internally. Does nothing if there is no next row in the model.

See also toPrevious() and setCurrentIndex().

pub fn slot_to_previous(&self) -> Receiver<()>[src]

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.

Returns a built-in Qt slot QDataWidgetMapper::toPrevious that can be passed to qt_core::Signal::connect.

C++ documentation:

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.

Calls setCurrentIndex() internally. Does nothing if there is no previous row in the model.

See also toNext() and setCurrentIndex().

pub fn slot_set_current_index(&self) -> Receiver<(c_int,)>[src]

This property holds the current row or column

Returns a built-in Qt slot QDataWidgetMapper::setCurrentIndex that can be passed to qt_core::Signal::connect.

C++ documentation:

This property holds the current row or column

The widgets are populated with with data from the row at index if the orientation is horizontal (the default), otherwise with data from the column at index.

Access functions:

int currentIndex() const
virtual void setCurrentIndex(int index)

Notifier signal:

void currentIndexChanged(int index)

See also setCurrentModelIndex(), toFirst(), toNext(), toPrevious(), and toLast().

pub fn slot_set_current_model_index(&self) -> Receiver<(*const QModelIndex,)>[src]

Sets the current index to the row of the index if the orientation is horizontal (the default), otherwise to the column of the index.

Returns a built-in Qt slot QDataWidgetMapper::setCurrentModelIndex that can be passed to qt_core::Signal::connect.

C++ documentation:

Sets the current index to the row of the index if the orientation is horizontal (the default), otherwise to the column of the index.

Calls setCurrentIndex() internally. This convenience slot can be connected to the signal currentRowChanged() or currentColumnChanged() of another view's selection model.

The following example illustrates how to update all widgets with new data whenever the selection of a QTableView named myTableView changes:

QDataWidgetMapper *mapper = new QDataWidgetMapper(); connect(myTableView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), mapper, SLOT(setCurrentModelIndex(QModelIndex)));

See also currentIndex().

pub fn current_index_changed(&self) -> Signal<(c_int,)>[src]

This signal is emitted after the current index has changed and all widgets were populated with new data. index is the new current index.

Returns a built-in Qt signal QDataWidgetMapper::currentIndexChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted after the current index has changed and all widgets were populated with new data. index is the new current index.

Note: Notifier signal for property currentIndex.

See also currentIndex() and setCurrentIndex().

pub unsafe fn add_mapping_2a(
    &self,
    widget: impl CastInto<Ptr<QWidget>>,
    section: c_int
)
[src]

Adds a mapping between a widget and a section from the model. The section is a column in the model if the orientation is horizontal (the default), otherwise a row.

Calls C++ function: void QDataWidgetMapper::addMapping(QWidget* widget, int section).

C++ documentation:

Adds a mapping between a widget and a section from the model. The section is a column in the model if the orientation is horizontal (the default), otherwise a row.

For the following example, we assume a model myModel 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 QLineEdit nameLineEdit, and the second is mapped to the QSpinBox ageSpinBox:

QDataWidgetMapper *mapper = new QDataWidgetMapper(); mapper->setModel(myModel); mapper->addMapping(nameLineEdit, 0); mapper->addMapping(ageSpinBox, 1);

Notes:

  • If the widget is already mapped to a section, the old mapping will be replaced by the new one.
  • 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.

See also removeMapping(), mappedSection(), and clearMapping().

pub unsafe fn add_mapping_3a(
    &self,
    widget: impl CastInto<Ptr<QWidget>>,
    section: c_int,
    property_name: impl CastInto<Ref<QByteArray>>
)
[src]

Essentially the same as addMapping(), but adds the possibility to specify the property to use specifying propertyName.

Calls C++ function: void QDataWidgetMapper::addMapping(QWidget* widget, int section, const QByteArray& propertyName).

C++ documentation:

Essentially the same as addMapping(), but adds the possibility to specify the property to use specifying propertyName.

This function was introduced in Qt 4.3.

See also addMapping().

pub unsafe fn clear_mapping(&self)[src]

Clears all mappings.

Calls C++ function: void QDataWidgetMapper::clearMapping().

C++ documentation:

Clears all mappings.

See also addMapping() and removeMapping().

pub unsafe fn current_index(&self) -> c_int[src]

This property holds the current row or column

Calls C++ function: int QDataWidgetMapper::currentIndex() const.

C++ documentation:

This property holds the current row or column

The widgets are populated with with data from the row at index if the orientation is horizontal (the default), otherwise with data from the column at index.

Access functions:

int currentIndex() const
virtual void setCurrentIndex(int index)

Notifier signal:

void currentIndexChanged(int index)

See also setCurrentModelIndex(), toFirst(), toNext(), toPrevious(), and toLast().

pub unsafe fn item_delegate(&self) -> QPtr<QAbstractItemDelegate>[src]

Returns the current item delegate.

Calls C++ function: QAbstractItemDelegate* QDataWidgetMapper::itemDelegate() const.

C++ documentation:

Returns the current item delegate.

See also setItemDelegate().

pub unsafe fn mapped_property_name(
    &self,
    widget: impl CastInto<Ptr<QWidget>>
) -> CppBox<QByteArray>
[src]

Returns the name of the property that is used when mapping data to the given widget.

Calls C++ function: QByteArray QDataWidgetMapper::mappedPropertyName(QWidget* widget) const.

C++ documentation:

Returns the name of the property that is used when mapping data to the given widget.

This function was introduced in Qt 4.3.

See also mappedSection(), addMapping(), and removeMapping().

pub unsafe fn mapped_section(
    &self,
    widget: impl CastInto<Ptr<QWidget>>
) -> c_int
[src]

Returns the section the widget is mapped to or -1 if the widget is not mapped.

Calls C++ function: int QDataWidgetMapper::mappedSection(QWidget* widget) const.

C++ documentation:

Returns the section the widget is mapped to or -1 if the widget is not mapped.

See also addMapping() and removeMapping().

pub unsafe fn mapped_widget_at(&self, section: c_int) -> QPtr<QWidget>[src]

Returns the widget that is mapped at section, or 0 if no widget is mapped at that section.

Calls C++ function: QWidget* QDataWidgetMapper::mappedWidgetAt(int section) const.

C++ documentation:

Returns the widget that is mapped at section, or 0 if no widget is mapped at that section.

See also addMapping() and removeMapping().

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QDataWidgetMapper::metaObject() const.

pub unsafe fn model(&self) -> QPtr<QAbstractItemModel>[src]

Returns the current model.

Calls C++ function: QAbstractItemModel* QDataWidgetMapper::model() const.

C++ documentation:

Returns the current model.

See also setModel().

pub unsafe fn new_1a(
    parent: impl CastInto<Ptr<QObject>>
) -> QBox<QDataWidgetMapper>
[src]

Constructs a new QDataWidgetMapper with parent object parent. By default, the orientation is horizontal and the submit policy is AutoSubmit.

Calls C++ function: [constructor] void QDataWidgetMapper::QDataWidgetMapper(QObject* parent = …).

C++ documentation:

Constructs a new QDataWidgetMapper with parent object parent. By default, the orientation is horizontal and the submit policy is AutoSubmit.

See also setOrientation() and setSubmitPolicy().

pub unsafe fn new_0a() -> QBox<QDataWidgetMapper>[src]

The QDataWidgetMapper class provides mapping between a section of a data model to widgets.

Calls C++ function: [constructor] void QDataWidgetMapper::QDataWidgetMapper().

C++ documentation:

The QDataWidgetMapper class provides mapping between a section of a data model to widgets.

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.

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 is used to transfer data between the model and the widget. Since Qt 4.3, an additional addMapping() function enables a named property to be used instead of the default user property.

It is possible to set an item delegate to support custom widgets. By default, a QItemDelegate is used to synchronize the model with the widgets.

Let us assume that we have an item model named model with the following contents:

1Qt NorwayOslo
2Qt AustraliaBrisbane
3Qt USAPalo Alto
4Qt ChinaBeijing
5Qt GermanyBerlin

The following code will map the columns of the model to widgets called mySpinBox, myLineEdit and myCountryChooser:

QDataWidgetMapper *mapper = new QDataWidgetMapper; mapper->setModel(model); mapper->addMapping(mySpinBox, 0); mapper->addMapping(myLineEdit, 1); mapper->addMapping(myCountryChooser, 2); mapper->toFirst();

After the call to toFirst(), mySpinBox displays the value 1, myLineEdit displays Qt Norway and myCountryChooser displays Oslo. The navigational functions toFirst(), toNext(), toPrevious(), toLast() and setCurrentIndex() can be used to navigate in the model and update the widgets with contents from the model.

The setRootIndex() 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.

QDataWidgetMapper supports two submit policies, AutoSubmit and ManualSubmit. AutoSubmit will update the model as soon as the current widget loses focus, ManualSubmit will not update the model unless submit() is called. ManualSubmit 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.

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.

pub unsafe fn orientation(&self) -> Orientation[src]

This property holds the orientation of the model

Calls C++ function: Qt::Orientation QDataWidgetMapper::orientation() const.

C++ documentation:

This property holds the orientation of the model

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 currentIndex() points at.

Use Qt::Horizontal for tabular data that looks like this:

1Qt NorwayOslo
2Qt AustraliaBrisbane
3Qt USASilicon Valley
4Qt ChinaBeijing
5Qt GermanyBerlin

If the orientation is set to Qt::Vertical, a widget is mapped to a row. Calling setCurrentIndex() will change the current column. The widget will be populates with the model's data from its mapped row and the column that currentIndex() points at.

Use Qt::Vertical for tabular data that looks like this:

12345
Qt NorwayQt AustraliaQt USAQt ChinaQt Germany
OsloBrisbaneSilicon ValleyBeijingBerlin

Changing the orientation clears all existing mappings.

Access functions:

Qt::Orientation orientation() const
void setOrientation(Qt::Orientation aOrientation)

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QDataWidgetMapper::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QDataWidgetMapper::qt_metacast(const char* arg1).

pub unsafe fn remove_mapping(&self, widget: impl CastInto<Ptr<QWidget>>)[src]

Removes the mapping for the given widget.

Calls C++ function: void QDataWidgetMapper::removeMapping(QWidget* widget).

C++ documentation:

Removes the mapping for the given widget.

See also addMapping() and clearMapping().

pub unsafe fn revert(&self)[src]

Repopulates all widgets with the current data of the model. All unsubmitted changes will be lost.

Calls C++ function: [slot] void QDataWidgetMapper::revert().

C++ documentation:

Repopulates all widgets with the current data of the model. All unsubmitted changes will be lost.

See also submit() and setSubmitPolicy().

pub unsafe fn root_index(&self) -> CppBox<QModelIndex>[src]

Returns the current root index.

Calls C++ function: QModelIndex QDataWidgetMapper::rootIndex() const.

C++ documentation:

Returns the current root index.

See also setRootIndex().

pub unsafe fn set_current_index(&self, index: c_int)[src]

This property holds the current row or column

Calls C++ function: virtual [slot] void QDataWidgetMapper::setCurrentIndex(int index).

C++ documentation:

This property holds the current row or column

The widgets are populated with with data from the row at index if the orientation is horizontal (the default), otherwise with data from the column at index.

Access functions:

int currentIndex() const
virtual void setCurrentIndex(int index)

Notifier signal:

void currentIndexChanged(int index)

See also setCurrentModelIndex(), toFirst(), toNext(), toPrevious(), and toLast().

pub unsafe fn set_current_model_index(
    &self,
    index: impl CastInto<Ref<QModelIndex>>
)
[src]

Sets the current index to the row of the index if the orientation is horizontal (the default), otherwise to the column of the index.

Calls C++ function: [slot] void QDataWidgetMapper::setCurrentModelIndex(const QModelIndex& index).

C++ documentation:

Sets the current index to the row of the index if the orientation is horizontal (the default), otherwise to the column of the index.

Calls setCurrentIndex() internally. This convenience slot can be connected to the signal currentRowChanged() or currentColumnChanged() of another view's selection model.

The following example illustrates how to update all widgets with new data whenever the selection of a QTableView named myTableView changes:

QDataWidgetMapper *mapper = new QDataWidgetMapper(); connect(myTableView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), mapper, SLOT(setCurrentModelIndex(QModelIndex)));

See also currentIndex().

pub unsafe fn set_item_delegate(
    &self,
    delegate: impl CastInto<Ptr<QAbstractItemDelegate>>
)
[src]

Sets the item delegate to delegate. 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().

Calls C++ function: void QDataWidgetMapper::setItemDelegate(QAbstractItemDelegate* delegate).

C++ documentation:

Sets the item delegate to delegate. 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().

The delegate also decides when to apply data and when to change the editor, using QAbstractItemDelegate::commitData() and QAbstractItemDelegate::closeEditor().

Warning: 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.

See also itemDelegate().

pub unsafe fn set_model(&self, model: impl CastInto<Ptr<QAbstractItemModel>>)[src]

Sets the current model to model. If another model was set, all mappings to that old model are cleared.

Calls C++ function: void QDataWidgetMapper::setModel(QAbstractItemModel* model).

C++ documentation:

Sets the current model to model. If another model was set, all mappings to that old model are cleared.

See also model().

pub unsafe fn set_orientation(&self, a_orientation: Orientation)[src]

This property holds the orientation of the model

Calls C++ function: void QDataWidgetMapper::setOrientation(Qt::Orientation aOrientation).

C++ documentation:

This property holds the orientation of the model

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 currentIndex() points at.

Use Qt::Horizontal for tabular data that looks like this:

1Qt NorwayOslo
2Qt AustraliaBrisbane
3Qt USASilicon Valley
4Qt ChinaBeijing
5Qt GermanyBerlin

If the orientation is set to Qt::Vertical, a widget is mapped to a row. Calling setCurrentIndex() will change the current column. The widget will be populates with the model's data from its mapped row and the column that currentIndex() points at.

Use Qt::Vertical for tabular data that looks like this:

12345
Qt NorwayQt AustraliaQt USAQt ChinaQt Germany
OsloBrisbaneSilicon ValleyBeijingBerlin

Changing the orientation clears all existing mappings.

Access functions:

Qt::Orientation orientation() const
void setOrientation(Qt::Orientation aOrientation)

pub unsafe fn set_root_index(&self, index: impl CastInto<Ref<QModelIndex>>)[src]

Sets the root item to index. This can be used to display a branch of a tree. Pass an invalid model index to display the top-most branch.

Calls C++ function: void QDataWidgetMapper::setRootIndex(const QModelIndex& index).

C++ documentation:

Sets the root item to index. This can be used to display a branch of a tree. Pass an invalid model index to display the top-most branch.

See also rootIndex().

pub unsafe fn set_submit_policy(&self, policy: SubmitPolicy)[src]

This property holds the current submit policy

Calls C++ function: void QDataWidgetMapper::setSubmitPolicy(QDataWidgetMapper::SubmitPolicy policy).

C++ documentation:

This property holds the current submit policy

Changing the current submit policy will revert all widgets to the current data from the model.

Access functions:

SubmitPolicy submitPolicy() const
void setSubmitPolicy(SubmitPolicy policy)

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn submit(&self) -> bool[src]

Submits all changes from the mapped widgets to the model.

Calls C++ function: [slot] bool QDataWidgetMapper::submit().

C++ documentation:

Submits all changes from the mapped widgets to the model.

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.

Returns true if all the values were submitted, otherwise false.

Note: For database models, QSqlQueryModel::lastError() can be used to retrieve the last error.

See also revert() and setSubmitPolicy().

pub unsafe fn submit_policy(&self) -> SubmitPolicy[src]

This property holds the current submit policy

Calls C++ function: QDataWidgetMapper::SubmitPolicy QDataWidgetMapper::submitPolicy() const.

C++ documentation:

This property holds the current submit policy

Changing the current submit policy will revert all widgets to the current data from the model.

Access functions:

SubmitPolicy submitPolicy() const
void setSubmitPolicy(SubmitPolicy policy)

pub unsafe fn to_first(&self)[src]

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.

Calls C++ function: [slot] void QDataWidgetMapper::toFirst().

C++ documentation:

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.

This is equivalent to calling setCurrentIndex(0).

See also toLast() and setCurrentIndex().

pub unsafe fn to_last(&self)[src]

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.

Calls C++ function: [slot] void QDataWidgetMapper::toLast().

C++ documentation:

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.

Calls setCurrentIndex() internally.

See also toFirst() and setCurrentIndex().

pub unsafe fn to_next(&self)[src]

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.

Calls C++ function: [slot] void QDataWidgetMapper::toNext().

C++ documentation:

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.

Calls setCurrentIndex() internally. Does nothing if there is no next row in the model.

See also toPrevious() and setCurrentIndex().

pub unsafe fn to_previous(&self)[src]

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.

Calls C++ function: [slot] void QDataWidgetMapper::toPrevious().

C++ documentation:

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.

Calls setCurrentIndex() internally. Does nothing if there is no previous row in the model.

See also toNext() and setCurrentIndex().

pub unsafe fn tr(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QDataWidgetMapper::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QDataWidgetMapper::trUtf8(const char* s, const char* c, int n).

Trait Implementations

impl CppDeletable for QDataWidgetMapper[src]

unsafe fn delete(&self)[src]

Destroys the object.

Calls C++ function: virtual [destructor] void QDataWidgetMapper::~QDataWidgetMapper().

C++ documentation:

Destroys the object.

impl Deref for QDataWidgetMapper[src]

type Target = QObject

The resulting type after dereferencing.

fn deref(&self) -> &QObject[src]

Calls C++ function: QObject* static_cast<QObject*>(QDataWidgetMapper* ptr).

impl DynamicCast<QDataWidgetMapper> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QDataWidgetMapper>[src]

Calls C++ function: QDataWidgetMapper* dynamic_cast<QDataWidgetMapper*>(QObject* ptr).

impl StaticDowncast<QDataWidgetMapper> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QDataWidgetMapper>[src]

Calls C++ function: QDataWidgetMapper* static_cast<QDataWidgetMapper*>(QObject* ptr).

impl StaticUpcast<QObject> for QDataWidgetMapper[src]

unsafe fn static_upcast(ptr: Ptr<QDataWidgetMapper>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QDataWidgetMapper* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.