summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qvariant.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-09-19 13:31:18 +0200
committerLiang Qi <liang.qi@qt.io>2018-09-24 17:12:29 +0000
commitb26cd68bf61346273a5a03bbc1e60a7cdffa4f0d (patch)
tree7580a1749931d86bfd67357d1be73355d6b7645e /src/corelib/kernel/qvariant.cpp
parente226b0f94afc85f79d82fc54421487bf2a529ba5 (diff)
Modernize the "datestring" feature
Change-Id: I2236a456fe3758d9054b22e36fe6316f3522d533 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/kernel/qvariant.cpp')
-rw-r--r--src/corelib/kernel/qvariant.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 6192b66487..57c25a9423 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -445,7 +445,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::Double:
*str = QString::number(d->data.d, 'g', QLocale::FloatingPointShortest);
break;
-#if !defined(QT_NO_DATESTRING)
+#if QT_CONFIG(datestring)
case QVariant::Date:
*str = v_cast<QDate>(d)->toString(Qt::ISODate);
break;
@@ -589,7 +589,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
QDate *dt = static_cast<QDate *>(result);
if (d->type == QVariant::DateTime)
*dt = v_cast<QDateTime>(d)->date();
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
else if (d->type == QVariant::String)
*dt = QDate::fromString(*v_cast<QString>(d), Qt::ISODate);
#endif
@@ -604,7 +604,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::DateTime:
*t = v_cast<QDateTime>(d)->time();
break;
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
case QVariant::String:
*t = QTime::fromString(*v_cast<QString>(d), Qt::ISODate);
break;
@@ -617,7 +617,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::DateTime: {
QDateTime *dt = static_cast<QDateTime *>(result);
switch (d->type) {
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
case QVariant::String:
*dt = QDateTime::fromString(*v_cast<QString>(d), Qt::ISODate);
break;