Back to index
Base class for all controls using the data dictionary. More...
|Wrapper for sub widgets. More...|
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.
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.