QtSql/qsqlrelationaldelegate.h Source File
Go to the documentation of this file.
42 #ifndef QSQLRELATIONALDELEGATE_H
43 #define QSQLRELATIONALDELEGATE_H
62 explicit QSqlRelationalDelegate(
QObject *aParent = 0)
63 : QItemDelegate(aParent)
66 ~QSqlRelationalDelegate()
90 if (!sqlModel || !combo) {
94 combo->setCurrentIndex(combo->findText(sqlModel->
data(index).
toString()));
105 if (!sqlModel || !childModel || !combo) {
111 int childColIndex = childModel->fieldIndex(sqlModel->
relation(index.
column()).displayColumn());
112 int childEditIndex = childModel->fieldIndex(sqlModel->
relation(index.
column()).indexColumn());
117 childModel->
data(childModel->index(currentItem, childEditIndex),
Qt::EditRole),
129 #endif // QSQLRELATIONALDELEGATE_H
T qobject_cast(QObject *object)
QSqlRelation relation(int column) const
virtual QSqlTableModel * relationModel(int column) const
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
void setModelColumn(int visibleColumn)
void installEventFilter(QObject *)
bool setData(const QModelIndex &item, const QVariant &value, int role=Qt::EditRole)
QVariant data(const QModelIndex &item, int role=Qt::DisplayRole) const
QVariant data(int role=Qt::DisplayRole) const
#define QT_BEGIN_NAMESPACE
const QAbstractItemModel * model() const
void setEditorData(QWidget *editor, const QModelIndex &index) const
void setModel(QAbstractItemModel *model)