diff options
author | Robin Burchell <robin+qt@viroteck.net> | 2013-05-09 11:42:05 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@digia.com> | 2014-09-03 13:19:35 +0200 |
commit | 3006bd2d44298babd1339c3fc3a67ad0696bcefc (patch) | |
tree | 985bec0889f7d2dfbcde59848aeac9e0ea42df2a /src/corelib/tools/qelapsedtimer.cpp | |
parent | 8d0e6000cb326130605b2b5e688e9cdc65950794 (diff) |
Make QElapsedTimer default to invalid (and now non-POD).
The practical uses of a POD QElapsedTimer are not really that clear, and the
number of misuses of this API are quite high. Default the state to invalid to
prevent against mistakes.
[ChangeLog][QtCore][QElapsedTimer] Is no longer a POD.
Change-Id: I267292acf2bfca7404e3e449dd04410441d7ce26
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/corelib/tools/qelapsedtimer.cpp')
-rw-r--r-- | src/corelib/tools/qelapsedtimer.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/corelib/tools/qelapsedtimer.cpp b/src/corelib/tools/qelapsedtimer.cpp index 1da85fce96..08fc1cf5e2 100644 --- a/src/corelib/tools/qelapsedtimer.cpp +++ b/src/corelib/tools/qelapsedtimer.cpp @@ -202,6 +202,17 @@ QT_BEGIN_NAMESPACE */ /*! + \fn QElapsedTimer::QElapsedTimer() + \since 5.4 + + Constructs an invalid QElapsedTimer. A timer becomes valid once it has been + started. + + \sa isValid(), start() +*/ + + +/*! \fn bool QElapsedTimer::operator ==(const QElapsedTimer &other) const Returns \c true if this object and \a other contain the same time. @@ -230,8 +241,8 @@ void QElapsedTimer::invalidate() Q_DECL_NOTHROW } /*! - Returns \c false if this object was invalidated by a call to invalidate() and - has not been restarted since. + Returns \c false if the timer has never been started or invalidated by a + call to invalidate(). \sa invalidate(), start(), restart() */ |