forked from laserpants/qt-material-widgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qtmaterialsnackbar.h
57 lines (39 loc) · 1.28 KB
/
qtmaterialsnackbar.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef QTMATERIALSNACKBAR_H
#define QTMATERIALSNACKBAR_H
#include "lib/qtmaterialoverlaywidget.h"
class QtMaterialSnackbarPrivate;
class QtMaterialSnackbar : public QtMaterialOverlayWidget
{
Q_OBJECT
public:
explicit QtMaterialSnackbar(QWidget *parent = 0);
~QtMaterialSnackbar();
void setAutoHideDuration(int duration);
int autoHideDuration() const;
void setUseThemeColors(bool value);
bool useThemeColors() const;
void setBackgroundColor(const QColor &color);
QColor backgroundColor() const;
void setBackgroundOpacity(qreal opacity);
qreal backgroundOpacity() const;
void setTextColor(const QColor &color);
QColor textColor() const;
void setFontSize(qreal size);
qreal fontSize() const;
void setBoxWidth(int width);
int boxWidth() const;
void setClickToDismissMode(bool value);
bool clickToDismissMode() const;
public slots:
void addMessage(const QString &message);
void addInstantMessage(const QString &message);
protected slots:
void dequeue();
protected:
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
const QScopedPointer<QtMaterialSnackbarPrivate> d_ptr;
private:
Q_DISABLE_COPY(QtMaterialSnackbar)
Q_DECLARE_PRIVATE(QtMaterialSnackbar)
};
#endif // QTMATERIALSNACKBAR_H