diff options
author | Andy Shaw <andy.shaw@qt.io> | 2017-05-19 15:31:46 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2017-07-12 09:01:50 +0000 |
commit | 0843c6ca7fe604d8c44b9a81b8fcb072ab424172 (patch) | |
tree | e6784759b9dd8729d5bd179a38552170e084a723 /src/sql/kernel/qsqlfield.h | |
parent | 9423be1f190bd7cdeb04add39f4ec621a33a3041 (diff) |
QSqlField: Add a means to see what the tablename is for a given field
When you are using a query that pulls from a number of different tables
then it can be ambiguous as to which table a particular field belongs to.
So this will make it possible to determine the table that a given field
belongs to if it is set.
Task-number: QTBUG-7170
Change-Id: I49b7890c0523d81272a153df3860df800ff853d5
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/sql/kernel/qsqlfield.h')
-rw-r--r-- | src/sql/kernel/qsqlfield.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sql/kernel/qsqlfield.h b/src/sql/kernel/qsqlfield.h index 0d8c51f801..30474735f4 100644 --- a/src/sql/kernel/qsqlfield.h +++ b/src/sql/kernel/qsqlfield.h @@ -55,7 +55,8 @@ public: enum RequiredStatus { Unknown = -1, Optional = 0, Required = 1 }; explicit QSqlField(const QString& fieldName = QString(), - QVariant::Type type = QVariant::Invalid); + QVariant::Type type = QVariant::Invalid, + const QString &tableName = QString()); QSqlField(const QSqlField& other); QSqlField& operator=(const QSqlField& other); @@ -68,6 +69,8 @@ public: { return val; } void setName(const QString& name); QString name() const; + void setTableName(const QString &tableName); + QString tableName() const; bool isNull() const; void setReadOnly(bool readOnly); bool isReadOnly() const; |