From f3002b6e205463305502600df95b1ae509e47a9b Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 26 Mar 2019 19:20:24 +0100 Subject: Use the QTime API less clumsily Various patterns seem to have been copied, notably counting time from QTime(0, 0) rather than using QTime::msecsSinceStartOfDay() and its setter. Unsuitable value types also put in an appearance, and QTime()'s parameters after the first two default to 0 anyway. Corrected a lie in QTime()'s default constructor doc; it does not work the same as QTime(0, 0) at all. Change-Id: Icf1a10052a049e68fd0f665958f36dbe75ac46d5 Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 80d6dada60..d06b8a04d2 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -1464,9 +1464,8 @@ bool QDate::isLeapYear(int y) /*! \fn QTime::QTime() - Constructs a null time object. A null time can be a QTime(0, 0, 0, 0) - (i.e., midnight) object, except that isNull() returns \c true and isValid() - returns \c false. + Constructs a null time object. For a null time, isNull() returns \c true and + isValid() returns \c false. If you need a zero time, use QTime(0, 0). \sa isNull(), isValid() */ @@ -3143,7 +3142,7 @@ QDateTime::QDateTime() Q_DECL_NOEXCEPT_EXPR(Data::CanBeSmall) */ QDateTime::QDateTime(const QDate &date) - : d(QDateTimePrivate::create(date, QTime(0, 0, 0), Qt::LocalTime, 0)) + : d(QDateTimePrivate::create(date, QTime(0, 0), Qt::LocalTime, 0)) { } -- cgit v1.2.3