mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-17 07:52:16 -07:00
Raise trailing widgets on overlap layout widget insertion.
This commit is contained in:
parent
f9e4503f24
commit
066d806c27
1 changed files with 6 additions and 1 deletions
|
|
@ -57,7 +57,12 @@ OverlapLayout::~OverlapLayout()
|
||||||
void OverlapLayout::insertWidgetAtIndex(QWidget *toInsert, int index)
|
void OverlapLayout::insertWidgetAtIndex(QWidget *toInsert, int index)
|
||||||
{
|
{
|
||||||
addChildWidget(toInsert);
|
addChildWidget(toInsert);
|
||||||
itemList.insert(qBound(0, index, std::max(0, static_cast<int>(itemList.size()))), new QWidgetItem(toInsert));
|
int clampedIndex = qBound(0, index, std::max(0, static_cast<int>(itemList.size())));
|
||||||
|
itemList.insert(clampedIndex, new QWidgetItem(toInsert));
|
||||||
|
|
||||||
|
for (int i = clampedIndex; i < itemList.size(); ++i) {
|
||||||
|
dynamic_cast<QWidgetItem *>(itemList.at(i))->widget()->raise();
|
||||||
|
}
|
||||||
|
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue