diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2019-04-11 12:02:17 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-01-30 19:56:21 +0100 |
commit | 037369cc4d85c49e351c3df6544a398b61195656 (patch) | |
tree | 72679f5a745c6b057290f313545d7b279f62a96d /src/corelib/kernel | |
parent | 6a1df2d2060bfa346398f6125f33a4ff1b190a64 (diff) |
Deprecate QDateTime(const QDate &) in favor of QDate::startOfDay()
It needed re-implemented in terms of the new API (in case QTime(0, 0)
was skipped, on the date in question, by a spring-forwrd), which makes
it redundant (and supports choice of spec and zone or offset, which it
did not).
Change-Id: I1e3c3e794632c234f254be754ed6e4ebdaaaa6bc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index b417683d2a..3be9a02248 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Copyright (C) 2018 Intel Corporation. ** Copyright (C) 2015 Olivier Goffart <ogoffart@woboq.com> ** Contact: https://www.qt.io/licensing/ @@ -662,7 +662,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) # endif #endif case QMetaType::QDate: - *dt = QDateTime(*v_cast<QDate>(d)); + *dt = v_cast<QDate>(d)->startOfDay(); break; default: return false; @@ -1229,7 +1229,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) *static_cast<QCborValue *>(result) = *v_cast<QByteArray>(d); break; case QMetaType::QDate: - *static_cast<QCborValue *>(result) = QCborValue(QDateTime(*v_cast<QDate>(d))); + *static_cast<QCborValue *>(result) = QCborValue(v_cast<QDate>(d)->startOfDay()); break; case QMetaType::QDateTime: *static_cast<QCborValue *>(result) = QCborValue(*v_cast<QDateTime>(d)); |