From 443f06a2ec1b1ba7da3d64151c6e92a3c77deadf Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 19 Jun 2014 12:27:09 -0700 Subject: Remove the use of QT_STATIC_CONST in QtSql There doesn't seem to be any reason why the macro is actually necessary. My guess is that someone wrote the code on Windows without "const", then it failed to compile everywhere else. Instead of fixing the code by adding the "const", the developer must have added this macro. Microsoft Visual Studio mangles the constness of the variable, so we can't remove it now from existing compilers. But we can for the new version. This is also required to compile QtSql with the MSVC option /Zc:strictStrings, which is enabled in Qt 5.4. Change-Id: Ibf2c2cb7287a4332d69aa81080a37aab4327677d Reviewed-by: Olivier Goffart Reviewed-by: Friedemann Kleint Reviewed-by: Mark Brand --- src/sql/kernel/qsqldatabase.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/sql/kernel/qsqldatabase.h') diff --git a/src/sql/kernel/qsqldatabase.h b/src/sql/kernel/qsqldatabase.h index 7249e223a53..ffc10cdd303 100644 --- a/src/sql/kernel/qsqldatabase.h +++ b/src/sql/kernel/qsqldatabase.h @@ -113,7 +113,12 @@ public: QSqlDriver* driver() const; - QT_STATIC_CONST char *defaultConnection; + static +#if !defined(Q_CC_MSVC) || _MSC_VER >= 1900 + // ### Qt6: remove the #ifdef + const +#endif + char *defaultConnection; static QSqlDatabase addDatabase(const QString& type, const QString& connectionName = QLatin1String(defaultConnection)); -- cgit v1.2.3