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;
314 #endif // YQItemSelector_h
void deselectOtherItems(YItem *selectedItem)
Deselect all items except 'selectedItem'.
virtual void addItems(const YItemCollection &itemCollection)
Add multiple items.
virtual int preferredHeight()
Preferred height of the widget.
QButtonGroup * buttonGroup() const
Return the QButtonGroup that manages exclusive buttons in single selection mode.
virtual void setSize(int newWidth, int newHeight)
Set the new size of the widget.
void init()
Common initializations for all constructors.
YQItemSelector(YWidget *parent, bool enforceSingleSelection=true)
Standard constructor.
virtual bool setKeyboardFocus()
Accept the keyboard focus.
void slotSelectionChanged(YQSelectorItemWidget *itemWidget, bool selected)
Notification that an item has been selected.
virtual void activateItem(YItem *item)
Activate selected item.
virtual int preferredWidth()
Preferred width of the widget.
virtual void setEnabled(bool enabled)
Set enabled/disabled state.
virtual void selectItem(YItem *item, bool selected=true)
Select or deselect an item.
virtual void deselectAllItems()
Deselect all items.
void addItemWidget(YQSelectorItemWidget *itemWidget)
Add an item widget to the appropriate layout.
QWidget * itemContainer() const
Return the QWidget that will accept the item widgets.
virtual void addItem(YItem *item)
Add an item.
virtual ~YQItemSelector()
Destructor.
virtual void deleteAllItems()
Delete all items.