Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QDS_CheckBox Class Reference

#include <QDS_CheckBox.h>

Inheritance diagram for QDS_CheckBox:
Inheritance graph

Signals

void toggled (bool)
 Emitted when the check box state is toggled. More...
 
- Signals inherited from QDS_Datum
void paramChanged ()
 The signal is emitted when the datum value is changed. More...
 
void paramChanged (QString &)
 

Public Member Functions

 QDS_CheckBox (const QString &, QWidget *=0, const int=All, const QString &=QString())
 Constructor. More...
 
virtual ~QDS_CheckBox ()
 Destructor. More...
 
bool isChecked () const
 Get current check box state. More...
 
void setChecked (const bool)
 Set the check box state to theState. More...
 
virtual QString getString () const
 Get string value from the widget. More...
 
virtual void clear ()
 Set the state "PartiallyChecked" (undefined) for checkbox. More...
 
- Public Member Functions inherited from QDS_Datum
 QDS_Datum (const QString &, QWidget *=0, const int=All, const QString &=QString())
 Constructor. More...
 
virtual ~QDS_Datum ()
 Destructor. More...
 
QString id () const
 Get the datum ID. More...
 
int type () const
 Get the datum value type. More...
 
QString label () const
 Get the datum label text. More...
 
QString units () const
 Get the datum units text. More...
 
QString filter () const
 Get the datum filter string. More...
 
QString format () const
 Get the datum format string. More...
 
QString longDescription () const
 Get the datum long description. More...
 
QString shortDescription () const
 Get the datum short description. More...
 
QString defaultValue () const
 Get the datum default value. More...
 
QString minimumValue () const
 Get the datum minimum value. More...
 
QString maximumValue () const
 Get the datum maximum value. More...
 
QStringList options () const
 Get the datum options names. More...
 
QVariant option (const QString &) const
 Get datum option specified by name as QVariant. More...
 
QString optionString (const QString &) const
 Get datum option specified by name as string. More...
 
double optionDouble (const QString &) const
 Get datum option specified by name as double. More...
 
int optionInteger (const QString &) const
 Get datum option specified by name as integer. More...
 
virtual QVariant value () const
 Get the datum value as QVariant. More...
 
virtual QString stringValue () const
 Get the datum value as string. More...
 
virtual double doubleValue () const
 Get the datum value as double. More...
 
virtual int integerValue () const
 Get the datum value as integer. More...
 
QString text () const
 Get the text data from datum. More...
 
virtual bool isEmpty () const
 Check if the datum is empty. More...
 
virtual void reset ()
 Reset datum state and set default value as current. More...
 
virtual void setValue (const QVariant &)
 Set datum value from QVariant object. More...
 
virtual void setStringValue (const QString &)
 Set datum value from string data. More...
 
virtual void setDoubleValue (const double)
 Set datum value from double data. More...
 
virtual void setIntegerValue (const int)
 Set datum value from integer data. More...
 
virtual bool isEnabled (const int=Control) const
 Get 'enabled' state of the specified subwidget. More...
 
virtual void setEnabled (const bool, const int)
 Enable/disable subwidgets specified by element. More...
 
void show (const int=All)
 Show subwidgets specified by element. More...
 
void hide (const int=All)
 Hide subwidgets specified by element. More...
 
virtual void setShown (const bool, const int=All)
 Show/hide subwidgets specified by flags. More...
 
QWidgetwidget (const int) const
 Get subwidget specified by element. More...
 
void setFocus ()
 Set the input focus to the control widget. More...
 
virtual bool isValid (const bool=true, const QString &=QString(), const QString &=QString()) const
 Check if input data is valid. More...
 
virtual QValidatorvalidator (const bool=false) const
 Create validator according to the datum type of value. More...
 
void addTo (QVBoxLayout *)
 Add widgets to the vertical box layout. More...
 
void addTo (QHBoxLayout *)
 Add widgets to the horizontal box layout. More...
 
void addTo (QGridLayout *, const int, const int, const bool=false)
 Add widgets to the grid layout. More...
 
virtual void setAlignment (const int, const int=Label)
 Set the aligment for QDS::Label and/or QDS::Units subwidgets. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Event filter. More...
 
 operator QWidget * () const
 Overloaded operator used to retrieve main subwidget named QDS::Control. More...
 
bool isCustomTr () const
 Return state of custom translation. More...
 
void enableCustomTr (const bool)
 Change state of custom translation. More...
 

Protected Member Functions

QCheckBox * checkBox () const
 Get internal check box. More...
 
virtual QWidgetcreateControl (QWidget *)
 Create internal check box as control widget. More...
 
virtual void setString (const QString &)
 Set the string value into the widget. More...
 
- Protected Member Functions inherited from QDS_Datum
QLabellabelWidget () const
 Get QDS::Label widget. More...
 
QLabelunitsWidget () const
 Get QDS::Units widget. More...
 
QWidgetcontrolWidget () const
 Get QDS::Control widget. More...
 
 Handle (DDS_DicItem) dicItem() const
 
void setDicItem (const Handle(DDS_DicItem)&)
 
int flags () const
 Get datum flags. More...
 
