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 <antkudr@mail.ru>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Edward Welbourne 2018-12-04 18:42:54 +01:00
parent 826b09f0c5
commit d43ac840e5

View File

@ -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);
}
}