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_generic.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_generic.cpp')
-rw-r--r-- | src/corelib/tools/qelapsedtimer_generic.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/tools/qelapsedtimer_generic.cpp b/src/corelib/tools/qelapsedtimer_generic.cpp index 6324be00c0..7a52faa3c5 100644 --- a/src/corelib/tools/qelapsedtimer_generic.cpp +++ b/src/corelib/tools/qelapsedtimer_generic.cpp @@ -87,6 +87,8 @@ void QElapsedTimer::start() Q_DECL_NOTHROW and then starting the timer again with start(), but it does so in one single operation, avoiding the need to obtain the clock value twice. + Restarting the timer makes it valid again. + The following example illustrates how to use this function to calibrate a parameter to a slow operation (for example, an iteration count) so that this operation takes at least 250 milliseconds: |