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/styles | |
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/styles')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 11 | ||||
-rw-r--r-- | src/widgets/styles/qstyle.cpp | 4 | ||||
-rw-r--r-- | src/widgets/styles/qstyle.h | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 262275611c..f5b61ea6f3 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -65,6 +65,7 @@ #include <qtoolbar.h> #include <qtoolbutton.h> #include <qrubberband.h> +#include "qtreeview.h" #include <private/qcommonstylepixmaps_p.h> #include <private/qmath_p.h> #include <qdebug.h> @@ -5113,6 +5114,16 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget ret = 2000; break; #endif + case SH_Widget_Animate: +#ifndef QT_NO_TREEVIEW + if (qobject_cast<const QTreeView*>(widget)) { + ret = false; + } else +#endif + { + ret = true; + } + break; default: ret = 0; break; diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index 826a05db51..8d8eb3aa46 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -1900,6 +1900,10 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, a tooltip is shown (notice: shown, not hidden). When a new wake isn't needed, a user-requested tooltip will be shown nearly instantly. + \value SH_Widget_Animate Determines if the widget should show animations or not, for example + a transition between checked and unchecked statuses in a checkbox. + This enum value has been introduced in Qt 5.2. + \sa styleHint() */ diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h index d4e1be4787..fffd423c8a 100644 --- a/src/widgets/styles/qstyle.h +++ b/src/widgets/styles/qstyle.h @@ -700,6 +700,7 @@ public: SH_Menu_SupportsSections, SH_ToolTip_WakeUpDelay, SH_ToolTip_FallAsleepDelay, + SH_Widget_Animate, // Add new style hint values here SH_CustomBase = 0xf0000000 |