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) {
|
WizardConclusionPage::WizardConclusionPage(QString msg, QVector<QString> fields) {
|
||||||
m_baseMsg = msg;
|
m_baseMsg = msg;
|
||||||
m_fields = fields;
|
m_fields = fields;
|
||||||
|
setLayout(new QVBoxLayout(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
WizardConclusionPage::~WizardConclusionPage() {
|
WizardConclusionPage::~WizardConclusionPage() {
|
||||||
@ -84,10 +85,15 @@ void WizardConclusionPage::initializePage() {
|
|||||||
for (auto field : m_fields) {
|
for (auto field : m_fields) {
|
||||||
msg = msg.arg(this->field(field).toString());
|
msg = msg.arg(this->field(field).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
auto text = new QLabel(msg, this);
|
auto text = new QLabel(msg, this);
|
||||||
auto layout = new QVBoxLayout(this);
|
if (m_text) {
|
||||||
layout->addWidget(text);
|
layout()->replaceWidget(m_text, text);
|
||||||
setLayout(layout);
|
delete m_text;
|
||||||
|
} else {
|
||||||
|
layout()->addWidget(text);
|
||||||
|
}
|
||||||
|
m_text = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -81,6 +81,7 @@ class WizardConclusionPage: public QWizardPage {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
private:
|
||||||
QString m_baseMsg = "";
|
QString m_baseMsg = "";
|
||||||
|
QLabel *m_text = nullptr;
|
||||||
QVector<QString> m_fields;
|
QVector<QString> m_fields;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user