[summary] Tighten up scope of declarations, simplify

This commit is contained in:
Adriaan de Groot 2021-10-04 11:27:10 +02:00
parent 329f21093b
commit 8f4ba8c21f

View File

@ -27,8 +27,6 @@
#include <QLabel>
#include <QScrollArea>
static const int SECTION_SPACING = 12;
SummaryPage::SummaryPage( Config* config, const SummaryViewStep* thisViewStep, QWidget* parent )
: QWidget()
, m_thisViewStep( thisViewStep )
@ -89,6 +87,8 @@ createBodyLabel( const QString& text, const QPalette& bodyPalette )
void
SummaryPage::onActivate()
{
const int SECTION_SPACING = 12;
delete m_contentWidget; // It might have been created previously
m_contentWidget = new QWidget;
m_layout = new QVBoxLayout( m_contentWidget );
@ -114,14 +114,11 @@ SummaryPage::onActivate()
continue;
}
if ( first )
{
first = false;
}
else
if ( !first )
{
m_layout->addSpacing( SECTION_SPACING );
}
first = false;
m_layout->addWidget( createTitleLabel( step->prettyName(), titleFont ) );
QHBoxLayout* itemBodyLayout = new QHBoxLayout;