diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-04-18 16:08:32 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-04-18 16:08:32 (GMT) |
commit | a359d21a84acc4b7eb73931e47acd4440327be19 (patch) | |
tree | d0c549db270c356211cd8eb78a48ba29a401c860 /src/gui/util | |
parent | 6814998ab4d9c6b0990b0bf01119ace69363ce3e (diff) | |
parent | d0245f57d1b617a61bb7472c232be5b974892369 (diff) | |
download | Qt-a359d21a84acc4b7eb73931e47acd4440327be19.zip Qt-a359d21a84acc4b7eb73931e47acd4440327be19.tar.gz Qt-a359d21a84acc4b7eb73931e47acd4440327be19.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (29 commits)
Use s/static/Q_GLOBAL_STATIC/g in QScroller
Alternative fix to the strict-aliasing violation warnings
Revert "Fix strict-alias breaking warnings with GCC."
Fix warning about vSize not being used in this function
Do not try to test UnixFDs with the system API because it may be too old
L10n: German translations for Qt 4.8
Compile with namespace support.
Replace the handcoded math and change the timer buckets again.
Move the constants up, preparing for refactoring
Fix strict-alias breaking warnings with GCC.
Fix compilation if D-Bus 1.4 isn't present.
Change the number of entries in the first timer bucket.
Change the error message in the timer ID deallocator.
Add a benchmark for testing our QtDBus type-validation
Move the QDBusPerformance test to the tests/benchmark dir
Use the Qt code for validating types in QtDBus
Add routines to validate D-Bus signature in QtDBus
Remove the unused QDBusUnixFileDescriptor::isShared function
Doc: document the QDBusUnixFileDescriptor class
Autotest: really ensure that two fds are equal
...
Diffstat (limited to 'src/gui/util')
-rw-r--r-- | src/gui/util/qscroller.cpp | 24 | ||||
-rw-r--r-- | src/gui/util/qscroller_p.h | 4 |
2 files changed, 13 insertions, 15 deletions
diff --git a/src/gui/util/qscroller.cpp b/src/gui/util/qscroller.cpp index 9c2d24d..db128c1 100644 --- a/src/gui/util/qscroller.cpp +++ b/src/gui/util/qscroller.cpp @@ -279,9 +279,11 @@ private: \sa QScrollEvent, QScrollPrepareEvent, QScrollerProperties */ +typedef QMap<QObject *, QScroller *> ScrollerHash; +typedef QSet<QScroller *> ScrollerSet; -QMap<QObject *, QScroller *> QScrollerPrivate::allScrollers; -QSet<QScroller *> QScrollerPrivate::activeScrollers; +Q_GLOBAL_STATIC(ScrollerHash, qt_allScrollers) +Q_GLOBAL_STATIC(ScrollerSet, qt_activeScrollers) /*! Returns \c true if a QScroller object was already created for \a target; \c false otherwise. @@ -290,7 +292,7 @@ QSet<QScroller *> QScrollerPrivate::activeScrollers; */ bool QScroller::hasScroller(QObject *target) { - return (QScrollerPrivate::allScrollers.value(target)); + return (qt_allScrollers()->value(target)); } /*! @@ -308,11 +310,11 @@ QScroller *QScroller::scroller(QObject *target) return 0; } - if (QScrollerPrivate::allScrollers.contains(target)) - return QScrollerPrivate::allScrollers.value(target); + if (qt_allScrollers()->contains(target)) + return qt_allScrollers()->value(target); QScroller *s = new QScroller(target); - QScrollerPrivate::allScrollers.insert(target, s); + qt_allScrollers()->insert(target, s); return s; } @@ -332,7 +334,7 @@ const QScroller *QScroller::scroller(const QObject *target) */ QList<QScroller *> QScroller::activeScrollers() { - return QScrollerPrivate::activeScrollers.toList(); + return qt_activeScrollers()->toList(); } /*! @@ -508,8 +510,8 @@ QScroller::~QScroller() // do not delete the recognizer. The QGestureManager is doing this. d->recognizer = 0; #endif - QScrollerPrivate::allScrollers.remove(d->target); - QScrollerPrivate::activeScrollers.remove(this); + qt_allScrollers()->remove(d->target); + qt_activeScrollers()->remove(this); delete d_ptr; } @@ -1754,9 +1756,9 @@ void QScrollerPrivate::setState(QScroller::State newstate) firstScroll = true; } if (state == QScroller::Dragging || state == QScroller::Scrolling) - activeScrollers.insert(q); + qt_activeScrollers()->insert(q); else - activeScrollers.remove(q); + qt_activeScrollers()->remove(q); emit q->stateChanged(state); } diff --git a/src/gui/util/qscroller_p.h b/src/gui/util/qscroller_p.h index 8c5f2e7..c119615 100644 --- a/src/gui/util/qscroller_p.h +++ b/src/gui/util/qscroller_p.h @@ -148,10 +148,6 @@ public slots: void targetDestroyed(); public: - // static - static QMap<QObject *, QScroller *> allScrollers; - static QSet<QScroller *> activeScrollers; - // non static QObject *target; QScrollerProperties properties; |