QElectroTech
0.100.0-dev
Loading...
Searching...
No Matches
sources
QWidgetAnimation
qwidgetanimation.h
Go to the documentation of this file.
1
/*
2
Copyright 2006-2024 The QElectroTech Team
3
This file is part of QElectroTech.
4
5
QElectroTech is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 2 of the License, or
8
(at your option) any later version.
9
10
QElectroTech is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
14
15
You should have received a copy of the GNU General Public License
16
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
#ifndef QWIDGETANIMATION_H
19
#define QWIDGETANIMATION_H
20
21
#include <QPropertyAnimation>
22
#include <QSize>
23
#include <QRect>
24
45
class
QWidgetAnimation
:
public
QPropertyAnimation
46
{
47
Q_OBJECT
48
49
public
:
50
enum
Behavior
{
51
minimumSizeHint
,
52
availableSpace
,
53
lastSize
,
54
};
55
56
QWidgetAnimation
(
57
QWidget *widget,
58
Qt::Orientation orientation,
59
QWidgetAnimation::Behavior
60
behavior =
QWidgetAnimation::minimumSizeHint
,
61
int
duration = 250);
62
void
widgetToSubtract
(QVector<QWidget *> widgets);
63
64
void
show
();
65
void
hide
();
66
void
setHidden
(
bool
hidden);
67
void
setLastShowSize
(
int
size);
68
69
private
:
70
enum
currentState
{
71
Showing
,
72
Hiding
,
73
Finish
74
};
75
76
Qt::Orientation
m_orientation
= Qt::Horizontal;
77
QVector <QWidget *>
m_widget_to_substract
;
78
QWidget *
m_widget
;
79
QSize
m_maximum
;
80
QRect
m_last_rect
;
81
QWidgetAnimation::Behavior
m_behavior
=
Behavior::minimumSizeHint
;
82
QWidgetAnimation::currentState
m_state
=
QWidgetAnimation::Finish
;
83
};
84
85
#endif
// QWIDGETANIMATION_H
QWidgetAnimation
The QWidgetAnimation class This class animate the show and hide function of a QWidget.
Definition
qwidgetanimation.h:46
QWidgetAnimation::widgetToSubtract
void widgetToSubtract(QVector< QWidget * > widgets)
QWidgetAnimation::widgetToSubtract Widget to subtract the size when the behavior is availableSpace.
Definition
qwidgetanimation.cpp:68
QWidgetAnimation::m_widget
QWidget * m_widget
Definition
qwidgetanimation.h:78
QWidgetAnimation::m_behavior
QWidgetAnimation::Behavior m_behavior
Definition
qwidgetanimation.h:81
QWidgetAnimation::m_state
QWidgetAnimation::currentState m_state
Definition
qwidgetanimation.h:82
QWidgetAnimation::currentState
currentState
Definition
qwidgetanimation.h:70
QWidgetAnimation::Showing
@ Showing
Definition
qwidgetanimation.h:71
QWidgetAnimation::Finish
@ Finish
Definition
qwidgetanimation.h:73
QWidgetAnimation::Hiding
@ Hiding
Definition
qwidgetanimation.h:72
QWidgetAnimation::m_orientation
Qt::Orientation m_orientation
Definition
qwidgetanimation.h:76
QWidgetAnimation::hide
void hide()
QWidgetAnimation::hide Hide the widget.
Definition
qwidgetanimation.cpp:136
QWidgetAnimation::m_maximum
QSize m_maximum
Definition
qwidgetanimation.h:79
QWidgetAnimation::setLastShowSize
void setLastShowSize(int size)
QWidgetAnimation::setLastShowSize Force the last show size value to size.
Definition
qwidgetanimation.cpp:173
QWidgetAnimation::m_widget_to_substract
QVector< QWidget * > m_widget_to_substract
Definition
qwidgetanimation.h:77
QWidgetAnimation::setHidden
void setHidden(bool hidden)
QWidgetAnimation::setHidden true hide, false show.
Definition
qwidgetanimation.cpp:160
QWidgetAnimation::m_last_rect
QRect m_last_rect
Definition
qwidgetanimation.h:80
QWidgetAnimation::Behavior
Behavior
Definition
qwidgetanimation.h:50
QWidgetAnimation::minimumSizeHint
@ minimumSizeHint
Definition
qwidgetanimation.h:51
QWidgetAnimation::lastSize
@ lastSize
Definition
qwidgetanimation.h:53
QWidgetAnimation::availableSpace
@ availableSpace
Definition
qwidgetanimation.h:52
QWidgetAnimation::show
void show()
QWidgetAnimation::show show the widget.
Definition
qwidgetanimation.cpp:78
Generated by
1.9.8