libyui-qt
2.52.2
|
ItemSelector widget with support for custom status values, not just 0 or 1. More...
#include <YQCustomStatusItemSelector.h>
Public Member Functions | |
YQCustomStatusItemSelector (YWidget *parent, const YItemCustomStatusVector &customStates) | |
Constructor. | |
virtual | ~YQCustomStatusItemSelector () |
Destructor. | |
virtual void | addItem (YItem *item) |
Add an item. More... | |
virtual void | selectItem (YItem *item, bool selected=true) |
Select or deselect an item. More... | |
const QIcon & | statusIcon (int status) const |
Return the status icon for the specified status. | |
virtual void | activateItem (YItem *item) |
Activate selected item. More... | |
![]() | |
YQItemSelector (YWidget *parent, bool enforceSingleSelection=true) | |
Standard constructor. | |
virtual | ~YQItemSelector () |
Destructor. | |
virtual void | addItems (const YItemCollection &itemCollection) |
Add multiple items. More... | |
virtual void | deselectAllItems () |
Deselect all items. More... | |
virtual void | deleteAllItems () |
Delete all items. More... | |
virtual void | setEnabled (bool enabled) |
Set enabled/disabled state. More... | |
virtual int | preferredWidth () |
Preferred width of the widget. More... | |
virtual int | preferredHeight () |
Preferred height of the widget. More... | |
virtual void | setSize (int newWidth, int newHeight) |
Set the new size of the widget. More... | |
virtual bool | setKeyboardFocus () |
Accept the keyboard focus. More... | |
QWidget * | itemContainer () const |
Return the QWidget that will accept the item widgets. | |
QButtonGroup * | buttonGroup () const |
Return the QButtonGroup that manages exclusive buttons in single selection mode. | |
void | addItemWidget (YQSelectorItemWidget *itemWidget) |
Add an item widget to the appropriate layout. More... | |
Protected Slots | |
void | itemClicked (YQCustomStatusSelectorItemWidget *itemWidget) |
Cycle the status of an item and report the click to the calling application. | |
![]() | |
void | slotSelectionChanged (YQSelectorItemWidget *itemWidget, bool selected) |
Notification that an item has been selected. More... | |
Protected Member Functions | |
void | preloadStatusIcons () |
Preload and cache the status icons. | |
virtual void | updateCustomStatusIndicator (YItem *item) |
Update the status indicator (the status icon) for an item. More... | |
![]() | |
YQItemSelector (YWidget *parent, const YItemCustomStatusVector &customStates) | |
Constructor for custom item status values. More... | |
void | init () |
Common initializations for all constructors. | |
void | deselectOtherItems (YItem *selectedItem) |
Deselect all items except 'selectedItem'. | |
Protected Attributes | |
QList< QIcon > | _statusIcons |
![]() | |
QWidget * | _itemContainer |
QButtonGroup * | _buttonGroup |
QVBoxLayout * | _itemLayout |
QMap< YItem *, YQSelectorItemWidget * > | _itemWidgets |
ItemSelector widget with support for custom status values, not just 0 or 1.
This does not use a standard QCheckBox or QRadioButton, but a QToolButton with an icon that is exchanged whenever the status changes.
Definition at line 41 of file YQCustomStatusItemSelector.h.
|
virtual |
Activate selected item.
Can be used in tests to simulate user input.
Derived classes are required to implement this.
Reimplemented from YQItemSelector.
Definition at line 144 of file YQCustomStatusItemSelector.cc.
|
virtual |
Add an item.
Reimplemented from YQItemSelector / YSelectionWidget.
Reimplemented from YQItemSelector.
Definition at line 59 of file YQCustomStatusItemSelector.cc.
|
virtual |
Select or deselect an item.
Reimplemented from YSelectionWidget.
Reimplemented from YQItemSelector.
Definition at line 80 of file YQCustomStatusItemSelector.cc.
|
protectedvirtual |
Update the status indicator (the status icon) for an item.
Reimplemented from YItemSelector.
Definition at line 99 of file YQCustomStatusItemSelector.cc.