libyui-qt
Loading...
Searching...
No Matches
YQItemSelector Class Reference
Inheritance diagram for YQItemSelector:
Collaboration diagram for YQItemSelector:

Public Member Functions

 YQItemSelector (YWidget *parent, bool enforceSingleSelection=true)
 
virtual ~YQItemSelector ()
 
virtual void addItem (YItem *item)
 
virtual void addItems (const YItemCollection &itemCollection)
 
virtual void selectItem (YItem *item, bool selected=true)
 
virtual void deselectAllItems ()
 
virtual void deleteAllItems ()
 
virtual void setEnabled (bool enabled)
 
virtual int preferredWidth ()
 
virtual int preferredHeight ()
 
virtual void setSize (int newWidth, int newHeight)
 
virtual bool setKeyboardFocus ()
 
QWidget * itemContainer () const
 
QButtonGroup * buttonGroup () const
 
void addItemWidget (YQSelectorItemWidget *itemWidget)
 
virtual void activateItem (YItem *item)
 
virtual void shortcutChanged ()
 

Protected Slots

void slotSelectionChanged (YQSelectorItemWidget *itemWidget, bool selected)
 

Protected Member Functions

 YQItemSelector (YWidget *parent, const YItemCustomStatusVector &customStates)
 
void init ()
 
void deselectOtherItems (YItem *selectedItem)
 

Protected Attributes

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

Constructor & Destructor Documentation

◆ YQItemSelector() [1/2]

YQItemSelector::YQItemSelector ( YWidget * parent,
bool enforceSingleSelection = true )

Standard constructor.

◆ ~YQItemSelector()

YQItemSelector::~YQItemSelector ( )
virtual

Destructor.

◆ YQItemSelector() [2/2]

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.

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.

◆ addItem()

void YQItemSelector::addItem ( YItem * item)
virtual

Add an item.

Reimplemented from YSelectionWidget.

Reimplemented in YQCustomStatusItemSelector.

◆ addItems()

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

Add multiple items.

Reimplemented for efficiency from YSelectionWidget.

◆ addItemWidget()

void YQItemSelector::addItemWidget ( YQSelectorItemWidget * itemWidget)

Add an item widget to the appropriate layout. Not to confuse with addItem( YItem * ).

◆ buttonGroup()

QButtonGroup * YQItemSelector::buttonGroup ( ) const
inline

Return the QButtonGroup that manages exclusive buttons in single selection mode.

◆ deleteAllItems()

void YQItemSelector::deleteAllItems ( )
virtual

Delete all items.

Reimplemented from YSelectionWidget.

◆ deselectAllItems()

void YQItemSelector::deselectAllItems ( )
virtual

Deselect all items.

Reimplemented from YSelectionWidget.

◆ deselectOtherItems()

void YQItemSelector::deselectOtherItems ( YItem * selectedItem)
protected

Deselect all items except 'selectedItem'.

◆ init()

void YQItemSelector::init ( )
protected

Common initializations for all constructors.

◆ itemContainer()

QWidget * YQItemSelector::itemContainer ( ) const
inline

Return the QWidget that will accept the item widgets.

◆ preferredHeight()

int YQItemSelector::preferredHeight ( )
virtual

Preferred height of the widget.

Reimplemented from YWidget.

◆ preferredWidth()

int YQItemSelector::preferredWidth ( )
virtual

Preferred width of the widget.

Reimplemented from YWidget.

◆ selectItem()

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

Select or deselect an item.

Reimplemented from YSelectionWidget.

Reimplemented in YQCustomStatusItemSelector.

◆ setEnabled()

void YQItemSelector::setEnabled ( bool enabled)
virtual

Set enabled/disabled state.

Reimplemented from YWidget.

◆ setKeyboardFocus()

bool YQItemSelector::setKeyboardFocus ( )
virtual

Accept the keyboard focus.

Reimplemented from YWidget.

◆ setSize()

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

Set the new size of the widget.

Reimplemented from YWidget.

◆ shortcutChanged()

void YQItemSelector::shortcutChanged ( )
virtual

Notification that some shortcut was changed.

Reimplemented from YSelectionWidget.

◆ 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.


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