Back to index

salome-gui  6.5.0
QDS_Datum Class Reference

Base class for all controls using the data dictionary. More...

Inheritance diagram for QDS_Datum:
Inheritance graph


class  Wrapper
 Wrapper for sub widgets. More...

Detailed Description

Base class for all controls using the data dictionary.

Datum is successor of QObject (not QWidget). This object can have up to three sub widgets named as QDS::Label, QDS::Control and QDS::Units. User can prevent creation of any of them by setting corresponding subwidgets IDs in the parameter flags of the constructor. QDS::Label widget displays label of datum, QDS::Control widget allows entering the value and QDS::Units widget displays measure units in the active units system.

These widgets are constructed under the parent widget of the datum. The sub widgets are layouted in the parent widget in the following order: first widget is QDS::Label, it is followed by QDS::Control, and in the end is QDS::Units. User can add these widgets to layout manually using method addTo(). Method widget() can be used to retrieve desired widget and place it into layout.

When QGroupBox is used as parent widget for datum object, all subwidgets are arranged automatically by the group box according to the column and orientation properties of the QGroupBox.


  QGroupBox* box = new QGroupBox( 3, Qt::Horizontal, "datum box" );
  QDS_Datum* d1  = new QDS_Datum( "datum_1", box, All );
  QDS_Datum* d2  = new QDS_Datum( "datum_2", box, All );
  QDS_Datum* d3  = new QDS_Datum( "datum_3", box, All );

In this example we create the QGroupBox with 3 horizontal columns. All the created datum widgets will be placed automatically in 3 rows. Datums will be placed from top to bottom one by one and aligned in he grid.

Datum value is stored as string. User can get/set this value:

User can enable/disable datum subwidgets with setEnabled() method, show/hide them with show()/hide() methods, set input focus to datum with setFocus(), set widgets alignment with setAlignment(), etc.

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