void invalidateCache ()
 Reset the numeric value cache. More...
 
virtual QLabelcreateLabel (QWidget *)
 Create QDS::Label widget. More...
 
virtual QLabelcreateUnits (QWidget *)
 Create QDS::Units widget. More...
 
virtual bool validate (const QString &) const
 Validate the specified string. More...
 
QString prefix () const
 Get prefix string from format. More...
 
QString suffix () const
 Get suffix string from format. More...
 
virtual QString minValue () const
 Get minimum value. More...
 
virtual QString maxValue () const
 Get maximum value. More...
 
virtual void unitSystemChanged (const QString &)
 Process notification about active units system changing. More...
 
void initDatum () const
 Perform initialization if it needed. More...
 

Private Slots

void onParamChanged ()
 Called when check box is switched. More...
 
void onStateChanged (int)
 Called when check box is switched. More...
 

Additional Inherited Members

- Public Types inherited from QDS
enum  DatumFlags {
  None = 0x00, Label = 0x01, Control = 0x02, Units = 0x04,
  NotFormat = 0x08, NotAccel = 0x10, NotConvert = 0x20, UnitsWithLabel = 0x40,
  All = Label | Control | Units
}
 Enum describes bit flags of the Qt datum view and behaviour. More...
 
- Public Slots inherited from QDS_Datum
void setEnabled (bool)
 Enable/disable main control subwidget (QDS::Control). More...
 
- Static Public Member Functions inherited from QDS_Datum
static QString unitsToText (const QString &)
 Convert units into text presentation. More...
 
static QString textToUnits (const QString &)
 Convert text presentation into internal units format. More...
 
static QString format (const QString &, const QString &, const bool=false)
 Format the specified string as dictionary item value. More...
 
static QString format (const int, const QString &, const bool=false)
 Format the specified integer as dictionary item value. More...
 
static QString format (const double, const QString &, const bool=false)
 Format the specified double as dictionary item value. More...
 
static QString units (const QString &)
 Get displayable units string for specified data dictionary item. More...
 
- Protected Slots inherited from QDS_Datum
virtual void onParamChanged ()
 Called when datum value is changed. More...
 
- Static Protected Member Functions inherited from QDS_Datum
static QString format (const QString &, const int, const int)
 Format the given value according to the data dictionary item type. More...
 
static QString format (const QString &, const int, const double)
 Format the given value according to the data dictionary item type. More...
 
static QString format (const QString &, const int, const QString &)
 Format the given value according to the data dictionary item type. More...
 
static QString sprintf (const QString &, const int)
 Wrapper around the standard sprintf() function. More...
 
static QString sprintf (const QString &, const double)
 Wrapper around the standard sprintf() function.This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Process some non standard flags from format string. More...
 
static QString sprintf (const QString &, const QString &)
 Wrapper around the standard sprintf() function.This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Process some non standard flags from format string. More...
 

Constructor & Destructor Documentation

QDS_CheckBox::QDS_CheckBox ( const QString &  id,
QWidget parent = 0,
const int  flags = All,
const QString &  comp = QString() 
)

Create check box datum object with datum identifier id and parent widget parent.

Parameter flags defines behaviour of datum and set of created subwidgets. Default value of this parameter is QDS::All.

Parameter comp specifies the component name which will be used when searching the dictionary item.

Parameters
iddatum identifier
parentparent widget
flagsdatum flags
compcomponent
QDS_CheckBox::~QDS_CheckBox ( )
virtual

Member Function Documentation

QCheckBox * QDS_CheckBox::checkBox ( ) const
protected
Returns
pointer to QCheckBox widget

References QDS_Datum::controlWidget().

void QDS_CheckBox::clear ( )
virtual

Reimplemented from QDS_Datum.

References QDS_Datum::setStringValue().

QWidget * QDS_CheckBox::createControl ( QWidget parent)
protectedvirtual
Parameters
parentparent widget
Returns
created check box widget

Implements QDS_Datum.

References onParamChanged(), onStateChanged(), and toggled().

QString QDS_CheckBox::getString ( ) const
virtual
Returns
"1" if check box is checked on and "0" otherwise

Implements QDS_Datum.

References checkBox().

bool QDS_CheckBox::isChecked ( ) const
Returns
check box state

References checkBox().

void QDS_CheckBox::onParamChanged ( )
privateslot

Emits signal paramChanged() to notify about changing of the control state.

References QDS_Datum::paramChanged().

void QDS_CheckBox::onStateChanged ( int  state)
privateslot

Switch off check box property "tristate" when state is changed by the user.

Parameters
statenew check box state

References checkBox().

void QDS_CheckBox::setChecked ( const bool  theState)
Parameters
theStatenew check box state

References checkBox().

void QDS_CheckBox::setString ( const QString &  txt)
protectedvirtual

If string txt contains "1", then check box state is switched on. If string txt contains "0", then check box state is switched on. If string txt contains "-1", then check box is reset to "PartiallyChecked" (undefined) state.

Parameters
txtstring value

Implements QDS_Datum.

References checkBox().

void QDS_CheckBox::toggled ( bool  on)
signal
Parameters
onnew check box state

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