return item;
}
+ //----------------------------------------------------------------------------
+ void BoxLayout::clear()
+ {
+ _layout_items.clear();
+ invalidate();
+ }
+
//----------------------------------------------------------------------------
void BoxLayout::setStretch(size_t index, int stretch)
{
virtual size_t count() const;
virtual LayoutItemRef itemAt(size_t index);
virtual LayoutItemRef takeAt(size_t index);
+ virtual void clear();
/**
* Set the stretch factor of the item at position @a index to @a stretch.
}
}
+ //----------------------------------------------------------------------------
+ void Layout::clear()
+ {
+ while( itemAt(0) )
+ takeAt(0);
+ }
+
//----------------------------------------------------------------------------
void Layout::ItemData::reset()
{
*/
void removeItem(const LayoutItemRef& item);
+ /**
+ * Remove all items.
+ */
+ virtual void clear();
+
protected:
enum LayoutFlags
{
hbox.removeItem(w2);
BOOST_CHECK_EQUAL(hbox.count(), 1);
BOOST_CHECK_EQUAL(hbox.itemAt(0), w1);
+
+ hbox.addItem(w2);
+ BOOST_CHECK_EQUAL(hbox.count(), 2);
+
+ hbox.clear();
+ BOOST_CHECK_EQUAL(hbox.count(), 0);
}
//------------------------------------------------------------------------------