From 5ca03eddd372c00714d11211caae4c7b7959cfd4 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Sat, 13 Oct 2012 22:21:00 +0200 Subject: [PATCH] QSqlRelationalDelegate: remove setEditorData reimplementation Since commit 84787d82ee9369b2a83c5b0568ee62ab602a5528 QItemDelegate::setEditorData() works out of the box on QComboBox. Change-Id: Ic9839f7eccccbdb787ce204fe98311335ee16b92 Reviewed-by: Stephen Kelly --- src/sql/models/qsqlrelationaldelegate.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/sql/models/qsqlrelationaldelegate.h b/src/sql/models/qsqlrelationaldelegate.h index 439dde2..52a19db 100644 --- a/src/sql/models/qsqlrelationaldelegate.h +++ b/src/sql/models/qsqlrelationaldelegate.h @@ -82,17 +82,6 @@ QWidget *createEditor(QWidget *aParent, return combo; } -void setEditorData(QWidget *editor, const QModelIndex &index) const -{ - const QSqlRelationalTableModel *sqlModel = qobject_cast(index.model()); - QComboBox *combo = qobject_cast(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()) -- 2.7.4