From d43ac840e5d5a0a2df9e8adce276c956c98be6aa Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 4 Dec 2018 18:42:54 +0100 Subject: Specify the date-time spec when setting max time QDateTimeEdit::setMaximumTime() constructed a QDateTime from the given time and its current max date without propagating its existing spec; it thus got a local time. All other QDateTimeEdit methods setting bounds do propagate the spec. So bring setMaximumTime() in line with the others. Fixes: QTBUG-71311 Change-Id: Ic97d22185f76bed46bc8d2884b131942874d9a0a Reviewed-by: Anton Kudryavtsev Reviewed-by: Konstantin Shegunov Reviewed-by: Thiago Macieira --- src/widgets/widgets/qdatetimeedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index 68bfd175ff..c66400f423 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -553,7 +553,7 @@ void QDateTimeEdit::setMaximumTime(const QTime &max) { Q_D(QDateTimeEdit); if (max.isValid()) { - const QDateTime m(d->maximum.toDate(), max); + const QDateTime m(d->maximum.toDate(), max, d->spec); setMaximumDateTime(m); } } -- cgit v1.2.3