QSqlRelationalDelegate: remove setEditorData reimplementation
Since commit 84787d82ee
QItemDelegate::setEditorData() works out of the box
on QComboBox.
Change-Id: Ic9839f7eccccbdb787ce204fe98311335ee16b92
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
bb10
parent
bb8c83986f
commit
5ca03eddd3
|
|
@ -82,17 +82,6 @@ QWidget *createEditor(QWidget *aParent,
|
|||
return combo;
|
||||
}
|
||||
|
||||
void setEditorData(QWidget *editor, const QModelIndex &index) const
|
||||
{
|
||||
const QSqlRelationalTableModel *sqlModel = qobject_cast<const QSqlRelationalTableModel *>(index.model());
|
||||
QComboBox *combo = qobject_cast<QComboBox *>(editor);
|
||||
if (!sqlModel || !combo) {
|
||||
QItemDelegate::setEditorData(editor, index);
|
||||
return;
|
||||
}
|
||||
combo->setCurrentIndex(combo->findText(sqlModel->data(index).toString()));
|
||||
}
|
||||
|
||||
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
|
|
|
|||
Loading…
Reference in New Issue