diff options
author | Robert Griebl <robert.griebl@nokia.com> | 2011-04-18 12:26:46 (GMT) |
---|---|---|
committer | Robert Griebl <robert.griebl@nokia.com> | 2011-04-18 12:30:06 (GMT) |
commit | d0245f57d1b617a61bb7472c232be5b974892369 (patch) | |
tree | dbed74ba1f56f7b4c8e47e00901a039501b3698f /src/gui/util | |
parent | 8856e2412fc2756443288644465d9edce5798fea (diff) | |
download | Qt-d0245f57d1b617a61bb7472c232be5b974892369.zip Qt-d0245f57d1b617a61bb7472c232be5b974892369.tar.gz Qt-d0245f57d1b617a61bb7472c232be5b974892369.tar.bz2 |
Use s/static/Q_GLOBAL_STATIC/g in QScroller
Reviewed-by: Harald Fernengel
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; |