Fix scroll position being lost when adding or removing macro segments

This commit is contained in:
WarmUpTill
2021-10-21 23:14:09 +02:00
committed by WarmUpTill
parent 4af07d9d55
commit c34308f743
6 changed files with 46 additions and 60 deletions

View File

@@ -213,10 +213,10 @@ void deleteLayoutItem(QLayoutItem *item)
}
}
void clearLayout(QLayout *layout)
void clearLayout(QLayout *layout, int afterIdx)
{
QLayoutItem *item;
while ((item = layout->takeAt(0))) {
while (item = layout->takeAt(afterIdx)) {
if (item->layout()) {
clearLayout(item->layout());
delete item->layout();