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 );
182 const YItemCustomStatusVector & customStates );
198 QWidget * _itemContainer;
199 QButtonGroup * _buttonGroup;
200 QVBoxLayout * _itemLayout;
202 QMap<YItem *, YQSelectorItemWidget *> _itemWidgets;
259 void setLabel(
const QString & label );
273 QLabel * descriptionLabel()
const {
return _descriptionLabel; }
274 QLabel * iconLabel()
const {
return _iconLabel; }
275 YItem * item()
const {
return _item; }
284 void slotSelectionChanged(
bool selected );
290 const std::string & description,
291 const std::string & iconName,
320 QAbstractButton * _headingToggle;
321 QLabel * _descriptionLabel;
328 #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.
virtual void shortcutChanged()
Notification that some shortcut was changed.