From 8c943392ae2ae554e496f11d9a3dd6c2c2e762e3 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 27 Mar 2025 12:01:04 +0100 Subject: [PATCH] Purge dangling uses of QDateTime deprecated time-spec changes QDateTime::{to,set}TimeSpec and QTimeZone::setOffsetFromUtc() shouldn't be referenced in docs aside from their own; they are deprecated from 6.9. Fixes: QTBUG-135238 Pick-to: 6.9.0 6.9 6.8 Change-Id: I835cfaa888dd3079f96719cd1c413dc7c2796fdb Reviewed-by: Magdalena Stojek Reviewed-by: Marc Mutz --- .../doc/snippets/code/src_corelib_time_qdatetime.cpp | 2 +- src/corelib/time/qdatetime.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/corelib/doc/snippets/code/src_corelib_time_qdatetime.cpp b/src/corelib/doc/snippets/code/src_corelib_time_qdatetime.cpp index 05fbf042ec8..de41965b192 100644 --- a/src/corelib/doc/snippets/code/src_corelib_time_qdatetime.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_time_qdatetime.cpp @@ -172,7 +172,7 @@ QDate lastMonday = 2020y / January / Monday[last]; //! [23] QDateTime local(QDateTime::currentDateTime()); -QDateTime UTC(local.toTimeSpec(QTimeZone::UTC)); +QDateTime UTC(local.toTimeZone(QTimeZone::UTC)); qDebug() << "Local time is:" << local; qDebug() << "UTC time is:" << UTC; qDebug() << "No difference between times represented:" << local.secsTo(UTC); diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index 6a11b101120..5c3c88e92ee 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -4147,7 +4147,7 @@ QTime QDateTime::time() const details of that time zone). Equivalent to \c{timeRepresentation().timeSpec()}. - \sa setTimeSpec(), timeRepresentation(), date(), time() + \sa setTimeZone(), timeRepresentation(), date(), time() */ Qt::TimeSpec QDateTime::timeSpec() const @@ -5330,7 +5330,7 @@ Qt::weak_ordering compareThreeWay(const QDateTime &lhs, const QDateTime &rhs) Returns the system clock's current datetime, using the time representation described by \a zone. If \a zone is omitted, local time is used. - \sa currentDateTimeUtc(), QDate::currentDate(), QTime::currentTime(), toTimeSpec() + \sa currentDateTimeUtc(), QDate::currentDate(), QTime::currentTime(), toTimeZone() */ /*! @@ -5349,7 +5349,7 @@ QDateTime QDateTime::currentDateTime() Equivalent to \c{currentDateTime(QTimeZone::UTC)}. - \sa currentDateTime(), QDate::currentDate(), QTime::currentTime(), toTimeSpec() + \sa currentDateTime(), QDate::currentDate(), QTime::currentTime(), toTimeZone() */ QDateTime QDateTime::currentDateTimeUtc() @@ -5366,7 +5366,7 @@ QDateTime QDateTime::currentDateTimeUtc() This number is like the POSIX time_t variable, but expressed in milliseconds instead of seconds. - \sa currentDateTime(), currentDateTimeUtc(), toTimeSpec() + \sa currentDateTime(), currentDateTimeUtc(), toTimeZone() */ /*!