-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAlertBox.h
More file actions
50 lines (36 loc) · 1.18 KB
/
AlertBox.h
File metadata and controls
50 lines (36 loc) · 1.18 KB
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
#ifndef ALERTBOX_H
#define ALERTBOX_H
#include <QObject>
class AlertBox : public QObject
{
Q_OBJECT
Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged)
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
Q_PROPERTY(QString message READ message WRITE setMessage NOTIFY messageChanged)
Q_PROPERTY(QString description READ description WRITE setDescription NOTIFY descriptionChanged)
signals:
void activeChanged();
void titleChanged();
void messageChanged();
void descriptionChanged();
public slots:
void hide();
public:
static AlertBox& instance();
Q_INVOKABLE void showMessage(const QString& title, const QString& message, const QString& description);
private:
QString mTitle;
QString mMessage;
QString mDescription;
bool mIsActive;
AlertBox(QObject *parent=nullptr);
QString title() const;
void setTitle(const QString& title);
QString message() const;
void setMessage(const QString& message);
QString description() const;
void setDescription(const QString& description);
bool isActive() const;
void setActive(const bool active);
};
#endif // ALERTBOX_H