diff --git a/src/studio/lib/newwizard.cpp b/src/studio/lib/newwizard.cpp index 418649d6..ebc6f316 100644 --- a/src/studio/lib/newwizard.cpp +++ b/src/studio/lib/newwizard.cpp @@ -74,6 +74,7 @@ void WizardSelect::itemSelected(int row) { WizardConclusionPage::WizardConclusionPage(QString msg, QVector 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; } diff --git a/src/studio/lib/newwizard.hpp b/src/studio/lib/newwizard.hpp index 86b5a86f..0961637e 100644 --- a/src/studio/lib/newwizard.hpp +++ b/src/studio/lib/newwizard.hpp @@ -81,6 +81,7 @@ class WizardConclusionPage: public QWizardPage { Q_OBJECT private: QString m_baseMsg = ""; + QLabel *m_text = nullptr; QVector m_fields; public: