diff options
Diffstat (limited to 'src/corelib/animation')
-rw-r--r-- | src/corelib/animation/qabstractanimation.cpp | 12 | ||||
-rw-r--r-- | src/corelib/animation/qparallelanimationgroup.cpp | 8 | ||||
-rw-r--r-- | src/corelib/animation/qpropertyanimation.cpp | 9 | ||||
-rw-r--r-- | src/corelib/animation/qsequentialanimationgroup.cpp | 9 | ||||
-rw-r--r-- | src/corelib/animation/qvariantanimation.cpp | 14 |
5 files changed, 7 insertions, 45 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 4d7ce038dd..9dd81b2ecd 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -213,9 +213,7 @@ typedef QList<QAbstractAnimation*>::ConstIterator AnimationListConstIt; QUnifiedTimer drives animations indirectly, via QAbstractAnimationTimer. */ -#ifndef QT_NO_THREAD Q_GLOBAL_STATIC(QThreadStorage<QUnifiedTimer *>, unifiedTimer) -#endif QUnifiedTimer::QUnifiedTimer() : QObject(), defaultDriver(this), lastTick(0), timingInterval(DEFAULT_TIMER_INTERVAL), @@ -232,18 +230,12 @@ QUnifiedTimer::QUnifiedTimer() : QUnifiedTimer *QUnifiedTimer::instance(bool create) { QUnifiedTimer *inst; -#ifndef QT_NO_THREAD if (create && !unifiedTimer()->hasLocalData()) { inst = new QUnifiedTimer; unifiedTimer()->setLocalData(inst); } else { inst = unifiedTimer() ? unifiedTimer()->localData() : 0; } -#else - Q_UNUSED(create); - static QUnifiedTimer unifiedTimer; - inst = &unifiedTimer; -#endif return inst; } @@ -552,7 +544,7 @@ bool QUnifiedTimer::canUninstallAnimationDriver(QAnimationDriver *d) return d == driver && driver != &defaultDriver; } -#ifndef QT_NO_THREAD +#if QT_CONFIG(thread) Q_GLOBAL_STATIC(QThreadStorage<QAnimationTimer *>, animationTimer) #endif @@ -567,7 +559,7 @@ QAnimationTimer::QAnimationTimer() : QAnimationTimer *QAnimationTimer::instance(bool create) { QAnimationTimer *inst; -#ifndef QT_NO_THREAD +#if QT_CONFIG(thread) if (create && !animationTimer()->hasLocalData()) { inst = new QAnimationTimer; animationTimer()->setLocalData(inst); diff --git a/src/corelib/animation/qparallelanimationgroup.cpp b/src/corelib/animation/qparallelanimationgroup.cpp index 1dcf006dd3..492fb82e2b 100644 --- a/src/corelib/animation/qparallelanimationgroup.cpp +++ b/src/corelib/animation/qparallelanimationgroup.cpp @@ -53,13 +53,7 @@ You can treat QParallelAnimationGroup as any other QAbstractAnimation, e.g., pause, resume, or add it to other animation groups. - \code - QParallelAnimationGroup *group = new QParallelAnimationGroup; - group->addAnimation(anim1); - group->addAnimation(anim2); - - group->start(); - \endcode + \snippet code/src_corelib_animation_qparallelanimationgroup.cpp 0 In this example, \c anim1 and \c anim2 are two \l{QPropertyAnimation}s that have already been set up. diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp index 174121516b..28c03553c5 100644 --- a/src/corelib/animation/qpropertyanimation.cpp +++ b/src/corelib/animation/qpropertyanimation.cpp @@ -56,14 +56,7 @@ makes it possible to animate many of Qt's widgets. Let's look at an example: - \code - QPropertyAnimation *animation = new QPropertyAnimation(myWidget, "geometry"); - animation->setDuration(10000); - animation->setStartValue(QRect(0, 0, 100, 30)); - animation->setEndValue(QRect(250, 250, 100, 30)); - - animation->start(); - \endcode + \snippet code/src_corelib_animation_qpropertyanimation.cpp 0 The property name and the QObject instance of which property should be animated are passed to the constructor. You can then diff --git a/src/corelib/animation/qsequentialanimationgroup.cpp b/src/corelib/animation/qsequentialanimationgroup.cpp index 8af6b33722..150e74d7d6 100644 --- a/src/corelib/animation/qsequentialanimationgroup.cpp +++ b/src/corelib/animation/qsequentialanimationgroup.cpp @@ -61,14 +61,7 @@ groups. You can also call addPause() or insertPause() to add a pause to a sequential animation group. - \code - QSequentialAnimationGroup *group = new QSequentialAnimationGroup; - - group->addAnimation(anim1); - group->addAnimation(anim2); - - group->start(); - \endcode + \snippet code/src_corelib_animation_qsequentialanimationgroup.cpp 0 In this example, \c anim1 and \c anim2 are two already set up \l{QPropertyAnimation}s. diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index df533c5f4d..e935ac711e 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -116,15 +116,7 @@ QT_BEGIN_NAMESPACE and the current progress. Example: - \code - QVariant myColorInterpolator(const QColor &start, const QColor &end, qreal progress) - { - ... - return QColor(...); - } - ... - qRegisterAnimationInterpolator<QColor>(myColorInterpolator); - \endcode + \snippet code/src_corelib_animation_qvariantanimation.cpp 0 Another option is to reimplement interpolated(), which returns interpolation values for the value being interpolated. @@ -416,9 +408,7 @@ static QBasicMutex registeredInterpolatorsMutex; This is a typedef for a pointer to a function with the following signature: - \code - QVariant myInterpolator(const QVariant &from, const QVariant &to, qreal progress); - \endcode + \snippet code/src_corelib_animation_qvariantanimation.cpp 1 */ |