blob: a0eccc35ebe41cd5901d57005a374926ffce39e5 (
plain)
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
|
#ifndef BOOTSTRAP_HXX
#define BOOTSTRAP_HXX
#include <QObject>
#include <QtQml>
class Bootstrap : public QObject
{
Q_OBJECT
Q_PROPERTY(Theme theme READ theme WRITE setTheme NOTIFY themeChanged)
Q_PROPERTY(Purpose purpose READ purpose WRITE setPurpose NOTIFY purposeChanged)
public:
explicit Bootstrap(QObject *parent = nullptr);
static Bootstrap *qmlAttachedProperties(QObject *object);
enum class Theme {
Light,
Dark
};
enum class Purpose {
None,
Primary,
Secondary,
Success,
Danger,
Warning,
Info,
Light,
Dark,
Link
};
Q_ENUM(Theme)
Q_ENUM(Purpose)
Theme theme() const;
void setTheme(Theme theme);
Purpose purpose() const;
void setPurpose(Purpose purpose);
signals:
void themeChanged();
void purposeChanged();
private:
Theme m_theme;
Purpose m_purpose;
};
QML_DECLARE_TYPEINFO(Bootstrap, QML_HAS_ATTACHED_PROPERTIES)
#endif
|