Fix issue with deleting old labels in wizard conclusion
This commit is contained in:
parent
9b46116a83
commit
eec9a9d730
@ -74,6 +74,7 @@ void WizardSelect::itemSelected(int row) {
|
||||
WizardConclusionPage::WizardConclusionPage(QString msg, QVector<QString> fields) {
|
||||
m_baseMsg = msg;
|
||||
m_fields = fields;
|
||||
setLayout(new QVBoxLayout(this));
|
||||
}
|
||||
|
||||
WizardConclusionPage::~WizardConclusionPage() {
|
||||
@ -84,10 +85,15 @@ void WizardConclusionPage::initializePage() {
|
||||
for (auto field : m_fields) {
|
||||
msg = msg.arg(this->field(field).toString());
|
||||
}
|
||||
|
||||
auto text = new QLabel(msg, this);
|
||||
auto layout = new QVBoxLayout(this);
|
||||
layout->addWidget(text);
|
||||
setLayout(layout);
|
||||
if (m_text) {
|
||||
layout()->replaceWidget(m_text, text);
|
||||
delete m_text;
|
||||
} else {
|
||||
layout()->addWidget(text);
|
||||
}
|
||||
m_text = text;
|
||||
}
|
||||
|
||||
|
||||
|
@ -81,6 +81,7 @@ class WizardConclusionPage: public QWizardPage {
|
||||
Q_OBJECT
|
||||
private:
|
||||
QString m_baseMsg = "";
|
||||
QLabel *m_text = nullptr;
|
||||
QVector<QString> m_fields;
|
||||
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user