Add setTitle to AlertDialog
This commit is contained in:
@@ -12,7 +12,7 @@ AlertDialog::AlertDialog(QWidget *parent, Qt::WindowFlags f) : GUIFormBaseDialog
|
|||||||
QVBoxLayout* layout = new QVBoxLayout(formWidget);
|
QVBoxLayout* layout = new QVBoxLayout(formWidget);
|
||||||
layout->setSpacing(10);
|
layout->setSpacing(10);
|
||||||
// add title
|
// add title
|
||||||
QLabel* lbl_title = new QLabel(this);
|
lbl_title = new QLabel(this);
|
||||||
lbl_title->setAlignment(Qt::AlignCenter);
|
lbl_title->setAlignment(Qt::AlignCenter);
|
||||||
lbl_title->setText(tr("Warning"));
|
lbl_title->setText(tr("Warning"));
|
||||||
lbl_title->setObjectName("title");
|
lbl_title->setObjectName("title");
|
||||||
@@ -28,3 +28,7 @@ AlertDialog::~AlertDialog() {
|
|||||||
void AlertDialog::setAlertMessage(const QString &msg) {
|
void AlertDialog::setAlertMessage(const QString &msg) {
|
||||||
this->lbl_msg->setText(msg);
|
this->lbl_msg->setText(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AlertDialog::setTitle(const QString &msg) {
|
||||||
|
lbl_title->setText(msg);
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,11 +12,13 @@ public:
|
|||||||
explicit AlertDialog(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
explicit AlertDialog(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||||
~AlertDialog();
|
~AlertDialog();
|
||||||
void setAlertMessage(const QString& msg);
|
void setAlertMessage(const QString& msg);
|
||||||
|
void setTitle(const QString& msg);
|
||||||
protected:
|
protected:
|
||||||
bool updateReferenceData() override{return true;}
|
bool updateReferenceData() override{return true;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QLabel* lbl_msg;
|
QLabel* lbl_msg;
|
||||||
|
QLabel* lbl_title;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user