Move PrepareCheckWidget text out of ctor.
This commit is contained in:
parent
9b2dfdf1ec
commit
280baf7326
@ -23,8 +23,7 @@
|
||||
|
||||
#include <QBoxLayout>
|
||||
|
||||
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 );
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user