-
Notifications
You must be signed in to change notification settings - Fork 6
/
animatedstackedwidget.h
41 lines (34 loc) · 1022 Bytes
/
animatedstackedwidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef ANIMATEDSTACKEDWIDGET_H
#define ANIMATEDSTACKEDWIDGET_H
#include <QStackedWidget>
#include <QPropertyAnimation>
#include <QSequentialAnimationGroup>
#include <QParallelAnimationGroup>
#include <QSettings>
#include <QWindow>
#include <QDebug>
#include <QApplication>
class AnimatedStackedWidget : public QStackedWidget
{
Q_OBJECT
public:
explicit AnimatedStackedWidget(QWidget *parent = 0);
void removeWidget(QWidget *w);
signals:
public slots:
void setCurrentIndex(int index, bool isNew = false);
void previewTab(int tabToPreview);
void cancelPreview();
private:
void doSetCurrentIndex(int index, bool isNew);
bool doingNewAnimation = false;
bool doingPreviewAnimation = false;
QSettings settings;
QWidget* widgetToRemove = NULL;
QAbstractAnimation* currentPreviewAnimation = NULL;
int currentPreview = -1;
int pendingPreview = -1;
QWidget* currentPreviewWidget = NULL;
bool pausePreviewAnimation = false;
};
#endif // ANIMATEDSTACKEDWIDGET_H