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

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

#include <QDS_Datum.h>

Inheritance diagram for QDS_Datum:
Inheritance graph

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...
 
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 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

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 QWidgetcreateControl (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< QLabelGuardedLabel
 
typedef QPointer< QWidgetGuardedWidget
 

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...
 
Wrapperwrapper (QWidget *) const
 Get wrapper for specified subwidget. More...
 
Wrapperwrapper (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...
 

Detailed Description

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.

Member Typedef Documentation

typedef QPointer<QLabel> QDS_Datum::GuardedLabel
private
typedef QPointer<QWidget> QDS_Datum::GuardedWidget
private

Constructor & Destructor Documentation

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().

Parameters
iddatum identifier
parentparent widget
flagsdatum flags
compcomponent

References QDS::Control, Handle(), QDS::insertDatum(), QDS::Label, myFlags, myWrapper, onDestroyed(), onInitDatum(), setDicItem(), 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().

Member Function Documentation

void QDS_Datum::addTo ( QVBoxLayout *  l)
Parameters
llayout

References QDS::Control, initDatum(), QDS::Label, QDS::Units, and wrapper().

void QDS_Datum::addTo ( QHBoxLayout *  l)
Parameters
llayout

References QDS::Control, initDatum(), QDS::Label, QDS::Units, and wrapper().

void QDS_Datum::addTo ( QGridLayout *  theLay,
const int  theRow,
const int  theCol,
const bool  vertical = false 
)
Parameters
theLaylayout
theRowlayout row index
theCollayout column index
verticalif true subwidgets are layouted vertically, otherwise - horizontally

References QDS::Control, initDatum(), QDS::Label, QDS::Units, and wrapper().

QString QDS_Datum::canonicalFormat ( const QString &  fmt)
staticprivate
Parameters
fmtstring format
Returns
canonical sprintf() format

References flags().

QString QDS_Datum::canonicalFormat ( const QString &  fmt,
QString &  flags 
)
staticprivate
Parameters
fmtstring format
flagsformat flags
Returns
canonical sprintf() format

References rx.

void QDS_Datum::clear ( )
virtual
QWidget * QDS_Datum::controlWidget ( ) const
protected
Returns
control widget

References initDatum(), and myControl.

QWidget * QDS_Datum::createControl ( QWidget parent)
protectedpure virtual

This method should be implemented in the successor classes.

Parameters
parentparent widget
Returns
control widget

Implemented in QDS_ComboBox, QDS_RadioBox, QDS_LineEdit, QDS_CheckBox, QDS_SpinBox, QDS_SpinBoxDbl, and QDS_TextEdit.

QLabel * QDS_Datum::createLabel ( QWidget parent)
protectedvirtual
Parameters
parentparent widget
Returns
label widget
QLabel * QDS_Datum::createUnits ( QWidget parent)
protectedvirtual
Parameters
parentparent widget
Returns
units widget
QString QDS_Datum::defaultValue ( ) const
Returns
default value

References initDatum(), prefix(), suffix(), and QDS::toQString().

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.

Returns
datum value converted to double

Reimplemented in QDS_ComboBox.

References flags(), getString(), initDatum(), mySourceValue, myTargetValue, and QDS::NotConvert.

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

Parameters
on- if it is true, custom translation is activated, otherwise, deactivated

References label(), labelWidget(), and myTr.

bool QDS_Datum::eventFilter ( QObject o,
QEvent e 
)
virtual

Perform delayed initialisation. Reimplemented for internal reasons.

Parameters
oevent reciever object
eevent
Returns
true if event should be filtered

References initDatum().

QString QDS_Datum::filter ( ) const
Returns
filter string

References initDatum(), and QDS::toQString().

int QDS_Datum::flags ( ) const
protected
Returns
datum flags (QDS::DatumFlags)

References myFlags.

QString QDS_Datum::format ( ) const
Returns
format string

References initDatum(), and QDS::toQString().

QString QDS_Datum::format ( const QString &  str,
const QString &  id,
const bool  convert = false 
)
static
Parameters
strstring value being formatted
iddata dictionary ID
convertif true, perform conversion from "SI" units system
Returns
formatted value

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
Parameters
numinteger value being formatted
iddata dictionary ID
convertif true, perform conversion from "SI" units system
Returns
formatted value

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
Parameters
numdouble value being formatted
iddata dictionary ID
convertif true, perform conversion from "SI" units system
Returns
formatted value

References format(), Handle(), QDS::toAsciiString(), QDS::toQString(), and DDS_DicItem::Unknown.

QString QDS_Datum::format ( const QString &  aFormat,
const int  aType,
const int  aValue 
)
staticprotected
Parameters
aFormatformat string
aTypedata dictionary item type
aValueinteger value being formatted
Returns
formatted value

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 
)
staticprotected
Parameters
aFormatformat string
aTypedata dictionary item type
aValuedouble value being formatted
Returns
formatted value

References DDS_DicItem::Float, DDS_DicItem::Integer, and DDS_DicItem::String.

QString QDS_Datum::format ( const QString &  aFormat,
const int  aType,
const QString &  aValue 
)
staticprotected
Parameters
aFormatformat string
aTypedata dictionary item type
aValuestring value being formatted
Returns
formatted value

References DDS_DicItem::Float, DDS_DicItem::Integer, sprintf(), and DDS_DicItem::String.

QString QDS_Datum::getString ( ) const
pure virtual

This method should be implemented in the successor classes.

Returns
datum string value

Implemented in QDS_ComboBox, QDS_RadioBox, QDS_LineEdit, QDS_CheckBox, QDS_SpinBox, QDS_SpinBoxDbl, and QDS_TextEdit.

QDS_Datum::Handle ( DDS_DicItem  ) const
protected
QDS_Datum::Handle ( DDS_DicItem  )
private
void QDS_Datum::hide ( const int  element = All)

Possible values of element: QDS::Label, QDS::Control, QDS::Units or their ORed combinations.

Parameters
elementORed subwidget flags (QDS::DatumFlags)
See Also
show(), setShown()

References setShown().

QString QDS_Datum::id ( ) const
Returns
datum ID

References initDatum(), and myId.

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(), QDS::toQString(), QDS::Units, unitSystemChanged(), and wrapper().

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.

Returns
datum value converted to integer

Reimplemented in QDS_ComboBox.

References flags(), getString(), initDatum(), mySourceValue, myTargetValue, and QDS::NotConvert.

void QDS_Datum::invalidateCache ( )
protected

References myTargetValue.

bool QDS_Datum::isCustomTr ( ) const
Returns
true if custom translation is enabled

References myTr.

bool QDS_Datum::isDoubleFormat ( const QString &  theFormat)
staticprivate
Parameters
theFormatformat string
Returns
true if theFormat has specificator for double values
bool QDS_Datum::isEmpty ( ) const
virtual
Returns
false if datum control has value entered

References stringValue().

bool QDS_Datum::isEnabled ( const int  element = Control) const
virtual
Parameters
elementORed subwidget flags (QDS::DatumFlags)
Returns
true if all subwidgets specified by element are enabled
See Also
setEnabled()

References QDS::Control, controlWidget(), initDatum(), QDS::Label, labelWidget(), QDS::Units, and unitsWidget().

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.

Parameters
msgBoxif true, show warning message box if input is invalid
extMsgwarning message
extLabeloptional name of the variable (if QDS::Label control is not used)
Returns
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
Returns
label text

References flags(), initDatum(), myTr, QDS::NotAccel, removeAccel(), and QDS::toQString().

QLabel * QDS_Datum::labelWidget ( ) const
protected
Returns
label widget

References initDatum(), and myLabel.

QString QDS_Datum::longDescription ( ) const
Returns
datum long description

References initDatum(), and QDS::toQString().

QString QDS_Datum::maximumValue ( ) const
Returns
maximum value

References format(), initDatum(), DDS_DicItem::MaxValue, and type().

QString QDS_Datum::maxValue ( ) const
protectedvirtual
Returns
maximum value

References maximumValue(), prefix(), and suffix().

QString QDS_Datum::minimumValue ( ) const
Returns
minimum value

References format(), initDatum(), DDS_DicItem::MinValue, and type().

QString QDS_Datum::minValue ( ) const
protectedvirtual
Returns
minimum value

References minimumValue(), prefix(), and suffix().

void QDS_Datum::onDestroyed ( QObject obj)
privateslot

Allows avoiding crash of extra calling of the child subwidget destructor.

Parameters
objobject being destroyed

References myWrapper, and wrapperType().

void QDS_Datum::onInitDatum ( )
privateslot

References initDatum().

void QDS_Datum::onParamChanged ( )
protectedvirtualslot
QDS_Datum::operator QWidget * ( ) const
Returns
QDS::Control subwidget
QVariant QDS_Datum::option ( const QString &  name) const
Returns
the option value or invalid QVariant if the option does not exist

References QDS::toAsciiString(), and QDS::toQString().

double QDS_Datum::optionDouble ( const QString &  name) const
Returns
the option value or 0 if the option does not exist

References option().

int QDS_Datum::optionInteger ( const QString &  name) const
Returns
the option value or 0 if the option does not exist

References option().

QStringList QDS_Datum::options ( ) const
Returns
datum options

References QDS::toQString().

QString QDS_Datum::optionString ( const QString &  name) const
Returns
the option value or null QString if the option does not exist

References QDS::toAsciiString(), and QDS::toQString().

void QDS_Datum::paramChanged ( )
signal
void QDS_Datum::paramChanged ( QString &  )
signal
QString QDS_Datum::prefix ( ) const
protected
Returns
current implementation returns null string
QString QDS_Datum::removeAccel ( const QString &  src)
staticprivate
Parameters
srcprocessed string
Returns
string after removing '&' symbols
void QDS_Datum::setAlignment ( const int  align,
const int  type = Label 
)
virtual
Parameters
alignalignment type (Qt::Alignment)
typeORed subwidget flags

Reimplemented in QDS_LineEdit.

References initDatum(), QDS::Label, labelWidget(), QDS::Units, and unitsWidget().

void QDS_Datum::setDicItem ( const Handle(DDS_DicItem)&  )
protected
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.

Parameters
numnew value

Reimplemented in QDS_ComboBox.

References flags(), format(), getString(), initDatum(), mySourceValue, myTargetValue, QDS::NotConvert, QDS::NotFormat, onParamChanged(), paramChanged(), setString(), and type().

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.

Parameters
onnew 'enabled' state
elementORed subwidget flags (QDS::DatumFlags)
See Also
isEnabled()

References QDS::Control, controlWidget(), initDatum(), QDS::Label, labelWidget(), QDS::Units, and unitsWidget().

void QDS_Datum::setEnabled ( bool  on)
slot
Parameters
onnew 'enabled' state

References QDS::Control, and setEnabled().

void QDS_Datum::setFocus ( )

References controlWidget(), and initDatum().

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.

Parameters
numnew value

Reimplemented in QDS_ComboBox.

References flags(), format(), getString(), initDatum(), mySourceValue, myTargetValue, QDS::NotConvert, QDS::NotFormat, onParamChanged(), paramChanged(), setString(), and type().

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.

Parameters
visiblenew 'visibility' state
flagsORed subwidget flags (QDS::DatumFlags)
See Also
show(), hide()

References initDatum(), QDS::Units, and widget().

virtual void QDS_Datum::setString ( const QString &  )
protectedpure virtual
void QDS_Datum::setStringValue ( const QString &  txt)
virtual
void QDS_Datum::setValue ( const QVariant &  val)
virtual
QString QDS_Datum::shortDescription ( ) const
Returns
datum short description

References initDatum(), and QDS::toQString().

void QDS_Datum::show ( const int  element = All)

Possible values of element: QDS::Label, QDS::Control, QDS::Units or their ORed combinations.

Parameters
elementORed subwidget flags (QDS::DatumFlags)
See Also
hide(), setShown()

References setShown().

QString QDS_Datum::sprintf ( const QString &  fmt,
const int  val 
)
staticprotected

Process some non standard flags from format string.

Parameters
fmtstring format
valvalue
Returns
formatted value

References canonicalFormat().

QString QDS_Datum::sprintf ( const QString &  fmt,
const double  val 
)
staticprotected
Parameters
fmtstring format
valvalue
Returns
formatted value

References canonicalFormat().

QString QDS_Datum::sprintf ( const QString &  fmt,
const QString &  val 
)
staticprotected
Parameters
fmtstring format
valvalue
Returns
formatted value

References canonicalFormat(), isDoubleFormat(), rx, and sprintf().

QString QDS_Datum::stringValue ( ) const
virtual
Returns
datum value converted to string

References getString(), initDatum(), mySourceValue, and myTargetValue.

QString QDS_Datum::suffix ( ) const
protected
Returns
current implementation returns null string
QString QDS_Datum::text ( ) const

Text consists of label, string value and units.

Returns
datum text data

References initDatum(), label(), stringValue(), and units().

QString QDS_Datum::textToUnits ( const QString &  txt)
static
Parameters
txttext presentation of units (rich-text)
Returns
units value
int QDS_Datum::type ( ) const
Returns
datum value type

References initDatum(), and DDS_DicItem::Unknown.

QString QDS_Datum::units ( ) const
Returns
units text

References initDatum(), and QDS::toQString().

QString QDS_Datum::units ( const QString &  id)
static
Parameters
iddata dictionary item ID
Returns
units string

References Handle(), QDS::toAsciiString(), QDS::toQString(), and unitsToText().

QString QDS_Datum::unitsToText ( const QString &  uni)
static
Parameters
uniunits to be converted
Returns
text presentation of units (rich-text)
QLabel * QDS_Datum::unitsWidget ( ) const
protected
Returns
units widget

References initDatum(), and myUnits.

void QDS_Datum::unitSystemChanged ( const QString &  unitSystem)
protectedvirtual

Update label and units widgets.

Parameters
unitSystemnew active units system

Reimplemented in QDS_ComboBox, QDS_RadioBox, QDS_LineEdit, QDS_SpinBox, and QDS_SpinBoxDbl.

References flags(), label(), labelWidget(), reset(), units(), unitsToText(), unitsWidget(), and QDS::UnitsWithLabel.

bool QDS_Datum::validate ( const QString &  txt) const
protectedvirtual
Parameters
txtstring to be validated
Returns
true if string contains valid data

References format(), isDoubleFormat(), DDS_DicItem::String, type(), DDS_DicItem::Unknown, and validator().

QValidator * QDS_Datum::validator ( const bool  limits = false) const
virtual
Parameters
limitsif true use minimum and maximum value limits
Returns
validator

References canonicalFormat(), filter(), DDS_DicItem::Float, format(), DDS_DicItem::Integer, maxValue(), minValue(), QDS_StringValidator::setLength(), DDS_DicItem::String, and type().

QWidget * QDS_Datum::widget ( const int  element) const

Possible values of element: QDS::Label, QDS::Control, QDS::Units.

Parameters
elementsubwidget
Returns
widget

References initDatum(), and wrapper().

QDS_Datum::Wrapper * QDS_Datum::wrapper ( QWidget wid) const
private
Parameters
widsubwidget
Returns
wrapper

References myWrapper.

QDS_Datum::Wrapper * QDS_Datum::wrapper ( const int  id) const
private
Parameters
idsubwidget ID
Returns
wrapper

References myWrapper.

int QDS_Datum::wrapperType ( QDS_Datum::Wrapper wrap) const
private
Parameters
wrapwrapper
Returns
subwidget ID

References id(), and myWrapper.

Friends And Related Function Documentation

friend class QDS
friend

Member Data Documentation

GuardedWidget QDS_Datum::myControl
private
int QDS_Datum::myFlags
private
QString QDS_Datum::myId
private
bool QDS_Datum::myInitialised
private
GuardedLabel QDS_Datum::myLabel
private
QString QDS_Datum::mySourceValue
private
QString QDS_Datum::myTargetValue
private
bool QDS_Datum::myTr
private
GuardedLabel QDS_Datum::myUnits
private
QMap<int, Wrapper*> QDS_Datum::myWrapper
private

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