summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qcolumnview.cpp
diff options
context:
space:
mode:
authorÀlex Fiestas <afiestas@kde.org>2013-06-17 11:21:32 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-02 10:44:39 +0200
commit0ace3112137b78cf7d150e9974e69ccfe6838533 (patch)
treeb2e258b302c6dbc920cbd7a38853bcf35e93d2d7 /src/widgets/itemviews/qcolumnview.cpp
parent25fc7a3068741807fb15eefb2fe57618a1b1fb84 (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/itemviews/qcolumnview.cpp')
-rw-r--r--src/widgets/itemviews/qcolumnview.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/widgets/itemviews/qcolumnview.cpp b/src/widgets/itemviews/qcolumnview.cpp
index 5aee78fab4..32a3dddca1 100644
--- a/src/widgets/itemviews/qcolumnview.cpp
+++ b/src/widgets/itemviews/qcolumnview.cpp
@@ -332,11 +332,14 @@ void QColumnView::scrollTo(const QModelIndex &index, ScrollHint hint)
}
#ifndef QT_NO_ANIMATION
- d->currentAnimation.setEndValue(newScrollbarValue);
- d->currentAnimation.start();
-#else
- horizontalScrollBar()->setValue(newScrollbarValue);
+ if (style()->styleHint(QStyle::SH_Widget_Animate, 0, this)) {
+ d->currentAnimation.setEndValue(newScrollbarValue);
+ d->currentAnimation.start();
+ } else
#endif //QT_NO_ANIMATION
+ {
+ horizontalScrollBar()->setValue(newScrollbarValue);
+ }
}
/*!