diff options
author | Liang Qi <liang.qi@qt.io> | 2018-09-27 11:08:55 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-09-27 11:08:55 +0200 |
commit | d0fcaa7eaaae85ddbf0a78efa59b341380c101a4 (patch) | |
tree | 9b3422ae33ef9dfcda0af228c56c3d2eeed7b0c3 /src/plugins/sqldrivers/psql | |
parent | f6ce2d42b3cbe049ebcf1a2349a5cd4dde2c6d24 (diff) | |
parent | 5e64957ee4162ecf4456306a530a68761c2b127f (diff) |
Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
src/corelib/global/qconfig-bootstrapped.h
src/widgets/util/qcompleter.cpp
Change-Id: I4f44f0f074982530f2f2e750ce696230b2754cf3
Diffstat (limited to 'src/plugins/sqldrivers/psql')
-rw-r--r-- | src/plugins/sqldrivers/psql/qsql_psql.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp index 5796644d34..bf0493b0c3 100644 --- a/src/plugins/sqldrivers/psql/qsql_psql.cpp +++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp @@ -679,7 +679,7 @@ QVariant QPSQLResult::data(int i) if (val[0] == '\0') { return QVariant(QDate()); } else { -#ifndef QT_NO_DATESTRING +#if QT_CONFIG(datestring) return QVariant(QDate::fromString(QString::fromLatin1(val), Qt::ISODate)); #else return QVariant(QString::fromLatin1(val)); @@ -687,7 +687,7 @@ QVariant QPSQLResult::data(int i) } case QVariant::Time: { const QString str = QString::fromLatin1(val); -#ifndef QT_NO_DATESTRING +#if QT_CONFIG(datestring) if (str.isEmpty()) return QVariant(QTime()); else @@ -698,7 +698,7 @@ QVariant QPSQLResult::data(int i) } case QVariant::DateTime: { QString dtval = QString::fromLatin1(val); -#ifndef QT_NO_DATESTRING +#if QT_CONFIG(datestring) if (dtval.length() < 10) { return QVariant(QDateTime()); } else { @@ -1500,7 +1500,7 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const } else { switch (int(field.type())) { case QVariant::DateTime: -#ifndef QT_NO_DATESTRING +#if QT_CONFIG(datestring) if (field.value().toDateTime().isValid()) { // we force the value to be considered with a timezone information, and we force it to be UTC // this is safe since postgresql stores only the UTC value and not the timezone offset (only used @@ -1513,10 +1513,10 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const } #else r = QLatin1String("NULL"); -#endif // QT_NO_DATESTRING +#endif // datestring break; case QVariant::Time: -#ifndef QT_NO_DATESTRING +#if QT_CONFIG(datestring) if (field.value().toTime().isValid()) { r = QLatin1Char('\'') + field.value().toTime().toString(QLatin1String("hh:mm:ss.zzz")) + QLatin1Char('\''); } else |