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

Data Structures | |
| class | Wrapper |
| Wrapper for sub widgets. More... | |
Public Types | |
| enum | DatumFlags { None = 0x00, Label = 0x01, Control = 0x02, Units = 0x04, NotFormat = 0x08, NotAccel = 0x10, UnitsWithLabel = 0x20, All = Label | Control | Units } |
Enum describes bit flags of the Qt datum view and behaviour. More... | |
Public Slots | |
| void | setEnabled (bool) |
| Enable/disable main control subwidget (QDS.Control). | |
Signals | |
| void | paramChanged () |
| The signal is emitted when the datum value is changed. | |
| void | paramChanged (QString &) |
Public Member Functions | |
| QDS_Datum (const QString &, QWidget *=0, const int=All, const QString &=QString()) | |
| Constructor. | |
| virtual | ~QDS_Datum () |
| Destructor. | |
| QString | id () const |
| Get the datum ID. | |
| int | type () const |
| Get the datum value type. | |
| QString | label () const |
| Get the datum label text. | |
| QString | units () const |
| Get the datum units text. | |
| QString | filter () const |
| Get the datum filter string. | |
| QString | format () const |
| Get the datum format string. | |
| QString | longDescription () const |
| Get the datum long description. | |
| QString | shortDescription () const |
| Get the datum short description. | |
| QString | defaultValue () const |
| Get the datum default value. | |
| QString | minimumValue () const |
| Get the datum minimum value. | |
| QString | maximumValue () const |
| Get the datum maximum value. | |
| QStringList | options () const |
| Get the datum options names. | |
| QVariant | option (const QString &) const |
| Get datum option specified by name as QVariant. | |
| QString | optionString (const QString &) const |
| Get datum option specified by name as string. | |
| double | optionDouble (const QString &) const |
| Get datum option specified by name as double. | |
| int | optionInteger (const QString &) const |
| Get datum option specified by name as integer. | |
| virtual QVariant | value () const |
| Get the datum value as QVariant. | |
| virtual QString | stringValue () const |
| Get the datum value as string. | |
| virtual double | doubleValue () const |
| Get the datum value as double. | |
| virtual int | integerValue () const |
| Get the datum value as integer. | |
| QString | text () const |
| Get the text data from datum. | |
| virtual bool | isEmpty () const |
| Check if the datum is empty. | |
| virtual void | reset () |
| Reset datum state and set default value as current. | |
| virtual void | clear () |
| Clear the control. | |
| virtual void | setValue (const QVariant &) |
| Set datum value from QVariant object. | |
| virtual void | setStringValue (const QString &) |
| Set datum value from string data. | |
| virtual void | setDoubleValue (const double) |
| Set datum value from double data. | |
| virtual void | setIntegerValue (const int) |
| Set datum value from integer data. | |
| virtual bool | isEnabled (const int=Control) const |
| Get 'enabled' state of the specified subwidget. | |
| virtual void | setEnabled (const bool, const int) |
| Enable/disable subwidgets specified by element. | |
| void | show (const int=All) |
| Show subwidgets specified by element. | |
| void | hide (const int=All) |
| Hide subwidgets specified by element. | |
| virtual void | setShown (const bool, const int=All) |
| Show/hide subwidgets specified by flags. | |
| QWidget * | widget (const int) const |
| Get subwidget specified by element. | |
| void | setFocus () |
| Set the input focus to the control widget. | |
| virtual bool | isValid (const bool=true, const QString &=QString(), const QString &=QString()) const |
| Check if input data is valid. | |
| virtual QValidator * | validator (const bool=false) const |
| Create validator according to the datum type of value. | |
| void | addTo (QVBoxLayout *) |
| Add widgets to the vertical box layout. | |
| void | addTo (QHBoxLayout *) |
| Add widgets to the horizontal box layout. | |
| void | addTo (QGridLayout *, const int, const int, const bool=false) |
| Add widgets to the grid layout. | |
| virtual void | setAlignment (const int, const int=Label) |
| Set the aligment for QDS.Label and/or QDS.Units subwidgets. | |
| virtual bool | eventFilter (QObject *, QEvent *) |
| Event filter. | |
| operator QWidget * () const | |
| Overloaded operator used to retrieve main subwidget named QDS.Control. | |
| bool | isCustomTr () const |
| Return state of custom translation. | |
| void | enableCustomTr (const bool) |
| Change state of custom translation. | |
Static Public Member Functions | |
| static QString | unitsToText (const QString &) |
| Convert units into text presentation. | |
| static QString | textToUnits (const QString &) |
| Convert text presentation into internal units format. | |
| static QString | format (const QString &, const QString &, const bool=false) |
| Format the specified string as dictionary item value. | |
| static QString | format (const int, const QString &, const bool=false) |
| Format the specified integer as dictionary item value. | |
| static QString | format (const double, const QString &, const bool=false) |
| Format the specified double as dictionary item value. | |
| static QString | units (const QString &) |
| Get displayable units string for specified data dictionary item. | |
| static bool | load (const QString &) |
| Load datum definitions from XML file dictPath to the dictionary. | |
| static QString | unitSystemLabel (const QString &, const QString &=QString()) |
| Get the label of unit system sys. | |
| static QString | activeUnitSystem (const QString &=QString()) |
| Get the name of active unit system from the specified component comp. | |
| static void | setActiveUnitSystem (const QString &, const QString &=QString()) |
| Set the active unit system. | |
| static QString | toQString (const TCollection_AsciiString &) |
| Convert the OpenCascade ASCII string to Qt string. | |
| static QString | toQString (const TCollection_ExtendedString &) |
| Convert the OpenCascade Unicode string to Qt string. | |
| static QString | toQString (const Handle(TCollection_HAsciiString)&) |
| Convert the OpenCascade ASCII string to Qt string. | |
| static QString | toQString (const Handle(TCollection_HExtendedString)&) |
| Convert the OpenCascade Unicode string to Qt string. | |
| static TCollection_AsciiString | toAsciiString (const QString &) |
| Convert the Qt string to OpenCascade ASCII string. | |
| static TCollection_AsciiString | toAsciiString (const TCollection_ExtendedString &) |
| Convert the OpenCascade Unicode string to OpenCascade ASCII string. | |
| static TCollection_AsciiString | toAsciiString (const Handle(TCollection_HExtendedString)&) |
| Convert the OpenCascade Unicode string to OpenCascade ASCII string. | |
| static TCollection_ExtendedString | toExtString (const QString &) |
| Convert the Qt string to OpenCascade Unicode string. | |
| static TCollection_ExtendedString | toExtString (const TCollection_AsciiString &) |
| Convert the OpenCascade ASCII string to OpenCascade Unicode string. | |
Protected Slots | |
| virtual void | onParamChanged () |
| Called when datum value is changed. | |
Protected Member Functions | |
| QLabel * | labelWidget () const |
| Get QDS.Label widget. | |
| QLabel * | unitsWidget () const |
| Get QDS.Units widget. | |
| QWidget * | controlWidget () const |
| Get QDS.Control widget. | |
| Handle (DDS_DicItem) dicItem() const | |
| void | setDicItem (const Handle(DDS_DicItem)&) |
| Set the dictionary item to the datum. | |
| int | flags () const |
| Get datum flags. | |
| void | invalidateCache () |
| Reset the numeric value cache. | |
| virtual QLabel * | createLabel (QWidget *) |
| Create QDS.Label widget. | |
| virtual QLabel * | createUnits (QWidget *) |
| Create QDS.Units widget. | |
| virtual QWidget * | createControl (QWidget *)=0 |
| Create QDS.Control widget. | |
| virtual QString | getString () const =0 |
| Get string value from datum. | |
| virtual void | setString (const QString &)=0 |
| virtual bool | validate (const QString &) const |
| Validate the specified string. | |
| QString | prefix () const |
| Get prefix string from format. | |
| QString | suffix () const |
| Get suffix string from format. | |
| virtual QString | minValue () const |
| Get minimum value. | |
| virtual QString | maxValue () const |
| Get maximum value. | |
| virtual void | unitSystemChanged (const QString &) |
| Process notification about active units system changing. | |
| void | initDatum () const |
| Perform initialization if it needed. | |
Static Protected Member Functions | |
| static QString | format (const QString &, const int, const int) |
| Format the given value according to the data dictionary item type. | |
| static QString | format (const QString &, const int, const double) |
| Format the given value according to the data dictionary item type. | |
| static QString | format (const QString &, const int, const QString &) |
| Format the given value according to the data dictionary item type. | |
| static QString | sprintf (const QString &, const int) |
| Wrapper around the standard sprintf() function. | |
| 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. | |
| 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. | |
| static void | insertDatum (QDS_Datum *) |
| Register given datum datum in the global list. | |
| static void | removeDatum (QDS_Datum *) |
| Remove given datum datum from the global list. | |
Private Types | |
| typedef QPointer< QLabel > | GuardedLabel |
| typedef QPointer< QWidget > | GuardedWidget |
Private Slots | |
| void | onInitDatum () |
| Perform delayed initialization. | |
| void | onDestroyed (QObject *) |
| Called when child subwidget is destroued. | |
Private Member Functions | |
| void | initialize () |
| Initialize datum. | |
| Wrapper * | wrapper (QWidget *) const |
| Get wrapper for specified subwidget. | |
| Wrapper * | wrapper (const int) const |
| Get wrapper for specified subwidget. | |
| int | wrapperType (Wrapper *) const |
| Get subwidget type for specified wrapper. | |
| Handle (DDS_DicItem) myDicItem | |
Static Private Member Functions | |
| static QString | removeAccel (const QString &) |
| Remove the acceleartor tags '&' from specified label string src. | |
| static bool | isDoubleFormat (const QString &) |
| Check if given format specified doube value. | |
| static QString | canonicalFormat (const QString &) |
| Get the canonical sprintf() format. | |
| static QString | canonicalFormat (const QString &, QString &) |
| Get the canonical sprintf() format and non standard flags. | |
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 |
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:
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.
typedef QPointer<QLabel> QDS_Datum.GuardedLabel [private] |
typedef QPointer<QWidget> QDS_Datum.GuardedWidget [private] |
enum QDS::DatumFlags [inherited] |
| QDS_Datum::QDS_Datum | ( | const QString & | id, |
| QWidget * | parent = 0, |
||
| const int | flags = All, |
||
| const QString & | comp = QString() |
||
| ) |
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(), TCollection_AsciiString, QDS.toAsciiString(), and QDS.Units.
| QDS_Datum::~QDS_Datum | ( | ) | [virtual] |
Destroy all subwidget. Datum is unregistered from the global list by QDS.removeDatum().
References myControl, myLabel, myUnits, and QDS.removeDatum().
| QString QDS_Datum::id | ( | ) | const |
References initDatum(), and myId.
| int QDS_Datum::type | ( | ) | const |
References initDatum(), and DDS_DicItem.Unknown.
| QString QDS_Datum::label | ( | ) | const |
References flags(), initDatum(), myTr, QDS.NotAccel, removeAccel(), and QDS.toQString().
| QString QDS_Datum::units | ( | ) | const |
References initDatum(), and QDS.toQString().
| QString QDS_Datum::filter | ( | ) | const |
References initDatum(), and QDS.toQString().
| QString QDS_Datum::format | ( | ) | const |
References initDatum(), and QDS.toQString().
| QString QDS_Datum::longDescription | ( | ) | const |
References initDatum(), and QDS.toQString().
| QString QDS_Datum::shortDescription | ( | ) | const |
References initDatum(), and QDS.toQString().
| QString QDS_Datum::defaultValue | ( | ) | const |
References initDatum(), prefix(), suffix(), and QDS.toQString().
| QString QDS_Datum::minimumValue | ( | ) | const |
References format(), initDatum(), DDS_DicItem.MinValue, and type().
| QString QDS_Datum::maximumValue | ( | ) | const |
References format(), initDatum(), DDS_DicItem.MaxValue, and type().
| QStringList QDS_Datum::options | ( | ) | const |
References QDS.toQString().
| QVariant QDS_Datum::option | ( | const QString & | name | ) | const |
References QDS.toAsciiString(), and QDS.toQString().
| QString QDS_Datum::optionString | ( | const QString & | name | ) | const |
References QDS.toAsciiString(), and QDS.toQString().
| double QDS_Datum::optionDouble | ( | const QString & | name | ) | const |
References option().
| int QDS_Datum::optionInteger | ( | const QString & | name | ) | const |
References option().
| QVariant QDS_Datum::value | ( | ) | const [virtual] |
References isEmpty(), and stringValue().
| QString QDS_Datum::stringValue | ( | ) | const [virtual] |
References getString(), initDatum(), mySourceValue, and myTargetValue.
| double QDS_Datum::doubleValue | ( | ) | const [virtual] |
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 getString(), initDatum(), mySourceValue, and myTargetValue.
| int QDS_Datum::integerValue | ( | ) | const [virtual] |
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 getString(), initDatum(), mySourceValue, and myTargetValue.
| QString QDS_Datum::text | ( | ) | const |
Text consists of label, string value and units.
References initDatum(), label(), stringValue(), and units().
| bool QDS_Datum::isEmpty | ( | ) | const [virtual] |
false if datum control has value entered References stringValue().
| void QDS_Datum::reset | ( | ) | [virtual] |
Reimplemented in QDS_ComboBox.
References defaultValue(), format(), getString(), initDatum(), invalidateCache(), myFlags, mySourceValue, QDS.NotFormat, onParamChanged(), paramChanged(), setString(), and type().
| void QDS_Datum::clear | ( | ) | [virtual] |
Reimplemented in QDS_CheckBox.
References getString(), initDatum(), invalidateCache(), isEmpty(), mySourceValue, onParamChanged(), paramChanged(), and setString().
| void QDS_Datum::setValue | ( | const QVariant & | val | ) | [virtual] |
| val | new value |
References clear(), and setStringValue().
| void QDS_Datum::setStringValue | ( | const QString & | txt | ) | [virtual] |
| txt | new value |
References flags(), format(), getString(), initDatum(), mySourceValue, myTargetValue, QDS.NotFormat, onParamChanged(), paramChanged(), setString(), and type().
| void QDS_Datum::setDoubleValue | ( | const double | num | ) | [virtual] |
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.NotFormat, onParamChanged(), paramChanged(), setString(), and type().
| void QDS_Datum::setIntegerValue | ( | const int | num | ) | [virtual] |
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.NotFormat, onParamChanged(), paramChanged(), setString(), and type().
| bool QDS_Datum::isEnabled | ( | const int | element = Control | ) | const [virtual] |
| 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().
| void QDS_Datum::setEnabled | ( | const bool | on, |
| const int | element | ||
| ) | [virtual] |
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::show | ( | const int | element = All | ) |
Possible values of element: QDS.Label, QDS.Control, QDS.Units or their ORed combinations.
| element | ORed subwidget flags (QDS.DatumFlags) |
References setShown().
| void QDS_Datum::hide | ( | const int | element = All | ) |
Possible values of element: QDS.Label, QDS.Control, QDS.Units or their ORed combinations.
| element | ORed subwidget flags (QDS.DatumFlags) |
References setShown().
| void QDS_Datum::setShown | ( | const bool | visible, |
| const int | flags = All |
||
| ) | [virtual] |
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 initDatum(), QDS.Units, and widget().
| QWidget * QDS_Datum::widget | ( | const int | element | ) | const |
Possible values of element: QDS.Label, QDS.Control, QDS.Units.
| element | subwidget |
References initDatum(), and wrapper().
| void QDS_Datum::setFocus | ( | ) |
References controlWidget(), and initDatum().
| bool QDS_Datum::isValid | ( | const bool | msgBox = true, |
| const QString & | extMsg = QString(), |
||
| const QString & | extLabel = QString() |
||
| ) | const [virtual] |
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().
| QValidator * QDS_Datum::validator | ( | const bool | limits = false | ) | const [virtual] |
| 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().
| void QDS_Datum::addTo | ( | QVBoxLayout * | l | ) |
| l | layout |
References QDS.Control, initDatum(), QDS.Label, QDS.Units, and wrapper().
| void QDS_Datum::addTo | ( | QHBoxLayout * | l | ) |
| l | layout |
References QDS.Control, initDatum(), QDS.Label, QDS.Units, unitsWidget(), and wrapper().
| void QDS_Datum::addTo | ( | QGridLayout * | theLay, |
| const int | theRow, | ||
| const int | theCol, | ||
| const bool | vertical = false |
||
| ) |
| 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::setAlignment | ( | const int | align, |
| const int | type = Label |
||
| ) | [virtual] |
| align | alignment type (Qt.Alignment) |
| type | ORed subwidget flags |
Reimplemented in QDS_LineEdit.
References initDatum(), QDS.Label, labelWidget(), QDS.Units, and unitsWidget().
| QString QDS_Datum::unitsToText | ( | const QString & | uni | ) | [static] |
| uni | units to be converted |
| QString QDS_Datum::textToUnits | ( | const QString & | txt | ) | [static] |
| txt | text presentation of units (rich-text) |
| QString QDS_Datum::format | ( | const QString & | str, |
| const QString & | id, | ||
| const bool | convert = false |
||
| ) | [static] |
| 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.
| QString QDS_Datum::format | ( | const int | num, |
| const QString & | id, | ||
| const bool | convert = false |
||
| ) | [static] |
| 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.
| QString QDS_Datum::format | ( | const double | num, |
| const QString & | id, | ||
| const bool | convert = false |
||
| ) | [static] |
| 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.
| QString QDS_Datum::units | ( | const QString & | id | ) | [static] |
| id | data dictionary item ID |
References Handle(), QDS.toAsciiString(), QDS.toQString(), and unitsToText().
Perform delayed initialisation. Reimplemented for internal reasons.
| o | event reciever object |
| e | event |
true if event should be filtered References initDatum().
| QDS_Datum::operator QWidget * | ( | ) | const |
References QDS.Control, and widget().
| bool QDS_Datum::isCustomTr | ( | ) | const |
References myTr.
| void QDS_Datum::enableCustomTr | ( | const bool | on | ) |
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.
| void QDS_Datum::paramChanged | ( | ) | [signal] |
| void QDS_Datum.paramChanged | ( | QString & | ) | [signal] |
| void QDS_Datum::setEnabled | ( | bool | on | ) | [slot] |
| on | new 'enabled' state |
References QDS.Control, and setEnabled().
| void QDS_Datum::onParamChanged | ( | ) | [protected, virtual, slot] |
Reimplemented in QDS_CheckBox, and QDS_LineEdit.
| void QDS_Datum::onInitDatum | ( | ) | [private, slot] |
References initDatum().
| void QDS_Datum::onDestroyed | ( | QObject * | obj | ) | [private, slot] |
Allows avoiding crash of extra calling of the child subwidget destructor.
| obj | object being destroyed |
References myWrapper, and wrapperType().
| QLabel * QDS_Datum::labelWidget | ( | ) | const [protected] |
References initDatum(), and myLabel.
| QLabel * QDS_Datum::unitsWidget | ( | ) | const [protected] |
References initDatum(), and myUnits.
| QWidget * QDS_Datum::controlWidget | ( | ) | const [protected] |
References initDatum(), and myControl.
| QDS_Datum.Handle | ( | DDS_DicItem | ) | const [protected] |
| void QDS_Datum::setDicItem | ( | const Handle(DDS_DicItem)& | item | ) | [protected] |
| item | handle to data dictionary item |
| int QDS_Datum::flags | ( | ) | const [protected] |
References myFlags.
| void QDS_Datum::invalidateCache | ( | ) | [protected] |
References myTargetValue.
| parent | parent widget |
| parent | parent widget |
This method should be implemented in the successor classes.
| parent | parent widget |
Implemented in QDS_CheckBox, QDS_ComboBox, QDS_LineEdit, QDS_RadioBox, QDS_SpinBox, QDS_SpinBoxDbl, and QDS_TextEdit.
| QString QDS_Datum::getString | ( | ) | const [protected, pure virtual] |
This method should be implemented in the successor classes.
Implemented in QDS_CheckBox, QDS_ComboBox, QDS_LineEdit, QDS_RadioBox, QDS_SpinBox, QDS_SpinBoxDbl, and QDS_TextEdit.
| virtual void QDS_Datum.setString | ( | const QString & | ) | [protected, pure virtual] |
Implemented in QDS_CheckBox, QDS_ComboBox, QDS_LineEdit, QDS_RadioBox, QDS_SpinBox, QDS_SpinBoxDbl, and QDS_TextEdit.
| bool QDS_Datum::validate | ( | const QString & | txt | ) | const [protected, virtual] |
| txt | string to be validated |
true if string contains valid data References format(), isDoubleFormat(), DDS_DicItem.String, type(), DDS_DicItem.Unknown, and validator().
| QString QDS_Datum::prefix | ( | ) | const [protected] |
| QString QDS_Datum::suffix | ( | ) | const [protected] |
| QString QDS_Datum::minValue | ( | ) | const [protected, virtual] |
References minimumValue(), prefix(), and suffix().
| QString QDS_Datum::maxValue | ( | ) | const [protected, virtual] |
References maximumValue(), prefix(), and suffix().
| QString QDS_Datum::format | ( | const QString & | aFormat, |
| const int | aType, | ||
| const int | aValue | ||
| ) | [static, protected] |
| 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.
| QString QDS_Datum::format | ( | const QString & | aFormat, |
| const int | aType, | ||
| const double | aValue | ||
| ) | [static, protected] |
| aFormat | format string |
| aType | data dictionary item type |
| aValue | double value being formatted |
References DDS_DicItem.Float, DDS_DicItem.Integer, and DDS_DicItem.String.
| QString QDS_Datum::format | ( | const QString & | aFormat, |
| const int | aType, | ||
| const QString & | aValue | ||
| ) | [static, protected] |
| 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.
| QString QDS_Datum::sprintf | ( | const QString & | fmt, |
| const int | val | ||
| ) | [static, protected] |
Process some non standard flags from format string.
| fmt | string format |
| val | value |
References canonicalFormat().
| QString QDS_Datum::sprintf | ( | const QString & | fmt, |
| const double | val | ||
| ) | [static, protected] |
| QString QDS_Datum::sprintf | ( | const QString & | fmt, |
| const QString & | val | ||
| ) | [static, protected] |
| fmt | string format |
| val | value |
References canonicalFormat(), isDoubleFormat(), rx, and sprintf().
| void QDS_Datum::unitSystemChanged | ( | const QString & | unitSystem | ) | [protected, virtual] |
Update label and units widgets.
| unitSystem | new active units system |
Reimplemented in QDS_ComboBox, QDS_LineEdit, QDS_RadioBox, QDS_SpinBox, and QDS_SpinBoxDbl.
References flags(), label(), labelWidget(), reset(), units(), unitsToText(), unitsWidget(), and QDS.UnitsWithLabel.
| void QDS_Datum::initDatum | ( | ) | const [protected] |
References initialize(), and myInitialised.
| void QDS_Datum::initialize | ( | ) | [private] |
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(), TCollection_AsciiString, QDS.toQString(), QDS.Units, unitSystemChanged(), and wrapper().
| QDS_Datum::Wrapper * QDS_Datum::wrapper | ( | QWidget * | wid | ) | const [private] |
| QDS_Datum::Wrapper * QDS_Datum::wrapper | ( | const int | id | ) | const [private] |
| int QDS_Datum::wrapperType | ( | QDS_Datum::Wrapper * | wrap | ) | const [private] |
| QString QDS_Datum::removeAccel | ( | const QString & | src | ) | [static, private] |
| src | processed string |
| bool QDS_Datum::isDoubleFormat | ( | const QString & | theFormat | ) | [static, private] |
| theFormat | format string |
true if theFormat has specificator for double values References test_table.c.
| QString QDS_Datum::canonicalFormat | ( | const QString & | fmt | ) | [static, private] |
| QString QDS_Datum::canonicalFormat | ( | const QString & | fmt, |
| QString & | flags | ||
| ) | [static, private] |
| QDS_Datum.Handle | ( | DDS_DicItem | ) | [private] |
| bool QDS::load | ( | const QString & | dictPath | ) | [static, inherited] |
true if loading is successed or false otherwise. References QDS.toAsciiString().
| QString QDS::unitSystemLabel | ( | const QString & | sys, |
| const QString & | comp = QString() |
||
| ) | [static, inherited] |
If component comp is specified and not empty then the function searches the given unit system in the specified component, otherwise all components will be searched.
| sys | unit system |
| comp | component |
References Handle(), TCollection_AsciiString, QDS.toAsciiString(), and QDS.toQString().
| QString QDS::activeUnitSystem | ( | const QString & | comp = QString() | ) | [static, inherited] |
If component is not specified or empty string, then the first found component will be used.
If component exists, then active unit system name is returned. Otherwise, empty string is returned.
| comp | component |
References Handle(), QDS.toAsciiString(), and QDS.toQString().
| void QDS::setActiveUnitSystem | ( | const QString & | sys, |
| const QString & | comp = QString() |
||
| ) | [static, inherited] |
If not empty component name comp is specified, then the unit system will be activated in the given component, otherwise all components will be processed.
After the changing of active unit system function notifies about it all registered datums from processed components using method QDS_Datum.unitSystemChanged()
| unit | system to be set active |
| comp | component |
References QDS._datumList, QDS.activeUnitSystem(), Handle(), TCollection_AsciiString, QDS.toAsciiString(), and unitSystemChanged().
| QString QDS::toQString | ( | const TCollection_AsciiString & | src | ) | [static, inherited] |
| src | OCC ASCII string |
| QString QDS::toQString | ( | const TCollection_ExtendedString & | src | ) | [static, inherited] |
| src | OCC Unicode string |
References TCollection_AsciiString, and QDS.toQString().
| QString QDS::toQString | ( | const Handle(TCollection_HAsciiString)& | src | ) | [static, inherited] |
| QString QDS::toQString | ( | const Handle(TCollection_HExtendedString)& | src | ) | [static, inherited] |
| TCollection_AsciiString QDS::toAsciiString | ( | const QString & | src | ) | [static, inherited] |
| TCollection_AsciiString QDS::toAsciiString | ( | const TCollection_ExtendedString & | src | ) | [static, inherited] |
| TCollection_AsciiString QDS::toAsciiString | ( | const Handle(TCollection_HExtendedString)& | src | ) | [static, inherited] |
| src | handle to OCC Unicode string |
References TCollection_AsciiString, and QDS.toAsciiString().
| TCollection_ExtendedString QDS::toExtString | ( | const QString & | src | ) | [static, inherited] |
| src | Qt string |
| TCollection_ExtendedString QDS::toExtString | ( | const TCollection_AsciiString & | src | ) | [static, inherited] |
| src | OCC ASCII string |
| void QDS::insertDatum | ( | QDS_Datum * | datum | ) | [static, protected, inherited] |
This function is invoked automatically by QDS_Datum constructor.
| datum | datum being registered |
References QDS._datumList.
| void QDS::removeDatum | ( | QDS_Datum * | datum | ) | [static, protected, inherited] |
This function is invoked automatically by QDS_Datum destructor.
| datum | datum being unregistered |
References QDS._datumList.
friend class QDS [friend] |
QString QDS_Datum.myId [private] |
int QDS_Datum.myFlags [private] |
QMap<int, Wrapper*> QDS_Datum.myWrapper [private] |
GuardedLabel QDS_Datum.myLabel [private] |
GuardedLabel QDS_Datum.myUnits [private] |
GuardedWidget QDS_Datum.myControl [private] |
QString QDS_Datum.mySourceValue [private] |
QString QDS_Datum.myTargetValue [private] |
bool QDS_Datum.myInitialised [private] |
bool QDS_Datum.myTr [private] |