QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
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
45class QWidgetAnimation : public QPropertyAnimation
46{
47 Q_OBJECT
48
49 public:
55
57 QWidget *widget,
58 Qt::Orientation orientation,
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:
75
76 Qt::Orientation m_orientation = Qt::Horizontal;
77 QVector <QWidget *> m_widget_to_substract;
78 QWidget *m_widget;
79 QSize m_maximum;
83};
84
85#endif // QWIDGETANIMATION_H
The QWidgetAnimation class This class animate the show and hide function of a QWidget.
Definition qwidgetanimation.h:46
void widgetToSubtract(QVector< QWidget * > widgets)
QWidgetAnimation::widgetToSubtract Widget to subtract the size when the behavior is availableSpace.
Definition qwidgetanimation.cpp:68
QWidget * m_widget
Definition qwidgetanimation.h:78
QWidgetAnimation::Behavior m_behavior
Definition qwidgetanimation.h:81
QWidgetAnimation::currentState m_state
Definition qwidgetanimation.h:82
currentState
Definition qwidgetanimation.h:70
@ Showing
Definition qwidgetanimation.h:71
@ Finish
Definition qwidgetanimation.h:73
@ Hiding
Definition qwidgetanimation.h:72
Qt::Orientation m_orientation
Definition qwidgetanimation.h:76
void hide()
QWidgetAnimation::hide Hide the widget.
Definition qwidgetanimation.cpp:136
QSize m_maximum
Definition qwidgetanimation.h:79
void setLastShowSize(int size)
QWidgetAnimation::setLastShowSize Force the last show size value to size.
Definition qwidgetanimation.cpp:173
QVector< QWidget * > m_widget_to_substract
Definition qwidgetanimation.h:77
void setHidden(bool hidden)
QWidgetAnimation::setHidden true hide, false show.
Definition qwidgetanimation.cpp:160
QRect m_last_rect
Definition qwidgetanimation.h:80
Behavior
Definition qwidgetanimation.h:50
@ minimumSizeHint
Definition qwidgetanimation.h:51
@ lastSize
Definition qwidgetanimation.h:53
@ availableSpace
Definition qwidgetanimation.h:52
void show()
QWidgetAnimation::show show the widget.
Definition qwidgetanimation.cpp:78