libyui-qt  2.52.4
YQSelectorItemWidget Class Reference

Class for the widgets of one ItemSelector item. More...

#include <YQItemSelector.h>

Inheritance diagram for YQSelectorItemWidget:
Collaboration diagram for YQSelectorItemWidget:

Signals

void selectionChanged (YQSelectorItemWidget *itemWidget, bool selected)
 

Public Member Functions

 YQSelectorItemWidget (YQItemSelector *parent, YItem *item)
 Constructor.
 
virtual ~YQSelectorItemWidget ()
 Destructor.
 
virtual void createWidgets ()
 Create the subwidgets. More...
 
virtual void setSelected (bool sel=true)
 Select the appropriate widget according to the parent's selection policy (single or multi selection).
 
virtual bool selected () const
 Return 'true' if this item is selected, 'false' otherwise.
 
bool singleSelection () const
 Return 'true' if the parent YItemSelector has single selection (1-of-n).
 
bool multiSelection () const
 Return 'true' if the parent YItemSelector has multi selection (n-of-m).
 
QAbstractButton * headingToggle () const
 Return the widget that handles the selection: Either a QRadioButton or a QCheckBox. More...
 
YQItemSelectorparent () const
 
QLabel * descriptionLabel () const
 
QLabel * iconLabel () const
 
YItem * item () const
 

Protected Slots

void slotSelectionChanged (bool selected)
 

Protected Member Functions

virtual void createWidgets (const std::string &label, const std::string &description, const std::string &iconName, bool selected=false)
 
virtual QAbstractButton * createHeadingToggle (const std::string &label, QWidget *parent)
 Create the appropriate toggle button for this item and connect it to appropriate slots. More...
 
virtual int itemDescriptionIndent () const
 Return the amount of indentation in pixels for the description text.
 

Protected Attributes

YQItemSelector_parent
 
YItem * _item
 
QHBoxLayout * _hBox
 
QVBoxLayout * _vBox
 
QAbstractButton * _headingToggle
 
QLabel * _descriptionLabel
 
QLabel * _iconLabel
 

Detailed Description

Class for the widgets of one ItemSelector item.

Definition at line 204 of file YQItemSelector.h.

Member Function Documentation

◆ createHeadingToggle()

QAbstractButton * YQSelectorItemWidget::createHeadingToggle ( const std::string &  label,
QWidget *  parent 
)
protectedvirtual

Create the appropriate toggle button for this item and connect it to appropriate slots.

This base class will create a QRadioButton or a QCheckBox, depending on the parent YQItemSelector's single or multi selection mode.

Derived classes can overwrite this to create a different widget.

Reimplemented in YQCustomStatusSelectorItemWidget.

Definition at line 447 of file YQItemSelector.cc.

Here is the call graph for this function:

◆ createWidgets()

void YQSelectorItemWidget::createWidgets ( )
virtual

Create the subwidgets.

This needs to be called from the outside immediately after creating an instance of this class.

Definition at line 319 of file YQItemSelector.cc.

◆ headingToggle()

QAbstractButton* YQSelectorItemWidget::headingToggle ( ) const
inline

Return the widget that handles the selection: Either a QRadioButton or a QCheckBox.

Both inherit QAbstractButton which has 'isChecked()' and 'setChecked()'.

Definition at line 252 of file YQItemSelector.h.


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