17 #ifndef MESSAGEDIALOG_H
18 #define MESSAGEDIALOG_H
20 #include <QMessageBox>
22 class MessageDialog :
public QObject
25 Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
26 Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
27 Q_PROPERTY(
int buttons READ buttons WRITE setButtons NOTIFY buttonsChanged)
30 enum StandardButtons {
32 Yes = QMessageBox::Yes,
34 Cancel = QMessageBox::Cancel
36 Q_ENUM(StandardButtons)
37 explicit MessageDialog(QObject *parent =
nullptr);
39 Q_INVOKABLE
void open();
42 void titleChanged(
const QString &title);
43 void textChanged(
const QString &text);
44 void buttonsChanged(
int buttons);
53 QString title()
const {
return m_title; }
54 void setTitle(
const QString &title);
55 QString text()
const {
return m_text; }
56 void setText(
const QString &text);
57 int buttons()
const {
return m_buttons; }
58 void setButtons(
int buttons);