Added ability to clear items in vertical layout.
This commit is contained in:
parent
4a0c3ead7a
commit
c197c1831d
2 changed files with 8 additions and 0 deletions
|
|
@ -198,4 +198,10 @@ void VerticalLayout::removeChild(RpWidget *child) {
|
|||
resize(width(), margins.top() + top + margins.bottom());
|
||||
}
|
||||
|
||||
void VerticalLayout::clear() {
|
||||
while (!_rows.empty()) {
|
||||
removeChild(_rows.front().widget.data());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Ui
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ public:
|
|||
void setVerticalShift(int index, int shift);
|
||||
void reorderRows(int oldIndex, int newIndex);
|
||||
|
||||
void clear();
|
||||
|
||||
protected:
|
||||
int resizeGetHeight(int newWidth) override;
|
||||
void visibleTopBottomUpdated(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue