diff options
author | Honglei Zhang <honglei.zhang@nokia.com> | 2011-12-05 13:05:16 (GMT) |
---|---|---|
committer | Honglei Zhang <honglei.zhang@nokia.com> | 2011-12-05 13:05:16 (GMT) |
commit | 147ea1d18482c1f64749db52c622dded075dc66c (patch) | |
tree | 9215849b568fe96ccda75d72579a7aae85f1b082 /src/sql | |
parent | 1f6ec34d46bc36ff9396e5e865af81cecf310cc3 (diff) | |
download | Qt-147ea1d18482c1f64749db52c622dded075dc66c.zip Qt-147ea1d18482c1f64749db52c622dded075dc66c.tar.gz Qt-147ea1d18482c1f64749db52c622dded075dc66c.tar.bz2 |
QSqlRelationalTableModel doesn't follow relations on the first column
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. The bug is found in QSqlRelationalTableModel::data.
Task-number: QTBUG-20038
Reviewed-by: Charles Yin
Diffstat (limited to 'src/sql')
-rw-r--r-- | src/sql/models/qsqlrelationaltablemodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sql/models/qsqlrelationaltablemodel.cpp b/src/sql/models/qsqlrelationaltablemodel.cpp index 0edfaf4..c5764a7 100644 --- a/src/sql/models/qsqlrelationaltablemodel.cpp +++ b/src/sql/models/qsqlrelationaltablemodel.cpp @@ -430,7 +430,7 @@ QVariant QSqlRelationalTableModel::data(const QModelIndex &index, int role) cons { Q_D(const QSqlRelationalTableModel); - if (role == Qt::DisplayRole && index.column() > 0 && index.column() < d->relations.count() && + if (role == Qt::DisplayRole && index.column() >= 0 && index.column() < d->relations.count() && d->relations.value(index.column()).isValid()) { QRelation &relation = d->relations[index.column()]; if (!relation.isDictionaryInitialized()) |