ArchitectureColoredPainting/qt-material-widgets/components/qtmaterialsnackbar_internal.h

45 lines
937 B
C
Raw Permalink Normal View History

2023-03-06 12:38:25 +08:00
#ifndef QTMATERIALSNACKBAR_INTERNAL_H
#define QTMATERIALSNACKBAR_INTERNAL_H
#include <QStateMachine>
#include <QTimer>
class QtMaterialSnackbar;
class QtMaterialSnackbarStateMachine : public QStateMachine
{
Q_OBJECT
Q_PROPERTY(qreal offset WRITE setOffset READ offset)
public:
QtMaterialSnackbarStateMachine(QtMaterialSnackbar *parent);
~QtMaterialSnackbarStateMachine();
void setOffset(qreal offset);
inline qreal offset() const;
public slots:
void progress();
protected slots:
void snackbarShown();
protected:
bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
private:
Q_DISABLE_COPY(QtMaterialSnackbarStateMachine)
QtMaterialSnackbar *const m_snackbar;
QTimer m_timer;
qreal m_offset;
};
inline qreal QtMaterialSnackbarStateMachine::offset() const
{
return m_offset;
}
#endif // QTMATERIALSNACKBAR_INTERNAL_H