21
21
#define SLIDECONTAINER_H
24
#include <QWeakPointer>
27
27
#include <lib/gwenviewlib_export.h>
29
class QPropertyAnimation;
33
35
* This widget is design to contain one child widget, the "content" widget.
34
36
* It will start hidden by default. Calling slideIn() will slide in the content
35
37
* widget from the top border. Calling slideOut() will slide it out.
37
class GWENVIEWLIB_EXPORT SlideContainer : public QFrame {
39
class GWENVIEWLIB_EXPORT SlideContainer : public QFrame
42
Q_PROPERTY(int slideHeight READ slideHeight WRITE setSlideHeight)
40
SlideContainer(QWidget* parent = 0);
43
* Returns the content widget
45
QWidget* content() const;
48
* Defines the content widget
50
void setContent(QWidget* content);
52
virtual QSize sizeHint() const;
54
virtual QSize minimumSizeHint() const;
44
SlideContainer(QWidget* parent = 0);
47
* Returns the content widget
49
QWidget* content() const;
52
* Defines the content widget
54
void setContent(QWidget* content);
56
virtual QSize sizeHint() const;
58
virtual QSize minimumSizeHint() const;
60
int slideHeight() const;
62
Q_INVOKABLE void setSlideHeight(int height);
58
* Slides the content widget in.
59
* Calling it multiple times won't cause the animation to be replayed.
66
* Slides the content widget in.
67
* Calling it multiple times won't cause the animation to be replayed.
64
* Slides the content widget out.
65
* Calling it multiple times won't cause the animation to be replayed.
72
* Slides the content widget out.
73
* Calling it multiple times won't cause the animation to be replayed.
70
void resizeEvent(QResizeEvent*);
71
bool eventFilter(QObject*, QEvent*);
78
void resizeEvent(QResizeEvent*);
79
bool eventFilter(QObject*, QEvent* event);
74
void slotTimeLineChanged(qreal value);
75
void slotTimeLineFinished();
86
QWeakPointer<QPropertyAnimation> mAnim;
89
void adjustContentGeometry();
91
void animTo(int height);
86
96
#endif /* SLIDECONTAINER_H */