Base class for all controls using the data dictionary. More...
#include <QDS_Datum.h>

Classes | |
| class | Wrapper |
| Wrapper for sub widgets. More... | |
Public Slots | |
| void | setEnabled (bool) |
| Enable/disable main control subwidget (QDS::Control). More... | |
Signals | |
| void | paramChanged () |
| The signal is emitted when the datum value is changed. More... | |
| void | paramChanged (QString &) |
Public Member Functions | |
| 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 | clear () |
| Clear the control. 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... | |
| QWidget * | widget (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 QValidator * | validator (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 QString | getString () const =0 |
| Get string value from datum. 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... | |
Static Public Member Functions | |
| 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... | |
Static Public Member Functions inherited from QDS | |
| static bool | load (const QString &) |
| Load datum definitions from XML file dictPath to the dictionary. More... | |
| static QString | unitSystemLabel (const QString &, const QString &=QString()) |
| Get the label of unit system sys. More... | |
| static QString | activeUnitSystem (const QString &=QString()) |
| Get the name of active unit system from the specified component comp. More... | |
| static void | setActiveUnitSystem (const QString &, const QString &=QString()) |
| Set the active unit system. More... | |
| static QString | toQString (const TCollection_AsciiString &) |
| Convert the OpenCascade ASCII string to Qt string. More... | |
| static QString | toQString (const TCollection_ExtendedString &) |
| Convert the OpenCascade Unicode string to Qt string. More... | |
| static QString | toQString (const Handle(TCollection_HAsciiString)&) |
| Convert the OpenCascade ASCII string to Qt string. More... | |
| static QString | toQString (const Handle(TCollection_HExtendedString)&) |
| Convert the OpenCascade Unicode string to Qt string. More... | |
| static TCollection_AsciiString | toAsciiString (const QString &) |
| Convert the Qt string to OpenCascade ASCII string. More... | |
| static TCollection_AsciiString | toAsciiString (const TCollection_ExtendedString &) |
| Convert the OpenCascade Unicode string to OpenCascade ASCII string. More... | |
| static TCollection_AsciiString | toAsciiString (const Handle(TCollection_HExtendedString)&) |
| Convert the OpenCascade Unicode string to OpenCascade ASCII string. More... | |
| static TCollection_ExtendedString | toExtString (const QString &) |
| Convert the Qt string to OpenCascade Unicode string. More... | |
| static TCollection_ExtendedString | toExtString (const TCollection_AsciiString &) |
| Convert the OpenCascade ASCII string to OpenCascade Unicode string. More... | |
Protected Slots | |
| virtual void | onParamChanged () |
| Called when datum value is changed. More... | |
Protected Member Functions | |
| QLabel * | labelWidget () const |
| Get QDS::Label widget. More... | |
| QLabel * | unitsWidget () const |
| Get QDS::Units widget. More... | |
| QWidget * | controlWidget () 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 QLabel * | createLabel (QWidget *) |
| Create QDS::Label widget. More... | |
| virtual QLabel * | createUnits (QWidget *) |
| Create QDS::Units widget. More... | |
| virtual QWidget * | createControl (QWidget *)=0 |
| Create QDS::Control widget. More... | |
| virtual void | setString (const QString &)=0 |
| 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... | |
Static Protected Member Functions | |
| 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... | |
Static Protected Member Functions inherited from QDS | |
| static void | insertDatum (QDS_Datum *) |
| Register given datum datum in the global list. More... | |
| static void | removeDatum (QDS_Datum *) |
| Remove given datum datum from the global list. More... | |
Private Types | |
| typedef QPointer< QLabel > | GuardedLabel |
| typedef QPointer< QWidget > | GuardedWidget |
Private Slots | |
| void | onInitDatum () |
| Perform delayed initialization. More... | |
| void | onDestroyed (QObject *) |
| Called when child subwidget is destroued. More... | |
Private Member Functions | |
| void | initialize () |
| Initialize datum. More... | |
| Wrapper * | wrapper (QWidget *) const |
| Get wrapper for specified subwidget. More... | |
| Wrapper * | wrapper (const int) const |
| Get wrapper for specified subwidget. More... | |
| int | wrapperType (Wrapper *) const |
| Get subwidget type for specified wrapper. More... | |
| Handle (DDS_DicItem) myDicItem | |
Static Private Member Functions | |
| static QString | removeAccel (const QString &) |
| Remove the acceleartor tags '&' from specified label string src. More... | |
| static bool | isDoubleFormat (const QString &) |
| Check if given format specified doube value. More... | |
| static QString | canonicalFormat (const QString &) |
| Get the canonical sprintf() format. More... | |
| static QString | canonicalFormat (const QString &, QString &) |
| Get the canonical sprintf() format and non standard flags. More... | |
Private Attributes | |
| QString | myId |
| int | myFlags |
| QMap< int, Wrapper * > | myWrapper |
| GuardedLabel | myLabel |
| GuardedLabel | myUnits |
| GuardedWidget | myControl |
| QString | mySourceValue |
| QString | myTargetValue |
| bool | myInitialised |
| bool | myTr |
Friends | |
| class | QDS |
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... | |
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.
Example:
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.
|
private |
|
private |
| QDS_Datum::QDS_Datum | ( | const QString & | id, |
| QWidget * | parent = 0, |
||
| const int | flags = All, |
||
| const QString & | comp = QString() |
||
| ) |
Constructor.
Create 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.
Datum is self-registered in the global list by QDS::insertDatum().
| id | datum identifier |
| parent | parent widget |
| flags | datum flags |
| comp | component |
References QDS::Control, Handle(), QDS::insertDatum(), QDS::Label, myFlags, myWrapper, onDestroyed(), onInitDatum(), setDicItem(), QDS::toAsciiString(), and QDS::Units.
|
virtual |
Destructor.
Destroy all subwidget. Datum is unregistered from the global list by QDS::removeDatum().
References myControl, myLabel, myUnits, and QDS::removeDatum().
| void QDS_Datum::addTo | ( | QGridLayout * | theLay, |
| const int | theRow, | ||
| const int | theCol, | ||
| const bool | vertical = false |
||
| ) |
Add widgets to the grid layout.
| theLay | layout |
| theRow | layout row index |
| theCol | layout column index |
| vertical | if true subwidgets are layouted vertically, otherwise - horizontally |
References QDS::Control, initDatum(), QDS::Label, QDS::Units, and wrapper().
| void QDS_Datum::addTo | ( | QHBoxLayout * | l | ) |
Add widgets to the horizontal box layout.
| l | layout |
References QDS::Control, initDatum(), QDS::Label, QDS::Units, and wrapper().
| void QDS_Datum::addTo | ( | QVBoxLayout * | l | ) |
Add widgets to the vertical box layout.
| l | layout |
References QDS::Control, initDatum(), QDS::Label, QDS::Units, and wrapper().
|
staticprivate |
|
staticprivate |
|
virtual |
Clear the control.
Reimplemented in QDS_CheckBox.
References getString(), initDatum(), invalidateCache(), isEmpty(), mySourceValue, onParamChanged(), paramChanged(), and setString().
|
protected |
Create QDS::Control widget.
This method should be implemented in the successor classes.
| parent | parent widget |
Implemented in QDS_TextEdit, QDS_SpinBoxDbl, QDS_SpinBox, QDS_RadioBox, QDS_LineEdit, QDS_ComboBox, and QDS_CheckBox.
| QString QDS_Datum::defaultValue | ( | ) | const |
Get the datum default value.
References initDatum(), prefix(), suffix(), and QDS::toQString().
|
virtual |
Get the datum value as double.
The value is converted according to the measure units in the active units system to measure units in "SI" units system.
Reimplemented in QDS_ComboBox.
References flags(), getString(), initDatum(), mySourceValue, myTargetValue, and QDS::NotConvert.
| void QDS_Datum::enableCustomTr | ( | const bool | on | ) |
Change state of custom translation.
Custom translation means that text labels of datums are translated with help of standard Qt mechanism of internationalization. In this case special records should be placed into *.ts files under context "QDS". For example, if label has name "myLabel", the corresponding translation should be written: <context> <name>QDS</name> <message> <source>myLabel</source> <translation>myLabel translation</translation> </message> ...
If custom translation mechanism is deactivated, then labels will be shown with text got from xml data dictionary file
By default, the custom translation is deactivated
| on | - if it is true, custom translation is activated, otherwise, deactivated |
References label(), labelWidget(), and myTr.
Event filter.
Perform delayed initialisation. Reimplemented for internal reasons.
| o | event reciever object |
| e | event |
true if event should be filtered References initDatum().
| QString QDS_Datum::filter | ( | ) | const |
|
protected |
| QString QDS_Datum::format | ( | ) | const |
|
static |
Format the specified double as dictionary item value.
| num | double value being formatted |
| id | data dictionary ID |
| convert | if true, perform conversion from "SI" units system |
References format(), Handle(), QDS::toAsciiString(), QDS::toQString(), and DDS_DicItem::Unknown.
|
static |
Format the specified integer as dictionary item value.
| num | integer value being formatted |
| id | data dictionary ID |
| convert | if true, perform conversion from "SI" units system |
References format(), Handle(), QDS::toAsciiString(), QDS::toQString(), and DDS_DicItem::Unknown.
|
staticprotected |
Format the given value according to the data dictionary item type.
| aFormat | format string |
| aType | data dictionary item type |
| aValue | double value being formatted |
References DDS_DicItem::Float, DDS_DicItem::Integer, and DDS_DicItem::String.
|
staticprotected |
Format the given value according to the data dictionary item type.
| aFormat | format string |
| aType | data dictionary item type |
| aValue | integer value being formatted |
References DDS_DicItem::Float, DDS_DicItem::Integer, sprintf(), and DDS_DicItem::String.
|
staticprotected |
Format the given value according to the data dictionary item type.
| aFormat | format string |
| aType | data dictionary item type |
| aValue | string value being formatted |
References DDS_DicItem::Float, DDS_DicItem::Integer, sprintf(), and DDS_DicItem::String.
|
static |
Format the specified string as dictionary item value.
| str | string value being formatted |
| id | data dictionary ID |
| convert | if true, perform conversion from "SI" units system |
References format(), Handle(), QDS::toAsciiString(), QDS::toQString(), and DDS_DicItem::Unknown.
|
pure virtual |
Get string value from datum.
This method should be implemented in the successor classes.
Implemented in QDS_TextEdit, QDS_SpinBoxDbl, QDS_SpinBox, QDS_RadioBox, QDS_LineEdit, QDS_ComboBox, and QDS_CheckBox.
|
protected |
|
private |
| void QDS_Datum::hide | ( | const int | element = All | ) |
Hide subwidgets specified by element.
Possible values of element: QDS::Label, QDS::Control, QDS::Units or their ORed combinations.
| element | ORed subwidget flags (QDS::DatumFlags) |
References setShown().
| QString QDS_Datum::id | ( | ) | const |
|
protected |
Perform initialization if it needed.
References initialize(), and myInitialised.
|
private |
Initialize datum.
Retrieve information from data dictionary and create subwidgets using virtual mechanism.
Virtual mechanism doesn't work in the constructor, therefore this method should be called outside the constructor.
References QDS::Control, controlWidget(), createControl(), createLabel(), createUnits(), flags(), Handle(), QDS::Label, labelWidget(), longDescription(), myControl, myLabel, myUnits, QDS::NotAccel, QDS_Datum::Wrapper::setWidget(), shortDescription(), QDS::toQString(), QDS::Units, unitSystemChanged(), and wrapper().
|
virtual |
Get the datum value as integer.
The value is converted according to the measure units in the active units system to measure units in "SI" units system.
Reimplemented in QDS_ComboBox.
References flags(), getString(), initDatum(), mySourceValue, myTargetValue, and QDS::NotConvert.
|
protected |
Reset the numeric value cache.
References myTargetValue.
| bool QDS_Datum::isCustomTr | ( | ) | const |
|
staticprivate |
Check if given format specified doube value.
| theFormat | format string |
true if theFormat has specificator for double values
|
virtual |
Check if the datum is empty.
false if datum control has value entered References stringValue().
|
virtual |
Get 'enabled' state of the specified subwidget.
| element | ORed subwidget flags (QDS::DatumFlags) |
true if all subwidgets specified by element are enabled References QDS::Control, controlWidget(), initDatum(), QDS::Label, labelWidget(), QDS::Units, and unitsWidget().
|
virtual |
Check if input data is valid.
If data is invalid and msgBox is true, the warning message box is shown.
| msgBox | if true, show warning message box if input is invalid |
| extMsg | warning message |
| extLabel | optional name of the variable (if QDS::Label control is not used) |
true if input data is valid References controlWidget(), DDS_DicItem::Float, format(), getString(), initDatum(), DDS_DicItem::Integer, isDoubleFormat(), isEmpty(), label(), maxValue(), minValue(), DDS_DicItem::String, QDS::toQString(), type(), and validate().
| QString QDS_Datum::label | ( | ) | const |
Get the datum label text.
References flags(), initDatum(), myTr, QDS::NotAccel, removeAccel(), and QDS::toQString().
|
protected |
| QString QDS_Datum::longDescription | ( | ) | const |
Get the datum long description.
References initDatum(), and QDS::toQString().
| QString QDS_Datum::maximumValue | ( | ) | const |
Get the datum maximum value.
References format(), initDatum(), DDS_DicItem::MaxValue, and type().
|
protectedvirtual |
| QString QDS_Datum::minimumValue | ( | ) | const |
Get the datum minimum value.
References format(), initDatum(), DDS_DicItem::MinValue, and type().
|
protectedvirtual |
|
privateslot |
Called when child subwidget is destroued.
Allows avoiding crash of extra calling of the child subwidget destructor.
| obj | object being destroyed |
References myWrapper, and wrapperType().
|
privateslot |
Perform delayed initialization.
References initDatum().
|
protectedvirtualslot |
Called when datum value is changed.
| QDS_Datum::operator QWidget * | ( | ) | const |
Overloaded operator used to retrieve main subwidget named QDS::Control.
| QVariant QDS_Datum::option | ( | const QString & | name | ) | const |
Get datum option specified by name as QVariant.
References QDS::toAsciiString(), and QDS::toQString().
| double QDS_Datum::optionDouble | ( | const QString & | name | ) | const |
Get datum option specified by name as double.
References option().
| int QDS_Datum::optionInteger | ( | const QString & | name | ) | const |
Get datum option specified by name as integer.
References option().
| QStringList QDS_Datum::options | ( | ) | const |
| QString QDS_Datum::optionString | ( | const QString & | name | ) | const |
Get datum option specified by name as string.
References QDS::toAsciiString(), and QDS::toQString().
|
signal |
The signal is emitted when the datum value is changed.
|
signal |
|
protected |
Get prefix string from format.
|
staticprivate |
Remove the acceleartor tags '&' from specified label string src.
| src | processed string |
|
virtual |
Reset datum state and set default value as current.
Reimplemented in QDS_ComboBox.
References defaultValue(), format(), getString(), initDatum(), invalidateCache(), myFlags, mySourceValue, QDS::NotFormat, onParamChanged(), paramChanged(), setString(), and type().
|
virtual |
Set the aligment for QDS::Label and/or QDS::Units subwidgets.
| align | alignment type (Qt::Alignment) |
| type | ORed subwidget flags |
Reimplemented in QDS_LineEdit.
References initDatum(), QDS::Label, labelWidget(), type(), QDS::Units, and unitsWidget().
|
protected |
|
virtual |
Set datum value from double data.
The value is converted from measure units in "SI" units system to the measure units in the active units system. Format the value using datum format internal if it is required.
| num | new value |
Reimplemented in QDS_ComboBox.
References flags(), format(), getString(), initDatum(), mySourceValue, myTargetValue, QDS::NotConvert, QDS::NotFormat, onParamChanged(), paramChanged(), setString(), and type().
|
slot |
Enable/disable main control subwidget (QDS::Control).
| on | new 'enabled' state |
References QDS::Control, and setEnabled().
|
virtual |
Enable/disable subwidgets specified by element.
Possible values of element: QDS::Label, QDS::Control, QDS::Units or their ORed combinations.
| on | new 'enabled' state |
| element | ORed subwidget flags (QDS::DatumFlags) |
References QDS::Control, controlWidget(), initDatum(), QDS::Label, labelWidget(), QDS::Units, and unitsWidget().
| void QDS_Datum::setFocus | ( | ) |
Set the input focus to the control widget.
References controlWidget(), and initDatum().
|
virtual |
Set datum value from integer data.
The value is converted from measure units in "SI" units system to the measure units in the active units system. Format the value using datum format if it is required.
| num | new value |
Reimplemented in QDS_ComboBox.
References flags(), format(), getString(), initDatum(), mySourceValue, myTargetValue, QDS::NotConvert, QDS::NotFormat, onParamChanged(), paramChanged(), setString(), and type().
|
virtual |
Show/hide subwidgets specified by flags.
Possible values of flags: QDS::Label, QDS::Control, QDS::Units or their ORed combinations.
| visible | new 'visibility' state |
| flags | ORed subwidget flags (QDS::DatumFlags) |
References flags(), initDatum(), QDS::Units, and widget().
|
protectedpure virtual |
Implemented in QDS_TextEdit, QDS_SpinBoxDbl, QDS_SpinBox, QDS_RadioBox, QDS_LineEdit, QDS_ComboBox, and QDS_CheckBox.
|
virtual |
Set datum value from string data.
| txt | new value |
References flags(), format(), getString(), initDatum(), mySourceValue, myTargetValue, QDS::NotFormat, onParamChanged(), paramChanged(), setString(), and type().
|
virtual |
Set datum value from QVariant object.
| val | new value |
References clear(), DDS_DicItem::Float, DDS_DicItem::Integer, DDS_DicItem::List, setDoubleValue(), setIntegerValue(), setStringValue(), DDS_DicItem::String, type(), and DDS_DicItem::Unknown.
| QString QDS_Datum::shortDescription | ( | ) | const |
Get the datum short description.
References initDatum(), and QDS::toQString().
| void QDS_Datum::show | ( | const int | element = All | ) |
Show subwidgets specified by element.
Possible values of element: QDS::Label, QDS::Control, QDS::Units or their ORed combinations.
| element | ORed subwidget flags (QDS::DatumFlags) |
References setShown().
|
staticprotected |
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.
| fmt | string format |
| val | value |
References canonicalFormat().
|
staticprotected |
Wrapper around the standard sprintf() function.
Process some non standard flags from format string.
| fmt | string format |
| val | value |
References canonicalFormat().
|
staticprotected |
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.
| fmt | string format |
| val | value |
References canonicalFormat(), isDoubleFormat(), rx, and sprintf().
|
virtual |
Get the datum value as string.
References getString(), initDatum(), mySourceValue, and myTargetValue.
|
protected |
Get suffix string from format.
| QString QDS_Datum::text | ( | ) | const |
Get the text data from datum.
Text consists of label, string value and units.
References initDatum(), label(), stringValue(), and units().
|
static |
Convert text presentation into internal units format.
| txt | text presentation of units (rich-text) |
| int QDS_Datum::type | ( | ) | const |
| QString QDS_Datum::units | ( | ) | const |
|
static |
Get displayable units string for specified data dictionary item.
| id | data dictionary item ID |
References Handle(), QDS::toAsciiString(), QDS::toQString(), and unitsToText().
|
static |
Convert units into text presentation.
| uni | units to be converted |
|
protected |
|
protectedvirtual |
Process notification about active units system changing.
Update label and units widgets.
| unitSystem | new active units system |
Reimplemented in QDS_SpinBoxDbl, QDS_SpinBox, QDS_RadioBox, QDS_LineEdit, and QDS_ComboBox.
References flags(), label(), labelWidget(), reset(), units(), unitsToText(), unitsWidget(), and QDS::UnitsWithLabel.
|
protectedvirtual |
Validate the specified string.
| txt | string to be validated |
true if string contains valid data References format(), isDoubleFormat(), DDS_DicItem::String, type(), DDS_DicItem::Unknown, and validator().
|
virtual |
Create validator according to the datum type of value.
| limits | if true use minimum and maximum value limits |
References canonicalFormat(), filter(), DDS_DicItem::Float, format(), DDS_DicItem::Integer, maxValue(), minValue(), QDS_StringValidator::setLength(), DDS_DicItem::String, and type().
|
virtual |
Get the datum value as QVariant.
References doubleValue(), DDS_DicItem::Float, DDS_DicItem::Integer, integerValue(), isEmpty(), DDS_DicItem::List, DDS_DicItem::String, stringValue(), type(), and DDS_DicItem::Unknown.
| QWidget * QDS_Datum::widget | ( | const int | element | ) | const |
Get subwidget specified by element.
Possible values of element: QDS::Label, QDS::Control, QDS::Units.
| element | subwidget |
References initDatum(), and wrapper().
|
private |
|
private |
|
private |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |