summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2025-08-06 10:59:38 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2025-09-07 14:26:22 +0200
commit76afe79daaa4b821494339656538e24d06887d4b (patch)
tree8f6af97c55579dc52cf9571345cbe381f7841f77 /src/corelib/kernel/qobject.cpp
parentaf0319ceb6c8ed8be501f27f8faf105b0b88cf50 (diff)
Suppress construction of QTimeZone(Qt::TimeSpec)
Users can mistakenly expect this to work, but it actually cast the enum to int and called QTimeZone(int offsetSeconds) instead, with unhappy results. Tested by confirming gcc rejects QTimeZone broken(Qt::UTC); when transiently added to a test. Also added a static_assert that such construction does not work. This should save users in future from similar mishaps. Picking back to LTS even though it may break compilation of some code that currently compiles, because those maintaining that code need to be alerted to the fact that they're not getting what they (thought they'd) asked for. [ChangeLog][QtCore][QTimeZone] Construction from a Qt::TimeSpec, which was never meant to be supported, is now rejected at compile time, where previously compilers (mis)interpreted the enum as an int so called the (int offsetSeconds) constructor, with results consistently at odds with what the user presumably expected. Pick-to: 6.10 6.9 6.8 6.5 Task-number: QTBUG-138893 Change-Id: Ic8fdcb954730171594023e7cda7b3b56d0ac698b Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
0 files changed, 0 insertions, 0 deletions