libyui-qt  2.52.2
YQItemSelector Class Reference
Inheritance diagram for YQItemSelector:
Collaboration diagram for YQItemSelector:

Public Member Functions

 YQItemSelector (YWidget *parent, bool enforceSingleSelection=true)
 Standard constructor.
 
virtual ~YQItemSelector ()
 Destructor.
 
virtual void addItem (YItem *item)
 Add an item. More...
 
virtual void addItems (const YItemCollection &itemCollection)
 Add multiple items. More...
 
virtual void selectItem (YItem *item, bool selected=true)
 Select or deselect an item. 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...
 
virtual void activateItem (YItem *item)
 Activate selected item. More...
 

Protected Slots

void slotSelectionChanged (YQSelectorItemWidget *itemWidget, bool selected)
 Notification that an item has been selected. More...
 

Protected Member Functions

 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

QWidget * _itemContainer
 
QButtonGroup * _buttonGroup
 
QVBoxLayout * _itemLayout
 
QMap< YItem *, YQSelectorItemWidget * > _itemWidgets
 

Detailed Description

Definition at line 42 of file YQItemSelector.h.

Constructor & Destructor Documentation

◆ YQItemSelector()

YQItemSelector::YQItemSelector ( YWidget *  parent,
const YItemCustomStatusVector &  customStates 
)
protected

Constructor for custom item status values.

This is intended for derived classes; this class does not support custom item status values directly.

See YItemSelector and YQCustomStatusItemSelector for more details.

Definition at line 58 of file YQItemSelector.cc.

Here is the call graph for this function:

Member Function Documentation

◆ activateItem()

void YQItemSelector::activateItem ( YItem *  item)
virtual

Activate selected item.

Can be used in tests to simulate user input.

Derived classes are required to implement this.

Reimplemented in YQCustomStatusItemSelector.

Definition at line 295 of file YQItemSelector.cc.

Here is the call graph for this function:

◆ addItem()

void YQItemSelector::addItem ( YItem *  item)
virtual

Add an item.

Reimplemented from YSelectionWidget.

Reimplemented in YQCustomStatusItemSelector.

Definition at line 109 of file YQItemSelector.cc.

Here is the call graph for this function:

◆ addItems()

void YQItemSelector::addItems ( const YItemCollection &  itemCollection)
virtual

Add multiple items.

Reimplemented for efficiency from YSelectionWidget.

Definition at line 128 of file YQItemSelector.cc.

Here is the call graph for this function:

◆ addItemWidget()

void YQItemSelector::addItemWidget ( YQSelectorItemWidget itemWidget)

Add an item widget to the appropriate layout.

Not to confuse with addItem( YItem * ).

Definition at line 98 of file YQItemSelector.cc.

Here is the call graph for this function:

◆ deleteAllItems()

void YQItemSelector::deleteAllItems ( )
virtual

Delete all items.

Reimplemented from YSelectionWidget.

Definition at line 176 of file YQItemSelector.cc.

◆ deselectAllItems()

void YQItemSelector::deselectAllItems ( )
virtual

Deselect all items.

Reimplemented from YSelectionWidget.

Definition at line 152 of file YQItemSelector.cc.

Here is the call graph for this function:

◆ preferredHeight()

int YQItemSelector::preferredHeight ( )
virtual

Preferred height of the widget.

Reimplemented from YWidget.

Definition at line 206 of file YQItemSelector.cc.

◆ preferredWidth()

int YQItemSelector::preferredWidth ( )
virtual

Preferred width of the widget.

Reimplemented from YWidget.

Definition at line 193 of file YQItemSelector.cc.

◆ selectItem()

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

Select or deselect an item.

Reimplemented from YSelectionWidget.

Reimplemented in YQCustomStatusItemSelector.

Definition at line 135 of file YQItemSelector.cc.

Here is the call graph for this function:

◆ setEnabled()

void YQItemSelector::setEnabled ( bool  enabled)
virtual

Set enabled/disabled state.

Reimplemented from YWidget.

Definition at line 187 of file YQItemSelector.cc.

◆ setKeyboardFocus()

bool YQItemSelector::setKeyboardFocus ( )
virtual

Accept the keyboard focus.

Reimplemented from YWidget.

Definition at line 247 of file YQItemSelector.cc.

Here is the call graph for this function:

◆ setSize()

void YQItemSelector::setSize ( int  newWidth,
int  newHeight 
)
virtual

Set the new size of the widget.

Reimplemented from YWidget.

Definition at line 241 of file YQItemSelector.cc.

◆ slotSelectionChanged

void YQItemSelector::slotSelectionChanged ( YQSelectorItemWidget itemWidget,
bool  selected 
)
protectedslot

Notification that an item has been selected.

This is only relevant if opt(notify ) is set.

Definition at line 264 of file YQItemSelector.cc.

Here is the call graph for this function:

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