Allow overlap layouts to insert widgets at specific positions.

This commit is contained in:
Lukas Brübach 2025-06-13 04:17:31 +02:00
parent dcd63e4a7f
commit c4238838e7
5 changed files with 17 additions and 2 deletions

View file

@ -54,6 +54,14 @@ OverlapLayout::~OverlapLayout()
}
}
void OverlapLayout::insertWidgetAtIndex(QWidget *toInsert, int index)
{
addChildWidget(toInsert);
itemList.insert(qBound(0, index, std::max(0, static_cast<int>(itemList.size()))), new QWidgetItem(toInsert));
invalidate();
}
/**
* @brief Adds a new item to the layout.
*