summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@qt.io>2025-11-24 14:43:33 +0100
committerDavid Boddie <david.boddie@qt.io>2025-11-28 18:08:40 +0000
commit7ceacc9a7c24be37a0251a7011fe7fe45e911cf2 (patch)
treed4bddb84e7350f808837d09b10fe93d24795caab
parentf4bf66b498816b6078e1fe1f739d8fce2dab4543 (diff)
Doc: Document the LegacyBehavior enum separately for clarity
Improve the layout of the enum documentation by splitting LegacyBehavior from the rest of the enum values to prevent the value column from taking up too much of the page width. Mention transition details rather than times to avoid confusion about terminology. Fixes: QTBUG-141801 Change-Id: Ib995ab2af3bcddce669df818ff949b7a3e959667 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
-rw-r--r--src/corelib/time/qdatetime.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp
index deac396061d..34e910fabec 100644
--- a/src/corelib/time/qdatetime.cpp
+++ b/src/corelib/time/qdatetime.cpp
@@ -3894,10 +3894,12 @@ QDateTime::Data QDateTimePrivate::create(QDate toDate, QTime toTime, const QTime
Selects a time on the standard time side of the transition.
\value PreferDaylightSaving
Selects a time on the daylight-saving-time side of the transition.
- \value LegacyBehavior
- An alias for RelativeToBefore, which is used as default for
- TransitionResolution parameters, as this most closely matches the
- behavior prior to Qt 6.7.
+ \omitvalue LegacyBehavior
+
+ An additional constant, \c LegacyBehavior, is used as a default value for
+ TransitionResolution parameters in some constructors and setter functions.
+ This is an alias for \c RelativeToBefore, which implements behavior that
+ most closely matches the behavior of QDateTime prior to Qt 6.7.
For \l addDays(), \l addMonths() or \l addYears(), the behavior is and
(mostly) was to use \c RelativeToBefore if adding a positive adjustment and \c
@@ -3909,7 +3911,7 @@ QDateTime::Data QDateTimePrivate::create(QDate toDate, QTime toTime, const QTime
where the daylight-saving mechanism is a decrease in offset from UTC in
winter (known as "negative DST"), the reverse applies, provided the
operating system reports - as it does on most platforms - whether a datetime
- is in DST or standard time. For some platforms, where transition times are
+ is in DST or standard time. For some platforms, where transition details are
unavailable even for Qt::TimeZone datetimes, QTimeZone is obliged to presume
that the side with lower offset from UTC is standard time, effectively
assuming positive DST.