QElectroTech
0.8-dev
|
The QWidgetAnimation class This class animate the show and hide function of a QWidget. More...
#include <qwidgetanimation.h>
Inherits QPropertyAnimation.
Public Types | |
enum | Behavior { minimumSizeHint, availableSpace, lastSize } |
Public Member Functions | |
QWidgetAnimation (QWidget *widget, Qt::Orientation orientation, QWidgetAnimation::Behavior behavior=QWidgetAnimation::minimumSizeHint, int duration=250) | |
QWidgetAnimation::QWidgetAnimation. More... | |
void | widgetToSubtract (QVector< QWidget * > widgets) |
QWidgetAnimation::widgetToSubtract Widget to subtract the size when the behavior is availableSpace. More... | |
void | show () |
QWidgetAnimation::show show the widget. More... | |
void | hide () |
QWidgetAnimation::hide Hide the widget. More... | |
void | setHidden (bool hidden) |
QWidgetAnimation::setHidden true hide, false show. More... | |
void | setLastShowSize (int size) |
QWidgetAnimation::setLastShowSize Force the last show size value to size. More... | |
Private Types | |
enum | currentState { Showing, Hidding, Finish } |
Private Attributes | |
Qt::Orientation | m_orientation = Qt::Horizontal |
QVector< QWidget * > | m_widget_to_substract |
QWidget * | m_widget |
QSize | m_maximum |
QRect | m_last_rect |
QWidgetAnimation::Behavior | m_behavior = Behavior::minimumSizeHint |
QWidgetAnimation::currentState | m_state = QWidgetAnimation::Finish |
The QWidgetAnimation class This class animate the show and hide function of a QWidget.
The role of behavior is to calcul as best the animation process when widget is show. Because this class don't change the current and final size of the widget but her maximum size during the animation process, we must to know in advance the final size of the widget. Behavior minimumSizeHint : the final size of the widget will be his minimum size hint. Behavior availableSpace : the final size of widget will be the available size of her parent. Since parent can have other widgets you can add a QVector of widget to subtract of the final size. Because we suppose the animated widget will take the maximum available space, we subtract the minimum size hint of widgets in QVector. Behavior lastSize : The widget will have the same size as the last time he was showed.
|
private |
QWidgetAnimation::QWidgetAnimation | ( | QWidget * | widget, |
Qt::Orientation | orientation, | ||
QWidgetAnimation::Behavior | behavior = QWidgetAnimation::minimumSizeHint , |
||
int | duration = 250 |
||
) |
QWidgetAnimation::QWidgetAnimation.
widget | : widget to animate |
orientation | : animate widget horizontally or vertically |
behavior | : |
duration | : the duration of animation |
void QWidgetAnimation::hide | ( | ) |
void QWidgetAnimation::setHidden | ( | bool | hidden | ) |
QWidgetAnimation::setHidden true hide, false show.
hidden |
void QWidgetAnimation::setLastShowSize | ( | int | size | ) |
QWidgetAnimation::setLastShowSize Force the last show size value to size.
size |
void QWidgetAnimation::show | ( | ) |
void QWidgetAnimation::widgetToSubtract | ( | QVector< QWidget * > | widgets | ) |
QWidgetAnimation::widgetToSubtract Widget to subtract the size when the behavior is availableSpace.
widgets |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |