diff options
Diffstat (limited to 'src/sql/models/qsqlrelationaltablemodel.cpp')
-rw-r--r-- | src/sql/models/qsqlrelationaltablemodel.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sql/models/qsqlrelationaltablemodel.cpp b/src/sql/models/qsqlrelationaltablemodel.cpp index aebecf1..5f0a35d 100644 --- a/src/sql/models/qsqlrelationaltablemodel.cpp +++ b/src/sql/models/qsqlrelationaltablemodel.cpp @@ -569,7 +569,8 @@ QString QSqlRelationalTableModel::selectStatement() const QString displayColumn = relation.displayColumn(); if (d->db.driver()->isIdentifierEscaped(displayColumn, QSqlDriver::FieldName)) displayColumn = d->db.driver()->stripDelimiters(displayColumn, QSqlDriver::FieldName); - fList.append(QString::fromLatin1(" AS %1_%2").arg(relTableName).arg(displayColumn)); + fList.append(QString::fromLatin1(" AS %1_%2_%3").arg(relTableName).arg(displayColumn).arg(fieldNames.value(fieldList[i]))); + fieldNames.insert(fieldList[i], fieldNames.value(fieldList[i])-1); } // this needs fixing!! the below if is borken. |