Member function to clear all items from a ListScene
This commit is contained in:
@@ -49,9 +49,7 @@ namespace Widgets
|
||||
}
|
||||
|
||||
void ListScene::setItems(const ListScene::ListItemSetType& items) {
|
||||
for (auto& item : this->items()) {
|
||||
this->removeItem(item);
|
||||
}
|
||||
this->clearListItems();
|
||||
|
||||
this->listItems = items;
|
||||
|
||||
@@ -70,6 +68,11 @@ namespace Widgets
|
||||
this->removeItem(item);
|
||||
}
|
||||
|
||||
void ListScene::clearListItems() {
|
||||
this->listItems.clear();
|
||||
this->clear();
|
||||
}
|
||||
|
||||
void ListScene::setEnabled(bool enabled) {
|
||||
if (this->enabled == enabled) {
|
||||
return;
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace Widgets
|
||||
void setItems(const ListScene::ListItemSetType& items);
|
||||
void addListItem(ListItem* item);
|
||||
void removeListItem(ListItem* item);
|
||||
void clearListItems();
|
||||
void setEnabled(bool enabled);
|
||||
|
||||
signals:
|
||||
|
||||
Reference in New Issue
Block a user