Fix Windows FlowWidget duplication (#5460)

- Delete the item widget right away, as the delay is too great with deleteLater
This commit is contained in:
Zach H 2025-01-13 23:33:21 -05:00 committed by GitHub
parent 767e83c879
commit 6309e7e318
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -102,8 +102,8 @@ void FlowWidget::clearLayout()
if (flowLayout != nullptr) {
QLayoutItem *item;
while ((item = flowLayout->takeAt(0)) != nullptr) {
item->widget()->deleteLater(); // Delete the widget
delete item; // Delete the layout item
delete item->widget(); // Delete the widget
delete item; // Delete the layout item
}
} else {
if (scrollArea->horizontalScrollBarPolicy() != Qt::ScrollBarAlwaysOff &&