Move PrepareCheckWidget text out of ctor.
This commit is contained in:
parent
9b2dfdf1ec
commit
280baf7326
@ -23,8 +23,7 @@
|
|||||||
|
|
||||||
#include <QBoxLayout>
|
#include <QBoxLayout>
|
||||||
|
|
||||||
PrepareCheckWidget::PrepareCheckWidget( const QString &text,
|
PrepareCheckWidget::PrepareCheckWidget( bool checked,
|
||||||
bool checked,
|
|
||||||
QWidget* parent )
|
QWidget* parent )
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
{
|
{
|
||||||
@ -34,7 +33,7 @@ PrepareCheckWidget::PrepareCheckWidget( const QString &text,
|
|||||||
m_iconLabel = new QLabel( this );
|
m_iconLabel = new QLabel( this );
|
||||||
mainLayout->addWidget( m_iconLabel );
|
mainLayout->addWidget( m_iconLabel );
|
||||||
m_iconLabel->setFixedSize( CalamaresUtils::defaultIconSize() );
|
m_iconLabel->setFixedSize( CalamaresUtils::defaultIconSize() );
|
||||||
m_textLabel = new QLabel( text, this );
|
m_textLabel = new QLabel( this );
|
||||||
mainLayout->addWidget( m_textLabel );
|
mainLayout->addWidget( m_textLabel );
|
||||||
m_textLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
m_textLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||||
|
|
||||||
@ -49,3 +48,10 @@ PrepareCheckWidget::PrepareCheckWidget( const QString &text,
|
|||||||
QSize( m_iconLabel->height(),
|
QSize( m_iconLabel->height(),
|
||||||
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
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit PrepareCheckWidget( const QString &text,
|
explicit PrepareCheckWidget( bool checked,
|
||||||
bool checked,
|
|
||||||
QWidget* parent = nullptr );
|
QWidget* parent = nullptr );
|
||||||
|
|
||||||
|
void setText( const QString& text );
|
||||||
private:
|
private:
|
||||||
QLabel* m_textLabel;
|
QLabel* m_textLabel;
|
||||||
QLabel* m_iconLabel;
|
QLabel* m_iconLabel;
|
||||||
|
@ -59,7 +59,8 @@ PreparePage::init( const QList< PrepareEntry >& checkEntries )
|
|||||||
|
|
||||||
for ( const PrepareEntry& entry : 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 );
|
m_entriesLayout->addWidget( pcw );
|
||||||
pcw->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
pcw->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user