mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 01:15:38 -04:00
Add clearLayout to CalamaresUtilsGui.
This commit is contained in:
parent
c404b0e38b
commit
8064736580
2 changed files with 18 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue