From c593492d1678a2ec08f1bfffcb572459b3bc6c00 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 26 Sep 2018 15:39:35 +0200 Subject: Modernize the "animation" feature Change-Id: Ibc164b3df3cf87db569ef4813de458a9067b7f7d Reviewed-by: Edward Welbourne Reviewed-by: Oswald Buddenhagen --- src/widgets/widgets/qtabbar_p.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/widgets/widgets/qtabbar_p.h') diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h index 1092878f2c..04f07c7cec 100644 --- a/src/widgets/widgets/qtabbar_p.h +++ b/src/widgets/widgets/qtabbar_p.h @@ -58,7 +58,9 @@ #include #include #include +#if QT_CONFIG(animation) #include +#endif #define ANIMATION_DURATION 250 @@ -107,9 +109,9 @@ public: inline Tab(const QIcon &ico, const QString &txt) : enabled(true) , shortcutId(0), text(txt), icon(ico), leftWidget(0), rightWidget(0), lastTab(-1), dragOffset(0) -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) , animation(0) -#endif //QT_NO_ANIMATION +#endif // animation {} bool operator==(const Tab &other) const { return &other == this; } bool enabled; @@ -136,7 +138,7 @@ public: QString accessibleName; #endif -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) ~Tab() { delete animation; } struct TabBarAnimation : public QVariantAnimation { TabBarAnimation(Tab *t, QTabBarPrivate *_priv) : tab(t), priv(_priv) @@ -166,7 +168,7 @@ public: #else void startAnimation(QTabBarPrivate *priv, int duration) { Q_UNUSED(duration); priv->moveTabFinished(priv->tabList.indexOf(*this)); } -#endif //QT_NO_ANIMATION +#endif // animation }; QList tabList; mutable QHash textSizes; -- cgit v1.2.3