SHAPER  9.12.0
ModuleBase_ChoiceCtrl Class Reference

A Choice control. More...

Inheritance diagram for ModuleBase_ChoiceCtrl:
Inheritance graph

Public Types

enum  ControlType { RadioButtons , ComboBox }
 

Signals

void valueChanged (int theVal)
 A signal raised on change of current value. More...
 

Public Member Functions

 ModuleBase_ChoiceCtrl (QWidget *theParent, const QStringList &theChoiceList, const QStringList &theIconsList, ControlType theType=RadioButtons, Qt::Orientation theButtonsDir=Qt::Horizontal)
 Constructor. More...
 
void setLabel (const QString &theText)
 Set label for the controls. More...
 
void setLabelIcon (const QString &theIcon)
 Set Icon for the label. More...
 
void setValue (int theVal)
 Set value: Id of button or item of combo box. More...
 
void setValue (const QString &theVal)
 Set value: text of button or item of combo box. More...
 
void setTooltip (QString theTip)
 Set tool tip for label. Used only for combo box. More...
 
int value () const
 Returns currently selected value. More...
 
QString textValue () const
 Returns text of currently selected value. More...
 
bool focusTo ()
 Transfer focus on itself. More...
 
QList< QWidget * > getControls () const
 Returns controls for activation. More...
 
void setChoiceList (const QStringList &theChoiceList)
 Set list of choice. More...
 

Detailed Description

A Choice control.

It provides a choice in several strings. It can be represented by several radiobuttons or by combo box. Radio buttons can be represented as by radiou buttons with text or by icons in toggle buttons.

Constructor & Destructor Documentation

◆ ModuleBase_ChoiceCtrl()

ModuleBase_ChoiceCtrl::ModuleBase_ChoiceCtrl ( QWidget theParent,
const QStringList &  theChoiceList,
const QStringList &  theIconsList,
ControlType  theType = RadioButtons,
Qt::Orientation  theButtonsDir = Qt::Horizontal 
)

Constructor.

Parameters
theParenta parent widget
theChoiceLista list of choice strings
theIconsLista list of icon names for radiou buttons
theTypea type of choice representation
theButtonsDirdirection of radio buttons placement

Member Function Documentation

◆ setLabel()

void ModuleBase_ChoiceCtrl::setLabel ( const QString &  theText)

Set label for the controls.

It is a label for combo box and title for group of radio buttons.

Parameters
theTexta text of the label

◆ setLabelIcon()

void ModuleBase_ChoiceCtrl::setLabelIcon ( const QString &  theIcon)

Set Icon for the label.

Used only for combo box.

Parameters
theIcona name of icon

◆ setValue() [1/2]

void ModuleBase_ChoiceCtrl::setValue ( int  theVal)

Set value: Id of button or item of combo box.

Parameters
theVala value (from 0 to number of items)

◆ setValue() [2/2]

void ModuleBase_ChoiceCtrl::setValue ( const QString &  theVal)

Set value: text of button or item of combo box.

Parameters
theVala value (one of text items)

◆ setTooltip()

void ModuleBase_ChoiceCtrl::setTooltip ( QString  theTip)

Set tool tip for label. Used only for combo box.

◆ value()

int ModuleBase_ChoiceCtrl::value ( ) const

Returns currently selected value.

◆ textValue()

QString ModuleBase_ChoiceCtrl::textValue ( ) const

Returns text of currently selected value.

◆ focusTo()

bool ModuleBase_ChoiceCtrl::focusTo ( )

Transfer focus on itself.

◆ getControls()

QList< QWidget * > ModuleBase_ChoiceCtrl::getControls ( ) const

Returns controls for activation.

◆ setChoiceList()

void ModuleBase_ChoiceCtrl::setChoiceList ( const QStringList &  theChoiceList)

Set list of choice.

Parameters
theChoiceLista string list of items

◆ valueChanged

void ModuleBase_ChoiceCtrl::valueChanged ( int  theVal)
signal

A signal raised on change of current value.