[libcalamaresui] More careful in unmarginLayout

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

View File

@ -179,6 +179,8 @@ createRoundedImage( const QPixmap& pixmap, const QSize& size, float frameWidthPc
void
unmarginLayout( QLayout* layout )
{
if ( layout )
{
layout->setContentsMargins( 0, 0, 0, 0 );
layout->setMargin( 0 );
@ -186,13 +188,15 @@ unmarginLayout( QLayout* layout )
for ( int i = 0; i < layout->count(); i++ )
{
QLayout* childLayout = layout->itemAt( i )->layout();
auto* childItem = layout->itemAt( i );
QLayout* childLayout = childItem ? childItem->layout() : nullptr;
if ( childLayout )
{
unmarginLayout( childLayout );
}
}
}
}
int