Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.3
-
None
-
found on linux qt 4.7.3
-
978ccece892431998af08e880b1454849af9e9c9
Description
QSqlRelationalTableModel doesn't follow relations on the first column of a table. The DisplayRole and the EditRole for indexes on column 0 are always the same.
in
QVariant QSqlRelationalTableModel::data(const QModelIndex &index, int role) const { Q_D(const QSqlRelationalTableModel); if (role == Qt::DisplayRole && index.column() > 0 && index.column() < d->relations.count() && d->relations.value(index.column()).isValid()) { //do work } return QSqlTableModel::data(index, role); }
the test should be
if (role == Qt::DisplayRole && index.column() >= 0 && index.column() < d->relations.count() &&
d->relations.value(index.column()).isValid())