libyui-qt  2.52.4
YQCustomStatusItemSelector Class Reference

ItemSelector widget with support for custom status values, not just 0 or 1. More...

#include <YQCustomStatusItemSelector.h>

Inheritance diagram for YQCustomStatusItemSelector:
Collaboration diagram for YQCustomStatusItemSelector:

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...
 
- Public Member Functions inherited from YQItemSelector
 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.
 
- Protected Slots inherited from YQItemSelector
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...
 
- Protected Member Functions inherited from YQItemSelector
 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
 
- Protected Attributes inherited from YQItemSelector
QWidget * _itemContainer
 
QButtonGroup * _buttonGroup
 
QVBoxLayout * _itemLayout
 
QMap< YItem *, YQSelectorItemWidget * > _itemWidgets
 

Detailed Description

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.

Member Function Documentation

◆ activateItem()

void YQCustomStatusItemSelector::activateItem ( YItem *  item)
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.

Here is the call graph for this function:

◆ addItem()

void YQCustomStatusItemSelector::addItem ( YItem *  item)
virtual

Add an item.

Reimplemented from YQItemSelector / YSelectionWidget.

Reimplemented from YQItemSelector.

Definition at line 59 of file YQCustomStatusItemSelector.cc.

Here is the call graph for this function:

◆ selectItem()

void YQCustomStatusItemSelector::selectItem ( YItem *  item,
bool  selected = true 
)
virtual

Select or deselect an item.

Reimplemented from YSelectionWidget.

Reimplemented from YQItemSelector.

Definition at line 80 of file YQCustomStatusItemSelector.cc.

Here is the call graph for this function:

◆ updateCustomStatusIndicator()

void YQCustomStatusItemSelector::updateCustomStatusIndicator ( YItem *  item)
protectedvirtual

Update the status indicator (the status icon) for an item.

Reimplemented from YItemSelector.

Definition at line 99 of file YQCustomStatusItemSelector.cc.

Here is the call graph for this function:

The documentation for this class was generated from the following files: