Add clearLayout to CalamaresUtilsGui.
This commit is contained in:
parent
c404b0e38b
commit
8064736580
@ -26,6 +26,7 @@
|
||||
#include <QLayout>
|
||||
#include <QPainter>
|
||||
#include <QPen>
|
||||
#include <QWidget>
|
||||
|
||||
namespace CalamaresUtils
|
||||
{
|
||||
@ -212,4 +213,20 @@ defaultIconSize()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
clearLayout( QLayout* layout )
|
||||
{
|
||||
while ( QLayoutItem* item = layout->takeAt( 0 ) )
|
||||
{
|
||||
if ( QWidget* widget = item->widget() )
|
||||
widget->deleteLater();
|
||||
|
||||
if ( QLayout* childLayout = item->layout() )
|
||||
clearLayout( childLayout );
|
||||
|
||||
delete item;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -60,6 +60,7 @@ UIDLLEXPORT QPixmap defaultPixmap( ImageType type, ImageMode mode = CalamaresUti
|
||||
UIDLLEXPORT QPixmap createRoundedImage( const QPixmap& avatar, const QSize& size, float frameWidthPct = 0.20 );
|
||||
|
||||
UIDLLEXPORT void unmarginLayout( QLayout* layout );
|
||||
UIDLLEXPORT void clearLayout( QLayout* layout );
|
||||
|
||||
UIDLLEXPORT void setDefaultFontSize( int points );
|
||||
UIDLLEXPORT int defaultFontSize();
|
||||
|
Loading…
Reference in New Issue
Block a user