summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel/qsqlerror.h
diff options
context:
space:
mode:
authorMarcel Krems <m.krems@software-vision.eu>2013-12-16 23:26:44 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-20 16:27:41 +0100
commit106316198d78e97ceaf3bd62203518bd85a45fda (patch)
tree3c6b5ef3b3a6c45ce203fede89c3cac82ff257be /src/sql/kernel/qsqlerror.h
parente35c2c57cffd9e69ba69193e5cf345fba3447fee (diff)
Enable QSqlError to handle alphanumeric error codes.
Some database systems (like PostgreSQL) use alphanumeric error codes. Introduce a new method nativeErrorCode() which replaces number(). If the error code cannot be converted to int, number() will return 0. Task-number: QTBUG-142 Change-Id: Ic7fba841737674b75c0c01c2263f51d2041da497 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Diffstat (limited to 'src/sql/kernel/qsqlerror.h')
-rw-r--r--src/sql/kernel/qsqlerror.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sql/kernel/qsqlerror.h b/src/sql/kernel/qsqlerror.h
index 0efe0e07b0..c2afe7c819 100644
--- a/src/sql/kernel/qsqlerror.h
+++ b/src/sql/kernel/qsqlerror.h
@@ -59,10 +59,16 @@ public:
TransactionError,
UnknownError
};
+#if QT_DEPRECATED_SINCE(5, 3)
QSqlError( const QString& driverText = QString(),
const QString& databaseText = QString(),
ErrorType type = NoError,
int number = -1);
+#endif
+ QSqlError(const QString &driverText,
+ const QString &databaseText,
+ ErrorType type,
+ const QString &errorCode);
QSqlError(const QSqlError& other);
QSqlError& operator=(const QSqlError& other);
bool operator==(const QSqlError& other) const;
@@ -72,7 +78,10 @@ public:
QString driverText() const;
QString databaseText() const;
ErrorType type() const;
+#if QT_DEPRECATED_SINCE(5, 3)
int number() const;
+#endif
+ QString nativeErrorCode() const;
QString text() const;
bool isValid() const;