summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorHonglei Zhang <honglei.zhang@nokia.com>2011-12-01 09:57:40 +0200
committerQt by Nokia <qt-info@nokia.com>2011-12-02 15:59:58 +0100
commit8c74fe5c7a754a072349fe4cb88834e6efdd5593 (patch)
tree4d959a986fb903fe349ccd647ab74d0aafa3c62e /src/sql
parent35a9e53dea5599664bcb0b5777c8957849776839 (diff)
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 Change-Id: Ie1e98b5f46ffc171113f2d51b9b19ff5febb1c3c Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/models/qsqlrelationaltablemodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sql/models/qsqlrelationaltablemodel.cpp b/src/sql/models/qsqlrelationaltablemodel.cpp
index 5b0406f4b0..ad05e0f39b 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())