summaryrefslogtreecommitdiffstats
path: root/src/corelib/animation
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-22 13:29:40 +0100
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-22 13:29:40 +0100
commit61d324fae094680c0ce48d4b0cc23073790f383c (patch)
treedd8048175d015e68eb60d9946a7cab99e8524b8e /src/corelib/animation
parentda7c6cc8995f063435b25938ac10739a6e7f0067 (diff)
parentf725e2b9cae1866ff6510cb339cc4ada363f9e4f (diff)
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (78 commits) Moc: Add support for rvalue references in signals and slots. Add support for polyphonic greek Fix build failure on WinCE. Autotests: if you use X11 libs, you must link to X11 libs explicitly. Disable C++0x mode for QtWebKit and QtScript since WebKit will not compile any time soon with C++0x Compile Phonon in C++0x mode. Compile Qt in C++0x mode. Avoid a data relocation by not trying to store a pointer in the .data section of plugins. Fix cast-from-ascii warning Fix compilation on Linux Fix compilation with WINSCW: #include doesn't find files in the same dir Rename m_volume to m_vol Add 2 signals, introduce side widget, make it possible to reset startId Do not create native window handle just because a parent has one. Tab color fix for document mode on Snow Leopard. Revert "Don't emit open signal on session close/error." Rename networkAccess property to networkAccessible. Don't emit open signal on session close/error. Rename private signal. Autotest: fix instability by accepting rounding errors ...
Diffstat (limited to 'src/corelib/animation')
-rw-r--r--src/corelib/animation/qabstractanimation.cpp1
-rw-r--r--src/corelib/animation/qabstractanimation_p.h57
2 files changed, 3 insertions, 55 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index f834a80ee6..82b30036cf 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -170,6 +170,7 @@ QUnifiedTimer::QUnifiedTimer() :
currentAnimationIdx(0), consistentTiming(false), slowMode(false),
isPauseTimerActive(false), runningLeafAnimations(0)
{
+ time.invalidate();
}
QUnifiedTimer *QUnifiedTimer::instance()
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index 8bc3224be2..2282cdbc34 100644
--- a/src/corelib/animation/qabstractanimation_p.h
+++ b/src/corelib/animation/qabstractanimation_p.h
@@ -56,6 +56,7 @@
#include <QtCore/qbasictimer.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qtimer.h>
+#include <QtCore/qelapsedtimer.h>
#include <private/qobject_p.h>
#ifdef Q_OS_WIN
@@ -113,61 +114,7 @@ private:
Q_DECLARE_PUBLIC(QAbstractAnimation)
};
-class ElapsedTimer
-{
-public:
- ElapsedTimer() {
- invalidate();
- }
-
- void invalidate() {
- m_started = -1;
- }
-
- bool isValid() const {
- return m_started >= 0;
- }
-
- void start() {
- m_started = getTickCount_sys();
- }
-
- qint64 elapsed() const {
- qint64 current = getTickCount_sys();
- qint64 delta = current - m_started;
- if (delta < 0)
- delta += getPeriod_sys(); //we wrapped around
- return delta;
- }
-
-private:
- enum {
- MSECS_PER_HOUR = 3600000,
- MSECS_PER_MIN = 60000
- };
-
- qint64 m_started;
-
- quint64 getPeriod_sys() const {
-#ifdef Q_OS_WIN
- return Q_UINT64_C(0x100000000);
-#else
- // fallback
- return 86400 * 1000;
-#endif
- }
-
- qint64 getTickCount_sys() const {
-#ifdef Q_OS_WIN
- return ::GetTickCount();
-#else
- // fallback
- const QTime t = QTime::currentTime();
- return MSECS_PER_HOUR * t.hour() + MSECS_PER_MIN * t.minute() + 1000 * t.second() + t.msec();
-#endif
- }
-};
-
+typedef QElapsedTimer ElapsedTimer;
class QUnifiedTimer : public QObject
{