summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/tools/qdatetime.cpp16
-rw-r--r--src/corelib/tools/qdatetime.h8
2 files changed, 11 insertions, 13 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 0f8c8629a8..9220d210f1 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -1686,12 +1686,10 @@ bool QDate::isLeapYear(int y)
\brief The QTime class provides clock time functions.
- A QTime object contains a clock time, which it can express as the
- numbers of hours, minutes, seconds, and milliseconds since
- midnight. It can read the current time from the system clock and
- measure a span of elapsed time. It provides functions for
- comparing times and for manipulating a time by adding a number of
- milliseconds.
+ A QTime object contains a clock time, which it can express as the numbers of
+ hours, minutes, seconds, and milliseconds since midnight. It provides
+ functions for comparing times and for manipulating a time by adding a number
+ of milliseconds.
QTime uses the 24-hour clock format; it has no concept of AM/PM.
Unlike QDateTime, QTime knows nothing about time zones or
@@ -1718,9 +1716,6 @@ bool QDate::isLeapYear(int y)
objects; an earlier time is considered smaller than a later one;
if A.msecsTo(B) is positive, then A < B.
- QTime can be used to measure a span of elapsed time using the
- start(), restart(), and elapsed() functions.
-
\sa QDate, QDateTime
*/
@@ -2364,7 +2359,7 @@ bool QTime::isValid(int h, int m, int s, int ms)
return (uint)h < 24 && (uint)m < 60 && (uint)s < 60 && (uint)ms < 1000;
}
-
+#if QT_DEPRECATED_SINCE(5, 14) // ### Qt 6: remove
/*!
Sets this time to the current time. This is practical for timing:
@@ -2433,6 +2428,7 @@ int QTime::elapsed() const
n += 86400 * 1000;
return n;
}
+#endif // Use QElapsedTimer instead !
/*****************************************************************************
QDateTime static helper functions
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index 1ff187a9bd..3e3b953b52 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -206,9 +206,11 @@ public:
#endif
static bool isValid(int h, int m, int s, int ms = 0);
- void start();
- int restart();
- int elapsed() const;
+#if QT_DEPRECATED_SINCE(5, 14) // ### Qt 6: remove
+ QT_DEPRECATED_X("Use QElapsedTimer instead") void start();
+ QT_DEPRECATED_X("Use QElapsedTimer instead") int restart();
+ QT_DEPRECATED_X("Use QElapsedTimer instead") int elapsed() const;
+#endif
private:
enum TimeFlag { NullTime = -1 };
Q_DECL_CONSTEXPR inline int ds() const { return mds == -1 ? 0 : mds; }