diff options
author | Àlex Fiestas <afiestas@kde.org> | 2013-06-17 11:21:32 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-02 10:44:39 +0200 |
commit | 0ace3112137b78cf7d150e9974e69ccfe6838533 (patch) | |
tree | b2e258b302c6dbc920cbd7a38853bcf35e93d2d7 /src/widgets/widgets/qtabbar_p.h | |
parent | 25fc7a3068741807fb15eefb2fe57618a1b1fb84 (diff) |
Added SH_Widget_Animate in QStyle
Added SH_Widget_Animate in QStyle styleHint, and use it to determine
whether widgets should be animated or not.
In this patch QTabBar, QColumnView,QTreeView and QWidgetAnimator are
patched to obey the new Hint.
Change-Id: Iefdbddc52c7843f6653dbfb5462125942489b4d9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/widgets/qtabbar_p.h')
-rw-r--r-- | src/widgets/widgets/qtabbar_p.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h index 7468144146..8c6e70b8d7 100644 --- a/src/widgets/widgets/qtabbar_p.h +++ b/src/widgets/widgets/qtabbar_p.h @@ -138,6 +138,10 @@ public: } *animation; void startAnimation(QTabBarPrivate *priv, int duration) { + if (!priv->isAnimated()) { + priv->moveTabFinished(priv->tabList.indexOf(*this)); + return; + } if (!animation) animation = new TabBarAnimation(this, priv); animation->setStartValue(dragOffset); @@ -162,6 +166,7 @@ public: int indexAtPos(const QPoint &p) const; + inline bool isAnimated() const { Q_Q(const QTabBar); return q->style()->styleHint(QStyle::SH_Widget_Animate, 0, q); } inline bool validIndex(int index) const { return index >= 0 && index < tabList.count(); } void setCurrentNextEnabledIndex(int offset); |