diff --git a/src/AlertDialog.cpp b/src/AlertDialog.cpp index 749aa4e..f1f20a0 100644 --- a/src/AlertDialog.cpp +++ b/src/AlertDialog.cpp @@ -12,7 +12,7 @@ AlertDialog::AlertDialog(QWidget *parent, Qt::WindowFlags f) : GUIFormBaseDialog QVBoxLayout* layout = new QVBoxLayout(formWidget); layout->setSpacing(10); // add title - QLabel* lbl_title = new QLabel(this); + lbl_title = new QLabel(this); lbl_title->setAlignment(Qt::AlignCenter); lbl_title->setText(tr("Warning")); lbl_title->setObjectName("title"); @@ -28,3 +28,7 @@ AlertDialog::~AlertDialog() { void AlertDialog::setAlertMessage(const QString &msg) { this->lbl_msg->setText(msg); } + +void AlertDialog::setTitle(const QString &msg) { + lbl_title->setText(msg); +} diff --git a/src/AlertDialog.h b/src/AlertDialog.h index 2cb2574..b816451 100644 --- a/src/AlertDialog.h +++ b/src/AlertDialog.h @@ -12,11 +12,13 @@ public: explicit AlertDialog(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); ~AlertDialog(); void setAlertMessage(const QString& msg); + void setTitle(const QString& msg); protected: bool updateReferenceData() override{return true;} private: QLabel* lbl_msg; + QLabel* lbl_title; };