26 #ifndef YQItemSelector_h
27 #define YQItemSelector_h
29 #include <QScrollArea>
32 #include <yui/YItemSelector.h>
52 bool enforceSingleSelection =
true );
66 virtual void addItem( YItem * item );
73 virtual void addItems(
const YItemCollection & itemCollection );
80 virtual void selectItem( YItem * item,
bool selected =
true );
122 virtual void setSize(
int newWidth,
int newHeight );
175 const YItemCustomStatusVector & customStates );
191 QWidget * _itemContainer;
192 QButtonGroup * _buttonGroup;
193 QVBoxLayout * _itemLayout;
195 QMap<YItem *, YQSelectorItemWidget *> _itemWidgets;
259 QLabel * descriptionLabel()
const {
return _descriptionLabel; }
260 QLabel * iconLabel()
const {
return _iconLabel; }
261 YItem * item()
const {
return _item; }
270 void slotSelectionChanged(
bool selected );
276 const std::string & description,
277 const std::string & iconName,
306 QAbstractButton * _headingToggle;
307 QLabel * _descriptionLabel;
virtual void activateItem(YItem *item)
Activate selected item.
void addItemWidget(YQSelectorItemWidget *itemWidget)
Add an item widget to the appropriate layout.
virtual bool setKeyboardFocus()
Accept the keyboard focus.
QWidget * itemContainer() const
Return the QWidget that will accept the item widgets.
void init()
Common initializations for all constructors.
virtual void deselectAllItems()
Deselect all items.
virtual int preferredWidth()
Preferred width of the widget.
virtual ~YQItemSelector()
Destructor.
void slotSelectionChanged(YQSelectorItemWidget *itemWidget, bool selected)
Notification that an item has been selected.
YQItemSelector(YWidget *parent, bool enforceSingleSelection=true)
Standard constructor.
virtual void deleteAllItems()
Delete all items.
virtual void setEnabled(bool enabled)
Set enabled/disabled state.
virtual int preferredHeight()
Preferred height of the widget.
virtual void selectItem(YItem *item, bool selected=true)
Select or deselect an item.
virtual void addItems(const YItemCollection &itemCollection)
Add multiple items.
virtual void addItem(YItem *item)
Add an item.
virtual void setSize(int newWidth, int newHeight)
Set the new size of the widget.
void deselectOtherItems(YItem *selectedItem)
Deselect all items except 'selectedItem'.
QButtonGroup * buttonGroup() const
Return the QButtonGroup that manages exclusive buttons in single selection mode.