diff options
author | Elvis Angelaccio <elvis.angelaccio@kde.org> | 2017-05-26 12:51:33 +0200 |
---|---|---|
committer | Elvis Angelaccio <elvis.angelaccio@kde.org> | 2017-06-04 12:30:08 +0000 |
commit | 04eba7b538072e2811f074bf66fd41f27c90b35c (patch) | |
tree | 4e2c8e01560cb2f8b1aec34ebd2497a508b474bc /src/widgets/styles/qstyle.cpp | |
parent | 4480f47f7b0f81483b0cf3c8327eff12938ca018 (diff) |
QStyle: deprecate SH_Widget_Animate in favor of SH_Widget_Animation_Duration
This change introduces a new SH_Widget_Animation_Duration style hint
that applications can query instead of manually hardcoding the duration
of an animation.
As default value we use 200, which is the value that was already used in
QWidgetAnimator. A value equal to 0 means that the animations will be
disabled. This also implies that the SH_Widget_Animate style hint is
superseded and can be deprecated.
The new style hint is configurable with style sheets.
[ChangeLog][QtWidgets][Styles] Added SH_Widget_Animation_Duration style
hint which deprecates SH_Widget_Animate.
Change-Id: Ic3f5e4f7145a89697f28666aeaecabb1f3c5c96f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/styles/qstyle.cpp')
-rw-r--r-- | src/widgets/styles/qstyle.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index 7e37d10cb5..0350d5e1a5 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -1972,9 +1972,7 @@ 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. + \value SH_Widget_Animate Deprecated. Use \l{SH_Widget_Animation_Duration} instead. \value SH_Splitter_OpaqueResize Determines if resizing is opaque This enum value has been introduced in Qt 5.2 @@ -1992,6 +1990,11 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, The Mac style, for example, sets this to false. This enum value has been introduced in Qt 5.10. + \value SH_Widget_Animation_Duration + Determines how much an animation should last (in ms). + A value equal to zero means that the animations will be disabled. + This enum value has been introduced in Qt 5.10. + \sa styleHint() */ |