Delegate used by the DataWidgetMapper in MappedBaseEditor. More...
#include <baseeditor.h>


Public Member Functions | |
| MapperDelegate (QObject *parent=0) | |
| void | setEditorData (QWidget *editor, const QModelIndex &index) const |
| void | setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const |
Delegate used by the DataWidgetMapper in MappedBaseEditor.
It's mainly used for testing purpose. Use of QSqlRelationalDelegate as base class is important because the model is based on QSqlRelationalTableModel.
| MapperDelegate::MapperDelegate | ( | QObject * | parent = 0 |
) |
: QSqlRelationalDelegate(parent) { }
| void MapperDelegate::setEditorData | ( | QWidget * | editor, | |
| const QModelIndex & | index | |||
| ) | const |
This function is called every time the widget needs to be set up.
{
//qDebug() << "DELEGATE SETTING EDITOR DATA: " << editor << index << index.data(Qt::EditRole);
QSqlRelationalDelegate::setEditorData(editor, index);
}
| void MapperDelegate::setModelData | ( | QWidget * | editor, | |
| QAbstractItemModel * | model, | |||
| const QModelIndex & | index | |||
| ) | const |
{
//qDebug() << "DELEGATE SETTING MODEL DATA: " << editor << model << index << index.data(Qt::EditRole);
QSqlRelationalDelegate::setModelData(editor, model, index);
}
1.7.1