27 lines
537 B
C
27 lines
537 B
C
|
#ifndef QMODERNSTACKEDWIDGET_H
|
||
|
#define QMODERNSTACKEDWIDGET_H
|
||
|
|
||
|
#include <QStackedWidget>
|
||
|
#include <QObject>
|
||
|
#include <QtDebug>
|
||
|
#include <QPropertyAnimation>
|
||
|
#include <QGraphicsOpacityEffect>
|
||
|
|
||
|
class QModernStackedWidget : public QStackedWidget
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
QModernStackedWidget(QWidget* parent = nullptr);
|
||
|
|
||
|
void setCurrentWidgetAnimated(QWidget* widget);
|
||
|
|
||
|
private:
|
||
|
QWidget* newWidget;
|
||
|
QPropertyAnimation* opacityAnimation;
|
||
|
|
||
|
private slots:
|
||
|
void handleAnimationFinished();
|
||
|
};
|
||
|
|
||
|
#endif // QMODERNSTACKEDWIDGET_H
|