summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qtabbar_p.h
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-09-26 15:39:35 +0200
committerLiang Qi <liang.qi@qt.io>2018-10-12 14:26:15 +0000
commitc593492d1678a2ec08f1bfffcb572459b3bc6c00 (patch)
treea9427b13e0f3aa252d68decc862de5acb4dc3b17 /src/widgets/widgets/qtabbar_p.h
parent0509383cf2852f2aebd1efd75413835747c8f341 (diff)
Modernize the "animation" feature
Change-Id: Ibc164b3df3cf87db569ef4813de458a9067b7f7d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets/widgets/qtabbar_p.h')
-rw-r--r--src/widgets/widgets/qtabbar_p.h10
1 files changed, 6 insertions, 4 deletions
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 <qicon.h>
#include <qtoolbutton.h>
#include <qdebug.h>
+#if QT_CONFIG(animation)
#include <qvariantanimation.h>
+#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<Tab> tabList;
mutable QHash<QString, QSize> textSizes;