diff --git a/src/modules/prepare/PrepareCheckWidget.cpp b/src/modules/prepare/PrepareCheckWidget.cpp index cabc5dfce..ceeb1d25e 100644 --- a/src/modules/prepare/PrepareCheckWidget.cpp +++ b/src/modules/prepare/PrepareCheckWidget.cpp @@ -23,8 +23,7 @@ #include -PrepareCheckWidget::PrepareCheckWidget( const QString &text, - bool checked, +PrepareCheckWidget::PrepareCheckWidget( bool checked, QWidget* parent ) : QWidget( parent ) { @@ -34,7 +33,7 @@ PrepareCheckWidget::PrepareCheckWidget( const QString &text, m_iconLabel = new QLabel( this ); mainLayout->addWidget( m_iconLabel ); m_iconLabel->setFixedSize( CalamaresUtils::defaultIconSize() ); - m_textLabel = new QLabel( text, this ); + m_textLabel = new QLabel( this ); mainLayout->addWidget( m_textLabel ); m_textLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ); @@ -49,3 +48,10 @@ PrepareCheckWidget::PrepareCheckWidget( const QString &text, QSize( m_iconLabel->height(), m_iconLabel->height() ) ) ); } + + +void +PrepareCheckWidget::setText( const QString& text ) +{ + m_textLabel->setText( text ); +} diff --git a/src/modules/prepare/PrepareCheckWidget.h b/src/modules/prepare/PrepareCheckWidget.h index 43efad018..ac7769675 100644 --- a/src/modules/prepare/PrepareCheckWidget.h +++ b/src/modules/prepare/PrepareCheckWidget.h @@ -25,9 +25,10 @@ class PrepareCheckWidget : public QWidget { Q_OBJECT public: - explicit PrepareCheckWidget( const QString &text, - bool checked, + explicit PrepareCheckWidget( bool checked, QWidget* parent = nullptr ); + + void setText( const QString& text ); private: QLabel* m_textLabel; QLabel* m_iconLabel; diff --git a/src/modules/prepare/PreparePage.cpp b/src/modules/prepare/PreparePage.cpp index c38ef8d46..028044c0a 100644 --- a/src/modules/prepare/PreparePage.cpp +++ b/src/modules/prepare/PreparePage.cpp @@ -59,7 +59,8 @@ PreparePage::init( const QList< PrepareEntry >& checkEntries ) for ( const PrepareEntry& entry : checkEntries ) { - PrepareCheckWidget* pcw = new PrepareCheckWidget( entry.text, entry.checked ); + PrepareCheckWidget* pcw = new PrepareCheckWidget( entry.checked ); + pcw->setText( entry.text ); m_entriesLayout->addWidget( pcw ); pcw->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );