QSqlRelationalDelegate: remove setEditorData reimplementation
authorMark Brand <mabrand@mabrand.nl>
Sat, 13 Oct 2012 20:21:00 +0000 (22:21 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 26 Oct 2012 16:57:54 +0000 (18:57 +0200)
Since commit 84787d82ee9369b2a83c5b0568ee62ab602a5528
QItemDelegate::setEditorData() works out of the box
on QComboBox.

Change-Id: Ic9839f7eccccbdb787ce204fe98311335ee16b92
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
src/sql/models/qsqlrelationaldelegate.h

index 439dde2..52a19db 100644 (file)
@@ -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())