mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
Actually make widgets track their indices.
This commit is contained in:
parent
59998b38c2
commit
8032e7fea1
13 changed files with 213 additions and 246 deletions
|
|
@ -548,6 +548,14 @@ void FlowLayout::addItem(QLayoutItem *item)
|
|||
}
|
||||
}
|
||||
|
||||
void FlowLayout::insertWidgetAtIndex(QWidget *toInsert, int index)
|
||||
{
|
||||
addChildWidget(toInsert);
|
||||
items.insert(qBound(0, index, std::max(0, static_cast<int>(items.size()))), new QWidgetItem(toInsert));
|
||||
|
||||
invalidate();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieves the count of items in the layout.
|
||||
* @return The number of layout items.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue