diff options
author | Liang Qi <liang.qi@qt.io> | 2018-10-25 07:21:05 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-10-25 07:21:53 +0200 |
commit | e28e91ae99b8c3859899e04cc9370534c7c7b86d (patch) | |
tree | cca81b1e745be4f25aab78e8e917c2324594e539 /src/corelib/animation | |
parent | 5ea233ca6782eb27adf596515cb66ef3dadc1d5e (diff) | |
parent | ebfad73b4e44fe6db8059200da105b4b87888718 (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
src/corelib/animation/qpropertyanimation.cpp
src/gui/image/qicon.cpp
tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
Diffstat (limited to 'src/corelib/animation')
20 files changed, 25 insertions, 120 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 48983def79..9dd81b2ecd 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -153,8 +153,6 @@ #include <QtCore/qcoreevent.h> #include <QtCore/qpointer.h> -#ifndef QT_NO_ANIMATION - #define DEFAULT_TIMER_INTERVAL 16 #define PAUSE_TIMER_COARSE_THRESHOLD 2000 @@ -1477,5 +1475,3 @@ QT_END_NAMESPACE #include "moc_qabstractanimation.cpp" #include "moc_qabstractanimation_p.cpp" - -#endif //QT_NO_ANIMATION diff --git a/src/corelib/animation/qabstractanimation.h b/src/corelib/animation/qabstractanimation.h index 0ff6bc5176..25b5726d56 100644 --- a/src/corelib/animation/qabstractanimation.h +++ b/src/corelib/animation/qabstractanimation.h @@ -42,10 +42,9 @@ #include <QtCore/qobject.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(animation); -#ifndef QT_NO_ANIMATION +QT_BEGIN_NAMESPACE class QAnimationGroup; class QSequentialAnimationGroup; @@ -169,11 +168,6 @@ private: }; - - - -#endif //QT_NO_ANIMATION - QT_END_NAMESPACE #endif // QABSTRACTANIMATION_H diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h index 5593046e48..3b6e8d6cc4 100644 --- a/src/corelib/animation/qabstractanimation_p.h +++ b/src/corelib/animation/qabstractanimation_p.h @@ -58,7 +58,7 @@ #include <private/qobject_p.h> #include <qabstractanimation.h> -#ifndef QT_NO_ANIMATION +QT_REQUIRE_CONFIG(animation); QT_BEGIN_NAMESPACE @@ -296,6 +296,4 @@ private: QT_END_NAMESPACE -#endif //QT_NO_ANIMATION - #endif //QABSTRACTANIMATION_P_H diff --git a/src/corelib/animation/qanimationgroup.cpp b/src/corelib/animation/qanimationgroup.cpp index 486dc149ea..f47d99eb68 100644 --- a/src/corelib/animation/qanimationgroup.cpp +++ b/src/corelib/animation/qanimationgroup.cpp @@ -86,8 +86,6 @@ #include <QtCore/qcoreevent.h> #include "qanimationgroup_p.h" -#ifndef QT_NO_ANIMATION - #include <algorithm> QT_BEGIN_NAMESPACE @@ -300,5 +298,3 @@ void QAnimationGroupPrivate::animationRemoved(int index, QAbstractAnimation *) QT_END_NAMESPACE #include "moc_qanimationgroup.cpp" - -#endif //QT_NO_ANIMATION diff --git a/src/corelib/animation/qanimationgroup.h b/src/corelib/animation/qanimationgroup.h index 136ad3ca9f..7c7666f251 100644 --- a/src/corelib/animation/qanimationgroup.h +++ b/src/corelib/animation/qanimationgroup.h @@ -42,10 +42,9 @@ #include <QtCore/qabstractanimation.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(animation); -#ifndef QT_NO_ANIMATION +QT_BEGIN_NAMESPACE class QAnimationGroupPrivate; class Q_CORE_EXPORT QAnimationGroup : public QAbstractAnimation @@ -74,8 +73,6 @@ private: Q_DECLARE_PRIVATE(QAnimationGroup) }; -#endif //QT_NO_ANIMATION - QT_END_NAMESPACE #endif //QANIMATIONGROUP_H diff --git a/src/corelib/animation/qanimationgroup_p.h b/src/corelib/animation/qanimationgroup_p.h index 31c2cd08e8..ff759d11fd 100644 --- a/src/corelib/animation/qanimationgroup_p.h +++ b/src/corelib/animation/qanimationgroup_p.h @@ -57,7 +57,7 @@ #include "private/qabstractanimation_p.h" -#ifndef QT_NO_ANIMATION +QT_REQUIRE_CONFIG(animation); QT_BEGIN_NAMESPACE @@ -89,6 +89,4 @@ public: QT_END_NAMESPACE -#endif //QT_NO_ANIMATION - #endif //QANIMATIONGROUP_P_H diff --git a/src/corelib/animation/qparallelanimationgroup.cpp b/src/corelib/animation/qparallelanimationgroup.cpp index e4dfc1bd6e..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. @@ -72,8 +66,6 @@ #include "qparallelanimationgroup_p.h" //#define QANIMATION_DEBUG -#ifndef QT_NO_ANIMATION - QT_BEGIN_NAMESPACE typedef QList<QAbstractAnimation *>::ConstIterator AnimationListConstIt; @@ -339,5 +331,3 @@ bool QParallelAnimationGroup::event(QEvent *event) QT_END_NAMESPACE #include "moc_qparallelanimationgroup.cpp" - -#endif //QT_NO_ANIMATION diff --git a/src/corelib/animation/qparallelanimationgroup.h b/src/corelib/animation/qparallelanimationgroup.h index 09a439ef24..683d933861 100644 --- a/src/corelib/animation/qparallelanimationgroup.h +++ b/src/corelib/animation/qparallelanimationgroup.h @@ -42,10 +42,9 @@ #include <QtCore/qanimationgroup.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(animation); -#ifndef QT_NO_ANIMATION +QT_BEGIN_NAMESPACE class QParallelAnimationGroupPrivate; class Q_CORE_EXPORT QParallelAnimationGroup : public QAnimationGroup @@ -72,8 +71,6 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_uncontrolledAnimationFinished()) }; -#endif //QT_NO_ANIMATION - QT_END_NAMESPACE #endif // QPARALLELANIMATIONGROUP diff --git a/src/corelib/animation/qparallelanimationgroup_p.h b/src/corelib/animation/qparallelanimationgroup_p.h index 1c9c3072f7..fc8f809d5a 100644 --- a/src/corelib/animation/qparallelanimationgroup_p.h +++ b/src/corelib/animation/qparallelanimationgroup_p.h @@ -55,7 +55,7 @@ #include "private/qanimationgroup_p.h" #include <QtCore/qhash.h> -#ifndef QT_NO_ANIMATION +QT_REQUIRE_CONFIG(animation); QT_BEGIN_NAMESPACE @@ -86,6 +86,4 @@ public: QT_END_NAMESPACE -#endif //QT_NO_ANIMATION - #endif //QPARALLELANIMATIONGROUP_P_H diff --git a/src/corelib/animation/qpauseanimation.cpp b/src/corelib/animation/qpauseanimation.cpp index 654ba701da..5f8a8b3590 100644 --- a/src/corelib/animation/qpauseanimation.cpp +++ b/src/corelib/animation/qpauseanimation.cpp @@ -64,9 +64,6 @@ #include "qpauseanimation.h" #include "qabstractanimation_p.h" - -#ifndef QT_NO_ANIMATION - QT_BEGIN_NAMESPACE class QPauseAnimationPrivate : public QAbstractAnimationPrivate @@ -150,5 +147,3 @@ void QPauseAnimation::updateCurrentTime(int) QT_END_NAMESPACE #include "moc_qpauseanimation.cpp" - -#endif //QT_NO_ANIMATION diff --git a/src/corelib/animation/qpauseanimation.h b/src/corelib/animation/qpauseanimation.h index e2095a39d6..6bdbeefdbd 100644 --- a/src/corelib/animation/qpauseanimation.h +++ b/src/corelib/animation/qpauseanimation.h @@ -42,10 +42,9 @@ #include <QtCore/qanimationgroup.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(animation); -#ifndef QT_NO_ANIMATION +QT_BEGIN_NAMESPACE class QPauseAnimationPrivate; @@ -70,8 +69,6 @@ private: Q_DECLARE_PRIVATE(QPauseAnimation) }; -#endif //QT_NO_ANIMATION - QT_END_NAMESPACE #endif // QPAUSEANIMATION_H diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp index 927f4f4810..271be248ec 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 @@ -93,8 +86,6 @@ #include <QtCore/QMutex> -#ifndef QT_NO_ANIMATION - QT_BEGIN_NAMESPACE void QPropertyAnimationPrivate::updateMetaProperty() @@ -315,5 +306,3 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState, QT_END_NAMESPACE #include "moc_qpropertyanimation.cpp" - -#endif //QT_NO_ANIMATION diff --git a/src/corelib/animation/qpropertyanimation.h b/src/corelib/animation/qpropertyanimation.h index 3270591d1d..a1caafcad5 100644 --- a/src/corelib/animation/qpropertyanimation.h +++ b/src/corelib/animation/qpropertyanimation.h @@ -42,10 +42,9 @@ #include <QtCore/qvariantanimation.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(animation); -#ifndef QT_NO_ANIMATION +QT_BEGIN_NAMESPACE class QPropertyAnimationPrivate; class Q_CORE_EXPORT QPropertyAnimation : public QVariantAnimation @@ -75,8 +74,6 @@ private: Q_DECLARE_PRIVATE(QPropertyAnimation) }; -#endif //QT_NO_ANIMATION - QT_END_NAMESPACE #endif // QPROPERTYANIMATION_H diff --git a/src/corelib/animation/qpropertyanimation_p.h b/src/corelib/animation/qpropertyanimation_p.h index cfb1f247e0..479762f573 100644 --- a/src/corelib/animation/qpropertyanimation_p.h +++ b/src/corelib/animation/qpropertyanimation_p.h @@ -55,7 +55,7 @@ #include "private/qvariantanimation_p.h" -#ifndef QT_NO_ANIMATION +QT_REQUIRE_CONFIG(animation); QT_BEGIN_NAMESPACE @@ -83,6 +83,4 @@ public: QT_END_NAMESPACE -#endif //QT_NO_ANIMATION - #endif //QPROPERTYANIMATION_P_H diff --git a/src/corelib/animation/qsequentialanimationgroup.cpp b/src/corelib/animation/qsequentialanimationgroup.cpp index f5f538337e..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. @@ -83,8 +76,6 @@ #include <QtCore/qdebug.h> -#ifndef QT_NO_ANIMATION - QT_BEGIN_NAMESPACE typedef QList<QAbstractAnimation *>::ConstIterator AnimationListConstIt; @@ -582,5 +573,3 @@ void QSequentialAnimationGroupPrivate::animationRemoved(int index, QAbstractAnim QT_END_NAMESPACE #include "moc_qsequentialanimationgroup.cpp" - -#endif //QT_NO_ANIMATION diff --git a/src/corelib/animation/qsequentialanimationgroup.h b/src/corelib/animation/qsequentialanimationgroup.h index 1c8e67d256..a33ff07abf 100644 --- a/src/corelib/animation/qsequentialanimationgroup.h +++ b/src/corelib/animation/qsequentialanimationgroup.h @@ -42,10 +42,9 @@ #include <QtCore/qanimationgroup.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(animation); -#ifndef QT_NO_ANIMATION +QT_BEGIN_NAMESPACE class QPauseAnimation; class QSequentialAnimationGroupPrivate; @@ -82,8 +81,6 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_uncontrolledAnimationFinished()) }; -#endif //QT_NO_ANIMATION - QT_END_NAMESPACE #endif //QSEQUENTIALANIMATIONGROUP_H diff --git a/src/corelib/animation/qsequentialanimationgroup_p.h b/src/corelib/animation/qsequentialanimationgroup_p.h index e4f3d9c96a..88dac4f566 100644 --- a/src/corelib/animation/qsequentialanimationgroup_p.h +++ b/src/corelib/animation/qsequentialanimationgroup_p.h @@ -54,7 +54,7 @@ #include "qsequentialanimationgroup.h" #include "private/qanimationgroup_p.h" -#ifndef QT_NO_ANIMATION +QT_REQUIRE_CONFIG(animation); QT_BEGIN_NAMESPACE @@ -107,6 +107,4 @@ public: QT_END_NAMESPACE -#endif //QT_NO_ANIMATION - #endif //QSEQUENTIALANIMATIONGROUP_P_H diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index 3c90d71c7d..e935ac711e 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -46,8 +46,6 @@ #include <algorithm> -#ifndef QT_NO_ANIMATION - QT_BEGIN_NAMESPACE /*! @@ -118,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. @@ -418,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 */ @@ -700,5 +688,3 @@ void QVariantAnimation::updateCurrentTime(int) QT_END_NAMESPACE #include "moc_qvariantanimation.cpp" - -#endif //QT_NO_ANIMATION diff --git a/src/corelib/animation/qvariantanimation.h b/src/corelib/animation/qvariantanimation.h index d6346e1706..e47fa14b1c 100644 --- a/src/corelib/animation/qvariantanimation.h +++ b/src/corelib/animation/qvariantanimation.h @@ -46,10 +46,9 @@ #include <QtCore/qvariant.h> #include <QtCore/qpair.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(animation); -#ifndef QT_NO_ANIMATION +QT_BEGIN_NAMESPACE class QVariantAnimationPrivate; class Q_CORE_EXPORT QVariantAnimation : public QAbstractAnimation @@ -116,8 +115,6 @@ void qRegisterAnimationInterpolator(QVariant (*func)(const T &from, const T &to, QVariantAnimation::registerInterpolator(reinterpret_cast<QVariantAnimation::Interpolator>(reinterpret_cast<void(*)()>(func)), qMetaTypeId<T>()); } -#endif //QT_NO_ANIMATION - QT_END_NAMESPACE #endif //QVARIANTANIMATION_H diff --git a/src/corelib/animation/qvariantanimation_p.h b/src/corelib/animation/qvariantanimation_p.h index 9f0f2e3030..57b59cf876 100644 --- a/src/corelib/animation/qvariantanimation_p.h +++ b/src/corelib/animation/qvariantanimation_p.h @@ -60,7 +60,7 @@ #include <type_traits> -#ifndef QT_NO_ANIMATION +QT_REQUIRE_CONFIG(animation); QT_BEGIN_NAMESPACE @@ -129,6 +129,4 @@ template<typename T > inline QVariant _q_interpolateVariant(const T &from, const QT_END_NAMESPACE -#endif //QT_NO_ANIMATION - #endif //QVARIANTANIMATION_P_H |