mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 09:25:36 -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 <QLayout>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
namespace CalamaresUtils
|
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 QPixmap createRoundedImage( const QPixmap& avatar, const QSize& size, float frameWidthPct = 0.20 );
|
||||||
|
|
||||||
UIDLLEXPORT void unmarginLayout( QLayout* layout );
|
UIDLLEXPORT void unmarginLayout( QLayout* layout );
|
||||||
|
UIDLLEXPORT void clearLayout( QLayout* layout );
|
||||||
|
|
||||||
UIDLLEXPORT void setDefaultFontSize( int points );
|
UIDLLEXPORT void setDefaultFontSize( int points );
|
||||||
UIDLLEXPORT int defaultFontSize();
|
UIDLLEXPORT int defaultFontSize();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue