From 459f1978ae27a83f7c131ea8d4db118ffd2eeb86 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 5 Nov 2024 14:26:57 +0100 Subject: [PATCH] [docs] Add QDate and QDateTime details to overview of C++20 features Briefly sketch the new features in std::chrono and how Qt now provides access to them. Task-number: QTBUG-128837 Change-Id: I99a94ac9d0ed292ec9e3b0057ba6a9e2092200ed Reviewed-by: Ivan Solovev (cherry picked from commit 856aaa4c0c4992b3be57c0a6c5ccb81dd6ea8b86) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/doc/src/cpp20-overview.qdoc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/corelib/doc/src/cpp20-overview.qdoc b/src/corelib/doc/src/cpp20-overview.qdoc index bc6339eb94c..e24b72d74ad 100644 --- a/src/corelib/doc/src/cpp20-overview.qdoc +++ b/src/corelib/doc/src/cpp20-overview.qdoc @@ -11,4 +11,24 @@ provide a better experience for our users. This page gives a brief overview of C++20 features available in Qt. + + \section1 Support for \c{std::chrono} + + Various classes related to date and time have support for \l + {https://en.cppreference.com/w/cpp/chrono} {std::chrono} features from older + versions of C++. With the arrival of C++20, \c{std::chrono} has added new \l + {https://en.cppreference.com//w/cpp/chrono#Calendar} {calendar types}, such + as \l {https://en.cppreference.com/w/cpp/chrono/year_month_day} + {year_month_day}, plus \l + {https://en.cppreference.com//w/cpp/chrono#Time_point} {date and time + representations}, such as the \l + {https://en.cppreference.com/w/cpp/chrono/system_clock} {system_clock} and + its \l {https://en.cppreference.com/w/cpp/chrono/time_point} {time_point} + types. When Qt is built with C++20, it can now make use of these additions. + + QDate and QDateTime now support conversion to and from the various calendar, + date and date-time types, along with addition of \l + {https://en.cppreference.com/w/cpp/chrono/duration} {duration + types}. QTimeZone now supports construction from a \l + {https://en.cppreference.com/w/cpp/chrono/time_zone} {time_zone}. */