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);
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user