mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-16 07:22:16 -07:00
Allow overlap layouts to insert widgets at specific positions.
This commit is contained in:
parent
dcd63e4a7f
commit
c4238838e7
5 changed files with 17 additions and 2 deletions
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue