void Description::deleteWidgets() { for (WidgetsList::iterator i = widgets.begin(); i != widgets.end(); i++) area.remove(*i); widgets.clear(); }
void ListBox::sortItems() { WidgetsList widgets = getChildren(); std::sort(widgets.begin(), widgets.end(), &sort_by_text); // Remove all children and add then again. removeAllChildren(); for (Widget* child : widgets) addChild(child); }
void Widget::getParents(bool ascendant, WidgetsList& parents) { for (Widget* widget=this; widget; widget=widget->m_parent) { // append parents in tail if (ascendant) parents.push_back(widget); // append parents in head else parents.insert(parents.begin(), widget); } }