qt/util.c: clearLayout, support QFormLayout (#28105)

old-commit-hash: 7a31bd12af859b44ad40315aafa791a1c2eab3f6
This commit is contained in:
Willem Melching
2023-05-04 19:59:37 +02:00
committed by GitHub
parent 188aea549c
commit 075df3ec20

View File

@@ -59,7 +59,8 @@ void configFont(QPainter &p, const QString &family, int size, const QString &sty
}
void clearLayout(QLayout* layout) {
while (QLayoutItem* item = layout->takeAt(0)) {
while (layout->count() > 0) {
QLayoutItem* item = layout->takeAt(0);
if (QWidget* widget = item->widget()) {
widget->deleteLater();
}