Skip to content

Conversation

@Schachigel
Copy link

QDateEdit, derived from QDateTimeEdit, must not use the dateTime property, because it defaults to UTC time zone. The convertion back to localtime (e.g. in the setField / field mechanism of a QWizard / QWizardPage can make the date change, if the time is 00:00 or close to it. As a consequence in

setField( fieldname, QDateTime( aDate, aTime));
auto d =field(fieldname);
the day of d might be different form the day in aDate.

see also qdatetimeedit.cpp line 190 and 1705 (QDateEdit uses UTC) (construction of QDateTimeEdit (using localtime) and QDateTime (using UTC) and
https://forum.qt.io/topic/163954/setfield-or-qdateedit-modify-my-data/6
as a closer analysis

QDateEdit, derived from QDateTimeEdit, must not use the dateTime property, because it defaults to UTC time zone. The convertion back to localtime in the setField / field mechanism can make the date change, if the time is 00:00 or close to it.
@cla-assistant
Copy link

cla-assistant bot commented Dec 22, 2025

CLA assistant check
All committers have signed the CLA.

@cla-assistant
Copy link

cla-assistant bot commented Dec 22, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant