QList<QDS_Datum*> QDS::_datumList;
/*!
- Convert the OpenCascade ascii string to Qt string.
+ \class QDS
+ \brief A set of usefull static functions.
+*/
+
+/*!
+ \brief Convert the OpenCascade ASCII string to Qt string.
+ \param src OCC ASCII string
+ \return Qt string
*/
QString QDS::toQString( const TCollection_AsciiString& src )
{
}
/*!
- Convert the OpenCascade unicode string to Qt string.
+ \brief Convert the OpenCascade Unicode string to Qt string.
+ \param src OCC Unicode string
+ \return Qt string
*/
QString QDS::toQString( const TCollection_ExtendedString& src )
{
}
/*!
- Convert the OpenCascade ascii string to Qt string.
+ \brief Convert the OpenCascade ASCII string to Qt string.
+ \param src handle to OCC ASCII string
+ \return Qt string
*/
QString QDS::toQString( const Handle(TCollection_HAsciiString)& src )
{
}
/*!
- Convert the OpenCascade unicode string to Qt string.
+ \brief Convert the OpenCascade Unicode string to Qt string.
+ \param src handle to OCC Unicode string
+ \return Qt string
*/
QString QDS::toQString( const Handle(TCollection_HExtendedString)& src )
{
}
/*!
- Convert the Qt string to OpenCascade ascii string.
+ \brief Convert the Qt string to OpenCascade ASCII string.
+ \param src Qt string
+ \return OCC ASCII string
*/
TCollection_AsciiString QDS::toAsciiString( const QString& src )
{
}
/*!
- Convert the OpenCascade unicode string to OpenCascade ascii string.
+ \brief Convert the OpenCascade Unicode string to OpenCascade ASCII string.
+ \param src OCC Unicode string
+ \return OCC ASCII string
*/
TCollection_AsciiString QDS::toAsciiString( const TCollection_ExtendedString& src )
{
}
/*!
- Convert the OpenCascade unicode string to OpenCascade ascii string.
+ \brief Convert the OpenCascade Unicode string to OpenCascade ASCII string.
+ \param src handle to OCC Unicode string
+ \return OCC ASCII string
*/
TCollection_AsciiString QDS::toAsciiString( const Handle(TCollection_HExtendedString)& src )
{
}
/*!
- Convert the Qt string to OpenCascade unicode string.
+ \brief Convert the Qt string to OpenCascade Unicode string.
+ \param src Qt string
+ \return OCC Unicode string
*/
TCollection_ExtendedString QDS::toExtString( const QString& src )
{
}
/*!
- Convert the OpenCascade ascii string to OpenCascade unicode string.
+ \brief Convert the OpenCascade ASCII string to OpenCascade Unicode string.
+ \param src OCC ASCII string
+ \return OCC Unicode string
*/
TCollection_ExtendedString QDS::toExtString( const TCollection_AsciiString& src )
{
}
/*!
- Load datum definitions in the dictionary from XML file \adictPath.
- Returns true if load successed or false otherwise.
+ \brief Load datum definitions from XML file \a dictPath to the dictionary.
+ \return \c true if loading is successed or \c false otherwise.
*/
bool QDS::load( const QString& dictPath )
{
}
/*!
- Returns the label of unit system \asys. If component \acomp specified and not empty then
- function find the given unit system in the given component otherwise all components will be searched.
- If unit system not found then empty string returned.
+ \brief Get the label of unit system \a sys.
+
+ If component \a comp is specified and not empty then the function
+ searches the given unit system in the specified component, otherwise
+ all components will be searched.
+
+ \param sys unit system
+ \param comp component
+ \return unit system lavel or empty string if unit system is not found
*/
QString QDS::unitSystemLabel( const QString& sys, const QString& comp )
{
}
/*!
- Gets the name of active unit system from the specified component \acomp.
- If component not specified or component is empty string then first got component will be used.
- If component exist then active unit system name returned or empty string otherwise.
+ \brief Get the name of active unit system from the specified component \a comp.
+
+ 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.
+
+ \param comp component
+ \return name of the active unit system
*/
QString QDS::activeUnitSystem( const QString& comp )
{
}
/*!
- Sets the active unit system named \asys. If not empty component name \acomp specified then
- unit system will be activated in the given component otherwise all components will be processed.
+ \brief Set the active unit system.
- After the changing of active unit system function notify about it to all registered datums
- from processed components using method QDS_Datum::unitSystemChanged();
+ If not empty component name \a 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()
+
+ \param unit system to be set active
+ \param comp component
*/
void QDS::setActiveUnitSystem( const QString& sys, const QString& comp )
{
}
/*!
- Register given datum \adatum in the static list.
- This function invoked by QDS_Datum constructor.
+ \brief Register given datum \a datum in the global list.
+
+ This function is invoked automatically by QDS_Datum constructor.
+
+ \param datum datum being registered
*/
void QDS::insertDatum( QDS_Datum* datum )
{
}
/*!
- Remove given datum \adatum from the static list.
- This function invoked by QDS_Datum destructor.
+ \brief Remove given datum \a datum from the global list.
+
+ This function is invoked automatically by QDS_Datum destructor.
+
+ \param datum datum being unregistered
*/
void QDS::removeDatum( QDS_Datum* datum )
{
class QDS_EXPORT QDS
{
public:
- /*! Enum describes bit flags of the Qt datum view and behaviour */
+ //! Enum describes bit flags of the Qt datum view and behaviour
typedef enum
{
None = 0x00, //!< Non specified any flags (Default behaviour)
static void removeDatum( QDS_Datum* );
private:
- static QList<QDS_Datum*> _datumList;
+ static QList<QDS_Datum*> _datumList;
};
#endif
/*
\class QDS_CheckBox
-
- Datum with control corresponding to check box. This control can have only two states:
- 1 (on/true) or 0 (off/false). QDS_CheckBox don't take into account standard parameter
- properties (minimum, maximum, filter, etc).
+ \brief Datum with control corresponding to check box.
+
+ This control can have only two states:
+ - 1 (on/true)
+ - 0 (off/false).
+
+ QDS_CheckBox don't take into account standard parameter properties
+ (minimum, maximum, filter, etc).
QDS_CheckBox can set and get following values for access methods (setStringValue(),
setIntegerValue(), setDoubleValue(), stringValue(), integerValue(), doubleValue()):
- \li "1" - check box state is setted as on.
- \li "0" - check box state is setted as off.
- \li "-1" - check box state is setted as "NoChage" (undefined).
+ - "1" - check box state is switched on.
+ - "0" - check box state is switched off.
+ - "-1" - check box state is "PartiallyChecked" (undefined).
- User can set and check a state "NoChange" using methods clear() and isEmpty() accordingly.
+ User can set and test "PartiallyChecked" check using methods clear()
+ and isEmpty() correspondingly.
*/
/*!
- Constructor. Create check box datum object with datum identifier \aid under widget \aparent.
- Parameter \aflags define behaviour of datum and set of created subwidgets. Default value of
- this parameter is QDS::All. Parameter \acomp specify the component name which will be used
- during search of dictionary item.
+ \brief Constructor.
+
+ Create check box datum object with datum identifier \a id
+ and parent widget \a parent.
+
+ Parameter \a flags defines behaviour of datum and set of created
+ subwidgets. Default value of this parameter is QDS::All.
+
+ Parameter \a comp specifies the component name which will be used
+ when searching the dictionary item.
+
+ \param id datum identifier
+ \param parent parent widget
+ \param flags datum flags
+ \param comp component
*/
QDS_CheckBox::QDS_CheckBox( const QString& id, QWidget* parent, const int flags, const QString& comp )
: QDS_Datum( id, parent, flags, comp )
}
/*!
- Destructor.
+ \brief Destructor.
*/
QDS_CheckBox::~QDS_CheckBox()
{
}
/*!
- Sets the state "NoChange" for checkbox.
+ \brief Set the state "PartiallyChecked" (undefined) for checkbox.
*/
void QDS_CheckBox::clear()
{
}
/*!
- Returns string from QCheckBox widget. If the check box state is on then 1 returned otherwise 0.
+ \brief Get string value from the widget.
+ \return "1" if check box is checked on and "0" otherwise
*/
QString QDS_CheckBox::getString() const
{
}
/*!
- Sets the string into QCheckBox widget. If argument \atxt is string with number "1" then check box
- state is setted as on. If argument \atxt is string with number "0" then state is setted as off.
- If argument \atxt is string with number "-1" then state is setted as "NoChage" (undefined).
+ \brief Set the string value into the widget.
+
+ If string \a txt contains "1", then check box state is switched on.
+ If string \a txt contains "0", then check box state is switched on.
+ If string \a txt contains "-1", then check box is reset to
+ "PartiallyChecked" (undefined) state.
+
+ \param txt string value
*/
void QDS_CheckBox::setString( const QString& txt )
{
}
/*!
- Returns pointer to QCheckBox widget.
+ \brief Get internal check box.
+ \return pointer to QCheckBox widget
*/
QCheckBox* QDS_CheckBox::checkBox() const
{
}
/*!
- Create QCheckBox widget as control subwidget.
+ \brief Create internal check box as control widget.
+ \param parent parent widget
+ \return created check box widget
*/
QWidget* QDS_CheckBox::createControl( QWidget* parent )
{
}
/*!
- Notify about ñhanging of control state
+ \brief Called when check box is switched.
+
+ Emits signal paramChanged() to notify about changing of the control state.
*/
void QDS_CheckBox::onParamChanged()
{
}
/*!
- Notify about ñhanging of control state. Switch off check box property "tristate" when
- state changed by user.
+ \brief Called when check box is switched.
+
+ Switch off check box property "tristate" when state is changed by the user.
+
+ \param state new check box state
*/
void QDS_CheckBox::onStateChanged( int state )
{
}
/*!
- Sets the check box state \atheState.
+ \brief Set the check box state to \a theState.
+ \param theState new check box state
*/
void QDS_CheckBox::setChecked( const bool theState )
{
}
/*!
- Returns current check box state.
+ \brief Get current check box state.
+ \return check box state
*/
bool QDS_CheckBox::isChecked() const
{
return checkBox() ? checkBox()->isChecked() : false;
}
+
+/*!
+ \fn void QDS_CheckBox::toggled( bool on );
+ \brief Emitted when the check box state is toggled.
+ \param on new check box state
+*/
//
#include "QDS_ComboBox.h"
-#include <DDS_Dictionary.h>
+#include <QtxComboBox.h>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfExtendedString.hxx>
/*
\class QDS_ComboBox
- Datum with control corresponding to combo box. This control used for datum with enumerable values.
- It can be used for datum which has type of value 'List'. Each item of combobox defined two properties:
- integer identifier and string name. All operations on items performed via identifier.
+ \brief Datum with control corresponding to the combo box.
+
+ This control is used for datum with enumerable values.
+ It can be used for datum which has type of value 'List'.
+
+ Each item of the combobox is defined by two properties: integer identifier
+ and string name. All operations on items are performed via identifier.
*/
/*!
- Constructor. Create combobox datum object with datum identifier \aid under widget \aparent. Parameter \aflags
- define behaviour of datum and set of created subwidgets. Default value of this parameter is QDS::All.
- Parameter \acomp specify the component name which will be used during search of dictionary item.
+ \brief Constructor.
+
+ Create combobox datum object with datum identifier \a id
+ and parent widget \a parent.
+
+ Parameter \a flags defines behaviour of datum and set of created
+ subwidgets. Default value of this parameter is QDS::All.
+
+ Parameter \a comp specifies the component name which will be used
+ when searching the dictionary item.
+
+ \param id datum identifier
+ \param parent parent widget
+ \param flags datum flags
+ \param comp component
*/
QDS_ComboBox::QDS_ComboBox( const QString& id, QWidget* parent, const int flags, const QString& comp )
: QDS_Datum( id, parent, flags, comp )
}
/*!
- Destructor.
+ \brief Destructor.
*/
QDS_ComboBox::~QDS_ComboBox()
{
}
/*!
- Returns true if ComboBox allow to edit current text.
+ \brief Check if combo box allows text editing.
+ \return \c true if combo box is editable
*/
bool QDS_ComboBox::editable() const
{
}
/*!
- Sets the possibily of current text editing.
+ \brief Enable/disable text editing.
+ \param on if \c true, combo box is made editable
*/
void QDS_ComboBox::setEditable( const bool on )
{
}
/*!
- Returns number of items in ComboBox. If \atotal is 'false' then only
- visible items are taken into account otherwise all items.
+ \brief Get number of items in the combo box.
+
+ \param total if \c false, only visible items are taken into account,
+ otherwise get total number of items
+ \return number of items
*/
int QDS_ComboBox::count( bool total ) const
{
}
/*!
- Returns list of list item identifiers \aids. If \atotal is 'false' then only visible items
- are taken into account otherwise all items.
+ \brief Get items identifiers.
+
+ \param ids returned list of items IDs
+ \param total if \c false, only visible items are taken into account,
+ otherwise get total number of items
*/
void QDS_ComboBox::values( QList<int>& ids, bool total ) const
{
}
/*!
- Returns the current id as integer. Reimplemented.
+ \brief Get the current item ID as integer value.
+ \return current item ID converted to integer
*/
int QDS_ComboBox::integerValue() const
{
}
/*!
- Returns the current id as double. Reimplemented.
+ \brief Get the current item ID as double value.
+ \return current item ID converted to double
*/
double QDS_ComboBox::doubleValue() const
{
}
/*!
- Set the current item acording to specified id. Reimplemented.
+ \brief Set the current item acording to the specified \a id.
+ \param id item ID
*/
void QDS_ComboBox::setIntegerValue( const int id )
{
}
/*!
- Get the integer part of specified value and use it as new current identifier. Reimplemented.
+ \brief Set the current item acording to the specified \a id.
+ \overload
+
+ Integer part of \a val is used as new current ID.
+
+ \param val item ID
*/
void QDS_ComboBox::setDoubleValue( const double val )
{
}
/*!
- Returns visible state of item specified by \aid.
+ \brief Get visibility state of the item specified by \a id.
+ \param id item ID
+ \return item visibility state
*/
bool QDS_ComboBox::state( const int id ) const
{
}
/*!
- Sets the visible state of item specified by \aid. If \aid is -1 then specified
- state will be set to all items. If \aappend is set then keep status for other items
- otherwise status of other items will be cleared.
+ \brief Set the visibility state of the item specified by \a id.
+
+ If \a id is -1 then specified state will be set to all items.
+
+ If \a append is set to \c true, keep current status for other items,
+ otherwise status of other items is cleared.
+
+ \param on new visibility state
+ \param id item ID
+ \param append if \c true, keep original status for other items
*/
void QDS_ComboBox::setState( const bool on, const int id, const bool append )
{
}
/*!
- Sets the visible state of items specified by list of identifiers \aids.
- If \aappend is set then keep status for other items otherwise status of other
- items will be cleared.
+ \brief Set the visibility state of items specified by \a ids.
+
+ If \a append is set to \c true, keep current status for other items,
+ otherwise status of other items is cleared.
+
+ \param on new visibility state
+ \param ids items IDs list
+ \param append if \c true, keep original status for other items
*/
void QDS_ComboBox::setState( const bool on, const QList<int>& ids, const bool append )
{
}
/*!
- Sets the custom user items into the combo box. User items like standard dictionary
- list items will be added into the combobox. This functionality allow to user override
+ \brief Set the custom user items into the combo box.
+
+ User items like standard dictionary list items will be added
+ into the combobox. This function allows user to override
items.
+
+ \param ids items IDs
+ \param names items names
*/
void QDS_ComboBox::setValues( const QList<int>& ids, const QStringList& names )
{
}
/*!
- This is an overloaded member function, provided for convenience.
- It behaves essentially like the above function. It creates
- QList (0, 1, 2 ... ) and call previous method.
+ \brief Set the custom user items into the combo box.
+ \overload
+
+ User items like standard dictionary list items will be added
+ into the combobox. This function allows user to override
+ items.
+
+ Uses (0, 1, 2 ... ) as items IDs.
+
+ \param names items names
*/
void QDS_ComboBox::setValues( const QStringList& names )
{
}
/*!
- Sets the active item as item with default id. If default
- not defined then first item will be used.
+ \brief Reset the datum.
+
+ Set the active item as item with default ID. If default ID is not defined
+ then the first item is used.
*/
void QDS_ComboBox::reset()
{
}
/*!
- Returns identifier from given ComboBox string item.
+ \brief Convert string to integer value.
+ \param str item
+ \return item ID or -1 if not found
*/
int QDS_ComboBox::stringToValue( const QString& str ) const
{
}
/*!
- Returns ComboBox string item from given identifier.
+ \brief Convert integer to string value.
+ \param val item ID
+ \return item value or empty string if \c val is invalid
*/
QString QDS_ComboBox::valueToString( const int val ) const
{
}
/*!
- Returns string from QComboBox widget. Reimplemented.
+ \brief Get string from the combo box.
+ \return string value
*/
QString QDS_ComboBox::getString() const
{
}
/*!
- Sets the string into QComboBox widget. Reimplemented.
+ \brief Set the string value to the combo box widget.
+ \param txt string value
*/
void QDS_ComboBox::setString( const QString& txt )
{
}
/*!
- Returns pointer to QtxComboBox widget.
+ \brief Get combo box widget.
+ \return internal combo box widget
*/
QtxComboBox* QDS_ComboBox::comboBox() const
{
}
/*!
- Create QComboBox widget as control subwidget. Reimplemented.
+ \brief Create internal combo box as control widget.
+ \param parent parent widget
+ \return created combo box widget
*/
QWidget* QDS_ComboBox::createControl( QWidget* parent )
{
}
/*!
- Notification about active unit system changing. Reimplemented from QDS_Datum.
- Update combobox content.
+ \brief Process notification about active units system changing.
+
+ Update combobox contents.
+
+ \param system new active units system
*/
void QDS_ComboBox::unitSystemChanged( const QString& system )
{
}
/*!
- Notify about text changing in line edit of ComboBox.
+ \brief Called when text in the combo box (editable) is modified by the user.
+ \param txt current text in the combo box editor (not used)
*/
-void QDS_ComboBox::onTextChanged( const QString& )
+void QDS_ComboBox::onTextChanged( const QString& /*txt*/ )
{
onParamChanged();
emit paramChanged();
}
/*!
- Notify about activation combobox item.
+ \brief Called when combo box item is activated.
+ \param idx index of teh item being activated
*/
void QDS_ComboBox::onActivated( int idx )
{
}
/*!
- Updates ComboBox after have change of visible state or items have been inserted/removed.
+ \brief Update combo box.
*/
void QDS_ComboBox::updateComboBox()
{
}
/*!
- Returns index of ComboBox item according to id.
+ \brief Get index of the combo box item according to its identifier.
+ \param id item ID
+ \return item index or -1 if not found
*/
int QDS_ComboBox::getIndex( const int id ) const
{
}
/*!
- Returns index of ComboBox item according to string.
+ \brief Get index of the combo box item.
+ \param str combo box item
+ \return item index or -1 if not found
*/
int QDS_ComboBox::getIndex( const QString& str ) const
{
}
/*!
- Returns id according to ComboBox item index.
+ \brief Get item identifier according to the specified index.
+ \param idx item index
+ \return item ID or -1 if index is out of range
*/
int QDS_ComboBox::getId( const int idx ) const
{
}
/*!
- Returns id according to ComboBox item string.
+ \brief Get item identifier.
+ \param str combo box item
+ \return item ID or -1 if not found
*/
int QDS_ComboBox::getId( const QString& str ) const
{
return id;
}
+
+/*!
+ \fn void QDS_ComboBox::activated( int id );
+ \brief Emitted when the current item in the combo box is changed.
+ \param id current item ID
+*/
+
+/*!
+ \fn void QDS_ComboBox::activated( const QString& txt );
+ \brief Emitted when the current item in the combo box is changed.
+ \param txt current item text
+*/
#include <QPixmap>
#include <QStringList>
-#include <QtxComboBox.h>
+#include <Qtx.h>
+
+class QtxComboBox;
#ifdef WIN32
#pragma warning( disable:4251 )
#include <QTimer>
#include <QLabel>
#include <QWidget>
-#include <QLayout>
-#include <QToolTip>
-#include <QWhatsThis>
-#include <QValidator>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
#include <QMessageBox>
#include <QEvent>
#include <TColStd_SequenceOfAsciiString.hxx>
/*!
- class: QDS_Datum::Wrapper
- descr: Wrapper widget for sub widgets. [internal]
+ \class QDS_Datum::Wrapper
+ \internal
+ \brief Wrapper for sub widgets.
*/
class QDS_Datum::Wrapper : public QWidget
QHBoxLayout* myBase;
};
+/*!
+ \brief Constructor.
+ \param parent parent widget
+*/
QDS_Datum::Wrapper::Wrapper( QWidget* parent )
: QWidget( parent ),
-myWid( 0 )
+ myWid( 0 )
{
//QHBoxLayout* base = new QHBoxLayout( this );
//base->setAutoAdd( true );
setFocusPolicy( Qt::StrongFocus );
}
+/*!
+ \brief Destructor.
+*/
QDS_Datum::Wrapper::~Wrapper()
{
}
+/*!
+ \brief Get widget.
+ \return widget
+*/
QWidget* QDS_Datum::Wrapper::widget() const
{
return myWid;
}
+/*!
+ \brief Set widget.
+ \param wid widget
+*/
void QDS_Datum::Wrapper::setWidget( QWidget* wid )
{
if ( myWid == wid )
updateGeometry();
}
+/*!
+ \brief Set size policy of the widget.
+ \param sp new size policy
+*/
void QDS_Datum::Wrapper::setSizePolicy( QSizePolicy sp )
{
QWidget::setSizePolicy( sp );
widget()->setSizePolicy( sp );
}
+/*!
+ \brief Set widget geometry.
+ \param x horizontal position
+ \param y vertical position
+ \param w widget width
+ \param h widget height
+*/
void QDS_Datum::Wrapper::setGeometry( int x, int y, int w, int h )
{
QWidget::setGeometry( x, y, w, h );
/*!
\class QDS_Datum
-
- This is a base class for control using the data dictionary. Datum is successor of QObject (not QWidget).
- This object can have three sub widgets named as Label, Control and Units. User can skip creation of
- some of them manipulate by parameter \aflags. Label widget display label of datum, Control widget allow
- to input value, Units widget display units of measure in the active system.
+ \brief 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 \a 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 constructs under parent of datum. If this parent has layout which can automaticaly add child
- widgets (see QLayout::setAutoAdd()) then these subwidgets will be placed in following order: first widget
- is Label, second - Control, third - Unints. User can add these widgets to layout manually using methods
- QDS_Datum::addTo() or QDS_Datum::widget(). In last case User can retrieve desired widget and place it into
- layout.
+ 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.
- If use QGroupBox as parent widget for datum object then all subwidgets will be arranged automatically by
- group box according to column and orientation properties of QGroupBox.
+ 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.
- For 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 );
+ Example:
+ \code
+ 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 );
+ \endcode
- In this example we create the QGroupBox with 3 horizontal columns. All created datum widgets will be
- placed automatically three widgets in a row. Each datum will be placed from up to bottom one by one.
+ 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 in different kinds:
- \liAs string - methods stringValue()/setStringValue().
- \liAs integer - methods integerValue()/setIntegerValue(). Given value converted to/from SI.
- \liAs double - methods doubleValue()/setDoubleValue(). Given value converted to/from SI.
- \liAs variant - methods value()/setValue().
+ Datum value is stored as string. User can get/set this value:
+ - As string : stringValue()/setStringValue().
+ - As integer : integerValue()/setIntegerValue(). Value is converted to/from SI.
+ - As double : doubleValue()/setDoubleValue(). Value is converted to/from SI.
+ - As variant : value()/setValue().
- User can perform some actions on datum subwidgets using following methods: isEnabled(),
- setEnabled(), show(), hide(), setShown(), setFocus(), setAlignment().
+ 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.
*/
/*!
- Constructor. Create datum object with datum identifier \aid under widget \aparent. Parameter \aflags
- define behaviour of datum and set of created subwidgets. Default value of this parameter is QDS::All.
- Parameter \acomp specify the component name which will be used during search of dictionary item.
+ \brief Constructor.
+
+ Create datum object with datum identifier \a id and parent widget \a parent.
+
+ Parameter \a flags defines behaviour of datum and set of created
+ subwidgets. Default value of this parameter is QDS::All.
- Datum register self in the static list by QDS::insertDatum().
+ Parameter \a 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().
+
+ \param id datum identifier
+ \param parent parent widget
+ \param flags datum flags
+ \param comp component
*/
QDS_Datum::QDS_Datum( const QString& id, QWidget* parent, const int flags, const QString& comp )
: QObject( parent ),
-myId( id ),
-myLabel( 0 ),
-myUnits( 0 ),
-myControl( 0 ),
-myFlags( flags ),
-myInitialised( false )
+ myId( id ),
+ myLabel( 0 ),
+ myUnits( 0 ),
+ myControl( 0 ),
+ myFlags( flags ),
+ myInitialised( false )
{
if ( myFlags & Label )
myWrapper.insert( Label, new Wrapper( parent ) );
}
/*!
- Destructor. Destroy all subwidget.
- Datum unregister self from the static list by QDS::removeDatum().
+ \brief Destructor.
+
+ Destroy all subwidget. Datum is unregistered from the global list
+ by QDS::removeDatum().
*/
QDS_Datum::~QDS_Datum()
{
}
/*!
- Overloaded operator allow to retrieve main subwidget named Control.
+ \brief Overloaded operator used to retrieve main subwidget named QDS::Control.
+ \return QDS::Control subwidget
*/
QDS_Datum::operator QWidget*() const
{
}
/*!
- Returns the datum id.
+ \brief Get the datum ID.
+ \return datum ID
*/
QString QDS_Datum::id() const
{
}
/*!
- Returns the datum type of value.
+ \brief Get the datum value type.
+ \return datum value type
*/
int QDS_Datum::type() const
{
}
/*!
- Returns the datum label string.
+ \brief Get the datum label text.
+ \return label text
*/
QString QDS_Datum::label() const
{
}
/*!
- Returns the datum units string.
+ \brief Get the datum units text.
+ \return units text
*/
QString QDS_Datum::units() const
{
}
/*!
- Returns the datum value filter string.
+ \brief Get the datum filter string.
+ \return filter string
*/
QString QDS_Datum::filter() const
{
}
/*!
- Returns the datum value format string.
+ \brief Get the datum format string
+ \return format string
*/
QString QDS_Datum::format() const
{
}
/*!
- Returns the datum default value string.
+ \brief Get the datum default value
+ \return default value
*/
QString QDS_Datum::defaultValue() const
{
}
/*!
- Returns the datum minimum value string.
+ \brief Get the datum minimum value.
+ \return minimum value
*/
QString QDS_Datum::minimumValue() const
{
}
/*!
- Returns the datum maximum value string.
+ \brief Get the datum maximum value.
+ \return maximum value
*/
QString QDS_Datum::maximumValue() const
{
}
/*!
- Returns the datum long description.
+ \brief Get the datum long description.
+ \return datum long description
*/
QString QDS_Datum::longDescription() const
{
}
/*!
- Returns the datum short description.
+ \brief Get the datum short description.
+ \return datum short description
*/
QString QDS_Datum::shortDescription() const
{
}
/*!
- Returns the list of option names.
+ \brief Get the datum options names.
+ \return datum options
*/
QStringList QDS_Datum::options() const
{
}
/*!
- Returns the option specified by \aname as QVariant.
- If option not exist then not valid QVariant returned.
+ \brief Get datum option specified by \a name as QVariant.
+ \return the option value or invalid QVariant if the option does not exist
*/
QVariant QDS_Datum::option( const QString& name ) const
{
}
/*!
- Returns the option specified by \aname as QString.
- If option not exist then empty string returned.
+ \brief Get datum option specified by \a name as string.
+ \return the option value or null QString if the option does not exist
*/
QString QDS_Datum::optionString( const QString& name ) const
{
}
/*!
- Returns the option specified by \aname as double.
- If option not exist then 0 returned.
+ \brief Get datum option specified by \a name as double.
+ \return the option value or 0 if the option does not exist
*/
double QDS_Datum::optionDouble( const QString& name ) const
{
}
/*!
- Returns the option specified by \aname as integer.
- If option not exist then 0 returned.
+ \brief Get datum option specified by \a name as integer.
+ \return the option value or 0 if the option does not exist
*/
int QDS_Datum::optionInteger( const QString& name ) const
{
}
/*!
- Returns the datum value as variant (QVariant object).
+ \brief Get the datum value as QVariant.
+ \return datum value
*/
QVariant QDS_Datum::value() const
{
}
/*!
- Returns the datum value as string (QString object).
+ \brief Get the datum value as string.
+ \return datum value converted to string
*/
QString QDS_Datum::stringValue() const
{
}
/*!
- Returns the datum value as double. This value converted from units of measure in active unit system
- to units of measure in unit system "SI".
+ \brief 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.
+
+ \return datum value converted to double
*/
double QDS_Datum::doubleValue() const
{
}
/*!
- Returns the datum value as integer. This value converted from units of measure in active unit system
- to units of measure in unit system "SI".
+ \brief 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.
+
+ \return datum value converted to integer
*/
int QDS_Datum::integerValue() const
{
}
/*!
- Returns the text from datum. Text consist of label, string value and units.
+ \brief Get the text data from datum.
+
+ Text consists of label, string value and units.
+
+ \return datum text data
*/
QString QDS_Datum::text() const
{
}
/*!
- Returns false if datum control has inputted value.
+ \brief Check if the datum is empty.
+ \return \c false if datum control has value entered
*/
bool QDS_Datum::isEmpty() const
{
}
/*!
- Reset datum state and set default value as current.
+ \brief Reset datum state and set default value as current.
*/
void QDS_Datum::reset()
{
}
/*!
- Clear the control.
+ \brief Clear the control.
*/
void QDS_Datum::clear()
{
}
/*!
- Set varian value (QVariant object) into datum.
+ \brief Set datum value from QVariant object.
+ \param val new value
*/
void QDS_Datum::setValue( const QVariant& val )
{
}
/*!
- Set string value (QString object) into datum.
+ \brief Set datum value from string data.
+ \param txt new value
*/
void QDS_Datum::setStringValue( const QString& txt )
{
}
/*!
- Set double value into datum. This value converted from units of measure in unit system "SI"
- to units of measure in active unit system. Format the value using datum format if it required.
+ \brief 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.
+
+ \param num new value
*/
void QDS_Datum::setDoubleValue( const double num )
{
}
/*!
- Set integer value into datum. This value converted from units of measure in unit system "SI"
- to units of measure in active unit system. Format the value using datum format if it required.
+ \brief 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.
+
+ \param num new value
*/
void QDS_Datum::setIntegerValue( const int num )
{
}
/*!
- Returns true if all subwidgets specified by \aelement enabled.
+ \brief Get 'enabled' state of the specified subwidget.
+ \param element ORed subwidget flags (QDS::DatumFlags)
+ \return \c true if all subwidgets specified by \a element are enabled
+ \sa setEnabled()
*/
bool QDS_Datum::isEnabled( const int element ) const
{
}
/*!
- Enable/Disable subwidgets specified by \aelement.
- Possible values of \aelement: Label, Control, Units or their combinations.
+ \brief Enable/disable subwidgets specified by \a element.
+
+ Possible values of \a element: QDS::Label, QDS::Control, QDS::Units
+ or their ORed combinations.
+
+ \param on new 'enabled' state
+ \param element ORed subwidget flags (QDS::DatumFlags)
+ \sa isEnabled()
*/
void QDS_Datum::setEnabled( const bool on, const int element )
{
}
/*!
- Enable/Disable control.
+ \brief Enable/disable main control subwidget (QDS::Control).
+ \param on new 'enabled' state
*/
void QDS_Datum::setEnabled( bool on )
{
}
/*!
- Show/hide subwidgets specified by \aelement.
- Possible values of \aelement: Label, Control, Units or their combinations.
+ \brief Show/hide subwidgets specified by \a flags.
+
+ Possible values of \a flags: QDS::Label, QDS::Control, QDS::Units
+ or their ORed combinations.
+
+ \param visible new 'visibility' state
+ \param flags ORed subwidget flags (QDS::DatumFlags)
+ \sa show(), hide()
*/
void QDS_Datum::setShown( const bool visible, const int flags )
{
}
/*!
- Show subwidgets specified by \aelement.
- Possible values of \aelement: Label, Control, Units or their combinations.
+ \brief Show subwidgets specified by \a element.
+
+ Possible values of \a element: QDS::Label, QDS::Control, QDS::Units
+ or their ORed combinations.
+
+ \param element ORed subwidget flags (QDS::DatumFlags)
+ \sa hide(), setShown()
*/
void QDS_Datum::show( const int element )
{
}
/*!
- Hide subwidgets specified by \aelement.
- Possible values of \aelement: Label, Control, Units or their combinations.
+ \brief Hide subwidgets specified by \a element.
+
+ Possible values of \a element: QDS::Label, QDS::Control, QDS::Units
+ or their ORed combinations.
+
+ \param element ORed subwidget flags (QDS::DatumFlags)
+ \sa show(), setShown()
*/
void QDS_Datum::hide( const int element )
{
}
/*!
- Returns subwidget specified by \aelement.
- Possible values of \aelement: Label, Control, Units.
+ \brief Get subwidget specified by \a element.
+
+ Possible values of \a element: QDS::Label, QDS::Control, QDS::Units.
+
+ \param element subwidget
+ \return widget
*/
QWidget* QDS_Datum::widget( const int element ) const
{
}
/*!
- Set the input focus on the control widget.
+ \brief Set the input focus to the control widget.
*/
void QDS_Datum::setFocus()
{
}
/*!
- Returns true if control contains valid value otherwise returns false
- and display warning message box if parameter \amsgBox is set.
+ \brief Check if input data is valid.
+
+ If data is invalid and \a msgBox is \c true, the warning message box is shown.
+
+ \param msgBox if \c true, show warning message box if input is invalid
+ \param extMsg warning message
+ \param extLabel optional name of the variable (if QDS::Label control is not used)
+ \return \c true if input data is valid
*/
bool QDS_Datum::isValid( const bool msgBox, const QString& extMsg, const QString& extLabel ) const
{
}
/*!
- Add widgets to the vertical box layout.
+ \brief Add widgets to the vertical box layout.
+ \param l layout
*/
void QDS_Datum::addTo( QVBoxLayout* l )
{
}
/*!
- Add widgets to the horizaontal box layout.
+ \brief Add widgets to the horizontal box layout.
+ \param l layout
*/
void QDS_Datum::addTo( QHBoxLayout* l )
{
}
/*!
- Add widgets to the grid layout.
+ \brief Add widgets to the grid layout.
+ \param theLay layout
+ \param theRow layout row index
+ \param theCol layout column index
+ \param vertical if \c true subwidgets are layouted vertically, otherwise - horizontally
*/
void QDS_Datum::addTo( QGridLayout* theLay, const int theRow, const int theCol, bool vertical )
{
}
/*!
- Set the aligment of Label or Units. For Control nothing happens.
+ \brief Set the aligment for QDS::Label and/or QDS::Units subwidgets.
+ \param align alignment type (Qt::Alignment)
+ \param type ORed subwidget flags
*/
void QDS_Datum::setAlignment( const int align, const int type )
{
}
/*!
+ \brief Event filter.
+
Perform delayed initialisation. Reimplemented for internal reasons.
+
+ \param o event reciever object
+ \param e event
+ \return \c true if event should be filtered
*/
bool QDS_Datum::eventFilter( QObject* o, QEvent* e )
{
}
/*!
- Notify about parameter value changing.
+ \brief Called when datum value is changed.
*/
void QDS_Datum::onParamChanged()
{
}
/*!
- Perform delayed initialization.
+ \brief Perform delayed initialization.
*/
void QDS_Datum::onInitDatum()
{
}
/*!
- Notify about subwidgets destroying. Allow to avoid repeated deleting in destructor.
+ \brief Called when child subwidget is destroued.
+
+ Allows avoiding crash of extra calling of the child subwidget destructor.
+
+ \param obj object being destroyed
*/
void QDS_Datum::onDestroyed( QObject* obj )
{
}
/*!
- Returns QLabel widget which contains dictionary item label.
+ \brief Get QDS::Label widget.
+ \return label widget
*/
QLabel* QDS_Datum::labelWidget() const
{
}
/*!
- Returns QLabel widget which contains dictionary item units.
+ \brief Get QDS::Units widget.
+ \return units widget
*/
QLabel* QDS_Datum::unitsWidget() const
{
}
/*!
- Returns QWidget which contains user input data.
+ \brief Get QDS::Control widget.
+ \return control widget
*/
QWidget* QDS_Datum::controlWidget() const
{
}
/*!
- Returns the dictionary item from the datum.
+ \brief Get the dictionary item from the datum.
+ \return handle to data dictionary item
*/
Handle(DDS_DicItem) QDS_Datum::dicItem() const
{
}
/*!
- Set the dictionary item in to the datum.
+ \brief Set the dictionary item to the datum.
+ \param item handle to data dictionary item
*/
void QDS_Datum::setDicItem( const Handle(DDS_DicItem)& item )
{
}
/*!
- Creates QLabel widget for dictionary item label.
+ \brief Create QDS::Label widget.
+ \param parent parent widget
+ \return label widget
*/
QLabel* QDS_Datum::createLabel( QWidget* parent )
{
}
/*!
- Creates QLabel widget for dictionary item units.
+ \brief Create QDS::Units widget.
+ \param parent parent widget
+ \return units widget
*/
QLabel* QDS_Datum::createUnits( QWidget* parent )
{
}
/*!
- Creates and returns validator accordance to datum type of value.
+ \fn QWidget* QDS_Datum::createControl( QWidget* parent );
+ \brief Create QDS::Control widget.
+
+ This method should be implemented in the successor classes.
+
+ \param parent parent widget
+ \return control widget
+*/
+
+/*!
+ \fn QString QDS_Datum::getString() const;
+ \brief Get string value from datum.
+
+ This method should be implemented in the successor classes.
+
+ \return datum string value
+*/
+
+/*
+ \fn void QDS_Datum::setString( const QString& txt );
+ \brief Set string value to datum.
+
+ This method should be implemented in the successor classes.
+
+ \param txt new datum string value
+*/
+
+/*!
+ \brief Create validator according to the datum type of value.
+ \param limits if \c true use minimum and maximum value limits
+ \return validator
*/
QValidator* QDS_Datum::validator( const bool limits ) const
{
}
/*!
- Checks the given string are valid or not.
+ \brief Validate the specified string.
+ \param txt string to be validated
+ \return \c true if string contains valid data
*/
bool QDS_Datum::validate( const QString& txt ) const
{
}
/*!
- Retrieves information from dictionary and create subwidgets using virtual mechanism.
- Virtual mechanism doesn't work in constructor and destructor, therefore this method should
+ \brief 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.
*/
void QDS_Datum::initialize()
}
/*!
- Notification about active unit system changing. Update label and units texts.
+ \brief Process notification about active units system changing.
+
+ Update label and units widgets.
+
+ \param unitSystem new active units system
*/
void QDS_Datum::unitSystemChanged( const QString& unitSystem )
{
}
/*!
- Covert units into text presentation.
+ \brief Convert units into text presentation.
+ \param uni units to be converted
+ \return text presentation of units (rich-text)
*/
QString QDS_Datum::unitsToText( const QString& uni )
{
}
/*!
- Covert text presentation into internal units format.
+ \brief Convert text presentation into internal units format.
+ \param txt text presentation of units (rich-text)
+ \return units value
*/
QString QDS_Datum::textToUnits( const QString& txt )
{
}
/*!
- Format the specified integer as dictionary item value.
+ \brief Format the specified integer as dictionary item value.
+ \param num integer value being formatted
+ \param id data dictionary ID
+ \param convert if \c true, perform conversion from "SI" units system
+ \return formatted value
*/
QString QDS_Datum::format( const int num, const QString& id, const bool convert )
{
}
/*!
- Format the specified double as dictionary item value.
+ \brief Format the specified double as dictionary item value.
+ \param num double value being formatted
+ \param id data dictionary ID
+ \param convert if \c true, perform conversion from "SI" units system
+ \return formatted value
*/
QString QDS_Datum::format( const double num, const QString& id, const bool convert )
{
}
/*!
- Format the specified string as dictionary item value.
+ \brief Format the specified string as dictionary item value.
+ \param str string value being formatted
+ \param id data dictionary ID
+ \param convert if \c true, perform conversion from "SI" units system
+ \return formatted value
*/
QString QDS_Datum::format( const QString& str, const QString& id, const bool convert )
{
}
/*!
- Format the given string accordance to dictionary item format.
+ \brief Format the given value according to the data dictionary item type.
+ \param aFormat format string
+ \param aType data dictionary item type
+ \param aValue integer value being formatted
+ \return formatted value
*/
QString QDS_Datum::format( const QString& aFormat, const int aType, const int aValue )
{
}
/*!
- Format the given string accordance to dictionary item format.
+ \brief Format the given value according to the data dictionary item type.
+ \param aFormat format string
+ \param aType data dictionary item type
+ \param aValue double value being formatted
+ \return formatted value
*/
QString QDS_Datum::format( const QString& aFormat, const int aType, const double aValue )
{
}
/*!
- Format the given string accordance to dictionary item format.
+ \brief Format the given value according to the data dictionary item type.
+ \param aFormat format string
+ \param aType data dictionary item type
+ \param aValue string value being formatted
+ \return formatted value
*/
QString QDS_Datum::format( const QString& aFormat, const int aType, const QString& aValue )
{
}
/*!
- Wrapper around the standard sprintf function.
+ \brief Wrapper around the standard sprintf() function.
+
Process some non standard flags from format string.
+
+ \param fmt string format
+ \param val value
+ \return formatted value
*/
QString QDS_Datum::sprintf( const QString& fmt, const int val )
{
}
/*!
- Wrapper around the standard sprintf function.
+ \brief Wrapper around the standard sprintf() function.
+ \overload
+
Process some non standard flags from format string.
+
+ \param fmt string format
+ \param val value
+ \return formatted value
*/
QString QDS_Datum::sprintf( const QString& fmt, const double val )
{
}
/*!
- Wrapper around the standard sprintf function.
+ \brief Wrapper around the standard sprintf() function.
+ \overload
+
Process some non standard flags from format string.
+
+ \param fmt string format
+ \param val value
+ \return formatted value
*/
QString QDS_Datum::sprintf( const QString& fmt, const QString& val )
{
}
/*!
- Returns the canonical sprintf format.
+ \brief Get the canonical sprintf() format.
+ \param fmt string format
+ \return canonical sprintf() format
*/
QString QDS_Datum::canonicalFormat( const QString& fmt )
{
}
/*!
- Returns the canonical sprintf format and non standard flags.
+ \brief Get the canonical sprintf() format and non standard flags.
+ \param fmt string format
+ \param flags format flags
+ \return canonical sprintf() format
*/
QString QDS_Datum::canonicalFormat( const QString& fmt, QString& flags )
{
}
/*!
- Returns displayable units string for given dictionary item id
+ \brief Get displayable units string for specified data dictionary item.
+ \param id data dictionary item ID
+ \return units string
*/
QString QDS_Datum::units( const QString& id )
{
}
/*!
- Get prefix string from format.
+ \brief Get prefix string from format.
+ \return current implementation returns null string
*/
QString QDS_Datum::prefix() const
{
}
/*!
- Get suffix string from format.
+ \brief Get suffix string from format.
+ \return current implementation returns null string
*/
QString QDS_Datum::suffix() const
{
}
/*!
- Get min value.
+ \brief Get minimum value.
+ \return minimum value
*/
QString QDS_Datum::minValue() const
{
}
/*!
- Get max value.
+ \brief Get maximum value.
+ \return maximum value
*/
QString QDS_Datum::maxValue() const
{
}
/*!
- Reset the numeric value cache.
+ \brief Reset the numeric value cache.
*/
void QDS_Datum::invalidateCache()
{
}
/*!
- Remove the acceleartor tags '&' from specified label string \asrc.
+ \brief Remove the acceleartor tags '&' from specified label string \a src.
+ \param src processed string
+ \return string after removing '&' symbols
*/
QString QDS_Datum::removeAccel( const QString& src )
{
}
/*!
- Returns true if given format string \atheFormat has specificator for double values.
+ \brief Check if given format specified doube value.
+ \param theFormat format string
+ \return \c true if \a theFormat has specificator for double values
*/
bool QDS_Datum::isDoubleFormat( const QString& theFormat )
{
}
/*!
- Returns datum flags.
+ \brief Get datum flags.
+ \return datum flags (QDS::DatumFlags)
*/
int QDS_Datum::flags() const
{
}
/*!
- Perform intialization if it needed. [internal]
+ \brief Perform initialization if it needed.
+ \internal
*/
void QDS_Datum::initDatum() const
{
}
/*!
- Return wrapper for specified subwidget. [internal]
+ \brief Get wrapper for specified subwidget.
+ \internal
+ \param wid subwidget
+ \return wrapper
*/
QDS_Datum::Wrapper* QDS_Datum::wrapper( QWidget* wid ) const
{
}
/*!
- Return wrapper for specified subwidget name. [internal]
+ \brief Get wrapper for specified subwidget.
+ \internal
+ \param id subwidget ID
+ \return wrapper
*/
QDS_Datum::Wrapper* QDS_Datum::wrapper( const int id ) const
{
}
/*!
- Return subwidget name for specified wrapper. [internal]
+ \brief Get subwidget type for specified wrapper.
+ \internal
+ \param wrap wrapper
+ \return subwidget ID
*/
int QDS_Datum::wrapperType( QDS_Datum::Wrapper* wrap ) const
{
}
return id;
}
+
+/*!
+ \fn void QDS_Datum::paramChanged();
+ \brief The signal is emitted when the datum value is changed.
+*/
+
+/*!
+ void QDS_Datum::paramChanged( QString& txt );
+ \brief The signal is emitted when the datum value is changed.
+ \param txt new datum value
+*/
+
#include "QDS.h"
-#include <QWidget>
#include <QString>
#include <QVariant>
#include <QPointer>
class QHBoxLayout;
class QGridLayout;
-class Handle(DDS_Dictionary);
-
class QDS_EXPORT QDS_Datum : public QObject, public QDS
{
Q_OBJECT
#include <QLineEdit>
#include <QValidator>
-/*
- class: QDS_LineEdit::Editor
- descr: Internal class inherited from line edit
+/*!
+ \class QDS_LineEdit::Editor
+ \internal
+ \brief Improved version of QLineEdit.
*/
class QDS_LineEdit::Editor : public QLineEdit
/*
\class QDS_LineEdit
- Datum with control corresponding to line edit. User can enter parameter value in single line editor.
- User inputted values will be checked by validator according to type if value and parameter properties
- (minimum, maximum, filter, precision, etc). If user input not valid value then this value will be
- displayed in red color.
+ \brief Datum with control corresponding to the line edit.
+
+ User can enter parameter value in single line editor.
+ The value entered by the user is checked by the validator according to item type
+ according to the item properties (minimum, maximum, filter, precision, etc).
+
+ If user input is not valid, the value is displayed in red color.
*/
/*!
- Constructor. Create line edit datum object with datum identifier \aid under widget \aparent. Parameter \aflags
- define behaviour of datum and set of created subwidgets. Default value of this parameter is QDS::All.
- Parameter \acomp specify the component name which will be used during search of dictionary item.
+ \brief Constructor.
+
+ Create line edit datum object with datum identifier \a id and parent widget \a parent.
+
+ Parameter \a flags defines behaviour of datum and set of created
+ subwidgets. Default value of this parameter is QDS::All.
+
+ Parameter \a comp specifies the component name which will be used
+ when searching the dictionary item.
+
+ \param id datum identifier
+ \param parent parent widget
+ \param flags datum flags
+ \param comp component
*/
QDS_LineEdit::QDS_LineEdit( const QString& id, QWidget* parent, const int flags, const QString& comp )
: QDS_Datum( id, parent, flags, comp )
}
/*!
- Destructor.
+ \brief Destructor.
*/
QDS_LineEdit::~QDS_LineEdit()
{
}
/*!
- Notification about active unit system changing. Reimplemented from QDS_Datum.
+ \brief Process notification about active units system changing.
+
Update validator settings for line edit.
+
+ \param system new active units system
*/
void QDS_LineEdit::unitSystemChanged( const QString& system )
{
}
/*!
- Select all text in the editor.
+ \brief Select all text in the editor.
*/
void QDS_LineEdit::selectAll()
{
}
/*!
- Deselect all text in the editor.
+ \brief Deselect all text in the editor.
*/
void QDS_LineEdit::deselect()
{
}
/*!
- Select or deselect all text in the editor.
+ \brief Select/deselect all text in the editor.
+ \param on select text if \c true and deselect if \c false
*/
void QDS_LineEdit::setSelection( const bool on )
{
}
/*!
- Returns true if the editor has selected text.
+ \brief Check if there is selection in the editor.
+ \return \c true if the editor has selected text
*/
bool QDS_LineEdit::hasSelection() const
{
}
/*!
- Set the aligment of line edit. Reimplemented from QDS_Datum.
+ \brief Set the aligment for the line edit.
+ \param align alignment type (Qt::Alignment)
+ \param type ORed subwidget flags
*/
void QDS_LineEdit::setAlignment( const int align, const int type )
{
}
/*!
- Returns string value from QLineEdit widget. Reimplemented from QDS_Datum.
+ \brief Get string value from datum.
+ \return datum string value
*/
QString QDS_LineEdit::getString() const
{
}
/*!
- Sets the string value into QLineEdit widget. Reimplemented from QDS_Datum.
+ \brief Set string value to datum.
+ \param txt new datum string value
*/
void QDS_LineEdit::setString( const QString& txt )
{
}
/*!
- Returns pointer to QLineEdit widget.
+ \brief Get line edit widget.
+ \return pointer to the QLineEdit widget
*/
QLineEdit* QDS_LineEdit::lineEdit() const
{
}
/*!
- Create QLineEdit widget as control subwidget. Reimplemented from QDS_Datum.
+ \brief Create line edit widget as control subwidget.
+ \param parent parent widget
+ \return created line edit widget
*/
QWidget* QDS_LineEdit::createControl( QWidget* parent )
{
}
/*!
- Notify about text changing in line edit.
+ \brief Called when text in the edit box is modified by the user.
+
+ Notify about text changing in the line edit.
+
+ \param txt current text in the line edit widget (not used)
*/
-void QDS_LineEdit::onTextChanged( const QString& )
+void QDS_LineEdit::onTextChanged( const QString& /*txt*/ )
{
invalidateCache();
}
/*!
- Checks the current parameter value on validity. If value is not valid then set text color as red.
+ \brief Called when text is changed.
+
+ Validate the current parameter value. If value is not valid then set text color as red.
+
+ Emits signal paramChanged() to notify about changing of the control state.
*/
void QDS_LineEdit::onParamChanged()
{
anEdit->setPalette( aPal );
}
+
+/*!
+ \brief void QDS_LineEdit::returnPressed();
+ \brief The signal is emitted when user presses \c Enter key in the line edit.
+*/
//
#include "QDS_RadioBox.h"
-#include <DDS_Dictionary.h>
-
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfExtendedString.hxx>
/*
\class QDS_RadioBox
-
- Datum with control corresponding to button group with set of exclusive radio buttons.
+ \brief Datum with control corresponding to button group with set of exclusive radio buttons.
+
This control used for datum with enumerable values. It can be used for datum which has
- type of value 'List'. Each radio button of combobox defined two properties:
- integer identifier and string name. All operations on radio buttons performed via identifier.
+ type of value 'List'. Each radio button of group box is defined by two properties:
+ integer identifier and string name. All operations on radio buttons are performed via identifier.
- If datum label text is specified then it displayed in group box title.
+ If datum label text is specified, then it is displayed in the group box title.
*/
/*!
- Constructor. Create radio button box datum object with datum identifier \aid under widget \aparent.
- Parameter \aflags define behaviour of datum and set of created subwidgets. Default value of this
- parameter is QDS::Control. Parameter \acomp specify the component name which will be used during
- search of dictionary item.
+ \brief Constructor.
+
+ Create radio button box datum object with datum identifier \a id and parent widget \a parent.
+
+ Parameter \a flags defines behaviour of datum and set of created
+ subwidgets. Default value of this parameter is QDS::All.
+
+ Parameter \a comp specifies the component name which will be used
+ when searching the dictionary item.
+
+ \param id datum identifier
+ \param parent parent widget
+ \param flags datum flags
+ \param comp component
*/
QDS_RadioBox::QDS_RadioBox( const QString& id, QWidget* parent, const int flags, const QString& comp )
- : QDS_Datum( id, parent, flags & ~( Label | Units ), comp ),
- myButtonGroup( 0 )
+: QDS_Datum( id, parent, flags & ~( Label | Units ), comp ),
+ myButtonGroup( 0 )
{
}
/*!
- Destructor.
+ \brief Destructor.
*/
QDS_RadioBox::~QDS_RadioBox()
{
}
/*!
- Returns number of buttons in radio box. If total is 'false' then only
- visible buttons are taken into account otherwise all buttons.
+ \brief Get number of buttons in radio box.
+
+ If \a total is \c false, only visible buttons are taken into account;
+ otherwise total number of buttons is returned
+
+ \param total get number of visible buttons if \c true and total number of buttons if \c false
+ \return requested number of items
*/
int QDS_RadioBox::count( bool total ) const
{
}
/*!
- Returns list of button identifiers \aids. If \atotal is 'false' then only visible
- buttons are taken into account otherwise all buttons.
+ \brief Get buttons identifiers.
+ \param ids returned list of buttons IDs
+ \param total take into account only visible buttons if \c true and all buttons if \c false
*/
void QDS_RadioBox::values( QList<int>& ids, bool total ) const
{
}
/*!
- Returns visible state of button specified by \aid.
+ \brief Get visibility state of the button specified by \a id.
+ \param id button ID
+ \return item visibility state
*/
bool QDS_RadioBox::state( const int id ) const
{
}
/*!
- Sets the visible state of button specified by \aid. If \aid is -1 then specified
- state will be set to all buttons. If \aappend is set then keep status for other
- buttons otherwise status of other buttons will be cleared.
+ \brief Set the visibility state of the button specified by \a id.
+
+ If \a id is -1 then specified state will be set to all buttons.
+
+ If \a append is set to \c true, keep current status for other buttons,
+ otherwise status of other buttons is cleared.
+
+ \param on new visibility state
+ \param id button ID
+ \param append if \c true, keep original status for other buttons
*/
void QDS_RadioBox::setState( const bool on, const int id, const bool append )
{
}
/*!
- Sets the visible state of buttons specified by list of identifiers \aids.
- If \aappend is set then keep status for other buttons otherwise status of other
- buttons will be cleared.
+ \brief Set the visibility state of buttons specified by \a ids.
+
+ If \a append is set to \c true, keep the current status for other buttons,
+ otherwise status of other buttons is cleared.
+
+ \param on new visibility state
+ \param ids buttons IDs list
+ \param append if \c true, keep original status for other buttons
*/
void QDS_RadioBox::setState( const bool on, const QList<int>& ids, const bool append )
{
}
/*!
- Sets the custom user buttons into the radio box. User buttons like standard dictionary
- button from list will be added into the radio box. This functionality allow to user override
+ \brief Set the custom user buttons into the radio box.
+
+ User items like standard dictionary buttons will be added
+ into the radio box. This function allows user to customize
buttons.
+
+ \param ids buttons IDs
+ \param names buttons names
*/
void QDS_RadioBox::setValues( const QList<int>& ids, const QStringList& names )
{
}
/*!
- This is an overloaded member function, provided for convenience.
- It behaves essentially like the above function. It creates
- QValueList (0, 1, 2 ... ) and call previous method
+ \brief Set the custom user buttons into the radio box.
+ \overload
+
+ User buttons like standard dictionary buttons will be added
+ into the radio box. This function allows user to customize
+ buttons.
+
+ Uses (0, 1, 2 ... ) as buttons IDs.
+
+ \param names buttons names
*/
void QDS_RadioBox::setValues( const QStringList& names )
{
}
/*!
- Returns string from radio box. Reimplemented. String which contains identifier of
- currently selected button returned.
+ \brief Get string from the radio box.
+
+ String which contains identifier of the currently selected button is returned.
+ \return identifier of the current button converted to string
*/
QString QDS_RadioBox::getString() const
{
}
/*!
- Sets the string into radio box. Reimplemented. Button with identifier from specified
- string \atxt became selected in radio box.
+ \brief Set the string value to the radio box widget.
+
+ Button with the identifier from specified string \a txt becomes selected in the radio box.
+
+ \param txt string value
*/
void QDS_RadioBox::setString( const QString& txt )
{
}
/*!
- Returns pointer to QButtonGroup widget.
+ \brief Get internal button group.
+ \return pointer to the QButtonGroup object
*/
QButtonGroup* QDS_RadioBox::buttonGroup() const
{
}
/*!
- Returns pointer to QGroupBox widget.
+ \brief Get internal group box widget.
+ \return pointer to the QGroupBox widget
*/
QGroupBox* QDS_RadioBox::groupBox() const
{
}
/*!
- Create QButtonGroup widget as control subwidget.
+ \brief Get radio button group box widget.
+ \return internal group box widget
*/
QWidget* QDS_RadioBox::createControl( QWidget* parent )
{
}
/*!
- Notification about active unit system changing. Reimplemented from QDS_Datum.
- Update radio box content.
+ \brief Process notification about active units system changing.
+
+ Update radio box contents.
+
+ \param system new active units system
*/
void QDS_RadioBox::unitSystemChanged( const QString& system )
{
}
/*!
- Notify about activation radio button.
+ \brief Called when user toggles any radio button.
+ \param on new radio button state
*/
void QDS_RadioBox::onToggled( bool on )
{
}
/*!
- Updates RadioBox after have change of visible state or buttons have been inserted/removed.
+ \brief Update radio box.
*/
void QDS_RadioBox::updateRadioBox()
{
}
/*!
- Returns the list of the radio buttons from the button group.
+ \brief Get all the radio buttons from the radio box.
+ \param lst returned list of radio buttons
*/
void QDS_RadioBox::buttons( QList<QRadioButton*>& lst ) const
{
while ( it.hasNext() )
lst.append( it.next() );
}
+
+/*!
+ \fn void QDS_RadioBox::activated( int id );
+ \brief The signal is emitted when any radio button is toggled.
+ \param id button ID
+*/
#include <QtxIntSpinBox.h>
-//#include <QValidator>
-
/*
\class QDS_SpinBox
-
- Datum with control corresponding to spin box. This control used for integer numbers.
- User can input data directly in spin box or can modify current value with given
- increment.
+ \brief Datum with control corresponding to spin box.
+
+ This control used for integer numbers. User can input data directly in the spin box
+ or can modify current value by clicking arrow (+/-) buttons.
*/
/*!
- Constructor. Create spin box datum object with datum identifier \aid under widget \aparent. Parameter \aflags
- define behaviour of datum and set of created subwidgets. Default value of this parameter is QDS::All.
- Parameter \acomp specify the component name which will be used during search of dictionary item.
+ \brief Constructor.
+
+ Create spin box datum object with datum identifier \a id and parent widget \a parent.
+
+ Parameter \a flags defines behaviour of datum and set of created
+ subwidgets. Default value of this parameter is QDS::All.
+
+ Parameter \a comp specifies the component name which will be used
+ when searching the dictionary item.
+
+ \param id datum identifier
+ \param parent parent widget
+ \param flags datum flags
+ \param comp component
*/
QDS_SpinBox::QDS_SpinBox( const QString& id, QWidget* parent, const int flags, const QString& comp )
: QDS_Datum( id, parent, flags, comp )
}
/*!
- Destructor.
+ \brief Destructor.
*/
QDS_SpinBox::~QDS_SpinBox()
{
}
/*!
- Returns string from QSpinBox widget. Reimplemented.
+ \brief Get string from the spin box.
+ \return string value
*/
QString QDS_SpinBox::getString() const
{
}
/*!
- Sets the string into QSpinBox widget. Reimplemented.
+ \brief Set the string value to the spin box widget.
+ \param txt string value
*/
void QDS_SpinBox::setString( const QString& txt )
{
}
/*!
- Returns pointer to QSpinBox widget.
+ \brief Get spin box widget.
+ \return internal spin box widget.
*/
QtxIntSpinBox* QDS_SpinBox::spinBox() const
{
}
/*!
- Create QSpinBox widget as control subwidget. Reimplemented.
+ \brief Create internal spin box as control widget.
+ \param parent parent widget
+ \return created spin box widget
*/
QWidget* QDS_SpinBox::createControl( QWidget* parent )
{
}
/*!
- Notify about value changing in spin box.
+ \brief Called when value in the spin box is changed.
+
+ Emit signals to notify about value changing in the spin box.
+
+ \param val current spin box value
*/
void QDS_SpinBox::onValueChanged( int val )
{
}
/*!
- Sets the increment step.
+ \brief Set the spin box increment value.
+ \param step new increment value
*/
void QDS_SpinBox::setStep( const int step )
{
}
/*!
- Returns the increment step.
+ \brief Get the spin box increment value.
+ \return current increment value
*/
int QDS_SpinBox::step() const
{
}
/*!
- Notification about active unit system changing. Reimplemented from QDS_Datum.
- Update validator and spin box parameters: suffix, prefix, minimum, maximum.
+ \brief Process notification about active units system changing.
+
+ Update spin box contents according to the data dictionary item properties: suffix, prefix, minimum, maximum
+
+ \param system new active units system
*/
void QDS_SpinBox::unitSystemChanged( const QString& system )
{
//
#include "QDS_SpinBoxDbl.h"
-#include <DDS_Dictionary.h>
-
-//#include <QValidator>
-
#include <QtxDblSpinBox.h>
/*
\class QDS_SpinBoxDbl
+ \brief Datum with control corresponding to spin box.
- Datum with control corresponding to spin box. This control used for double numbers.
- User can input data directly in spin box or can modify current value with given
- increment.
+ This control is suitable for double numbers. User can input data directly in the spin box
+ or can modify current value by clicking arrow (+/-) buttons.
*/
/*!
- Constructor. Create spin box datum object with datum identifier \aid under widget \aparent. Parameter \aflags
- define behaviour of datum and set of created subwidgets. Default value of this parameter is QDS::All.
- Parameter \acomp specify the component name which will be used during search of dictionary item.
+ \brief Constructor.
+
+ Create spin box datum object with datum identifier \a id and parent widget \a parent.
+
+ Parameter \a flags defines behaviour of datum and set of created
+ subwidgets. Default value of this parameter is QDS::All.
+
+ Parameter \a comp specifies the component name which will be used
+ when searching the dictionary item.
+
+ \param id datum identifier
+ \param parent parent widget
+ \param flags datum flags
+ \param comp component
*/
QDS_SpinBoxDbl::QDS_SpinBoxDbl( const QString& id, QWidget* parent, const int flags, const QString& comp )
: QDS_Datum( id, parent, flags, comp )
}
/*!
- Destructor.
+ \brief Destructor.
*/
QDS_SpinBoxDbl::~QDS_SpinBoxDbl()
{
}
/*!
- Returns string from QSpinBox widget. Reimplemented.
+ \brief Get string from the spin box.
+ \return string value
*/
QString QDS_SpinBoxDbl::getString() const
{
}
/*!
- Sets the string into QSpinBox widget. Reimplemented.
+ \brief Set the string value to the spin box widget.
+ \param txt string value
*/
void QDS_SpinBoxDbl::setString( const QString& txt )
{
}
/*!
- Returns pointer to QtxDblSpinBox widget.
+ \brief Get spin box widget.
+ \return internal spin box widget.
*/
QtxDblSpinBox* QDS_SpinBoxDbl::spinBox() const
{
}
/*!
- Create QSpinBox widget as control subwidget. Reimplemented.
+ \brief Create internal spin box as control widget.
+ \param parent parent widget
+ \return created spin box widget
*/
QWidget* QDS_SpinBoxDbl::createControl( QWidget* parent )
{
}
/*!
- Notify about value changing in spin box.
+ \brief Called when value in the spin box is changed.
+
+ Emit signals to notify about value changing in the spin box.
+
+ \param val current spin box value
*/
void QDS_SpinBoxDbl::onValueChanged( double )
{
}
/*!
- Returns the increment step.
+ \brief Get the spin box increment value.
+ \return current increment value
*/
double QDS_SpinBoxDbl::step() const
{
}
/*!
- Sets the increment step.
+ \brief Set the spin box increment value.
+ \param step new increment value
*/
void QDS_SpinBoxDbl::setStep( const double step )
{
}
/*!
- Notification about active unit system changing. Reimplemented from QDS_Datum.
- Update validator and spin box parameters: suffix, prefix, minimum, maximum.
+ \brief Process notification about active units system changing.
+
+ Update spin box contents according to the data dictionary item properties: suffix, prefix, minimum, maximum
+
+ \param system new active units system
*/
void QDS_SpinBoxDbl::unitSystemChanged( const QString& system )
{
#include "QDS_Table.h"
-#include "QDS_LineEdit.h"
-
class QDS_Table::DeleteFilter : public QObject
{
public:
#include <QtxTable.h>
#include <QMap>
-#include <QPtrVector>
+#include <QVector>
class QDS_EXPORT QDS_Table : public QtxTable
{
QDS_Datum* datum( const QWidget* ) const;
private:
- typedef QPtrVector<QDS_Datum> DatumVector;
+ typedef QVector<QDS_Datum*> DatumVector;
typedef QMap<int, QDS_Datum*> DatumMap;
typedef QMap<int, DatumMap> CellMap;
/*
\class QDS_TextEdit
+ \brief Datum with control corresponding to the text edit.
- Datum with control corresponding to text edit. User can enter parameter value in multiple line editor.
+ User can enter parameter value in multi line editor.
*/
/*!
- Constructor. Create text edit datum object with datum identifier \aid under widget \aparent.
- Parameter \aflags define behaviour of datum and set of created subwidgets. Default value of this
- parameter is QDS::All. Parameter \acomp specify the component name which will be used during search
- of dictionary item.
+ \brief Constructor.
+
+ Create combobox datum object with datum identifier \a id
+ and parent widget \a parent.
+
+ Parameter \a flags defines behaviour of datum and set of created
+ subwidgets. Default value of this parameter is QDS::All.
+
+ Parameter \a comp specifies the component name which will be used
+ when searching the dictionary item.
+
+ \param id datum identifier
+ \param parent parent widget
+ \param flags datum flags
+ \param comp component
*/
QDS_TextEdit::QDS_TextEdit( const QString& id, QWidget* parent, const int flags, const QString& comp )
: QDS_Datum( id, parent, flags, comp )
}
/*!
- Destructor.
+ \brief Destructor.
*/
QDS_TextEdit::~QDS_TextEdit()
{
}
/*!
- Returns string from QTextEdit widget. Reimplemented from QDS_Datum.
+ \brief Get string value from datum.
+ \return datum string value
*/
QString QDS_TextEdit::getString() const
{
}
/*!
- Sets the string into QTextEdit widget. Reimplemented from QDS_Datum.
+ \brief Set string value to datum.
+ \param txt new datum string value
*/
void QDS_TextEdit::setString( const QString& txt )
{
}
/*!
- Returns pointer to QTextEdit widget.
+ \brief Get text edit widget.
+ \return internaltext edit widget
*/
QTextEdit* QDS_TextEdit::textEdit() const
{
}
/*!
- Create QTextEdit widget as control subwidget.
+ \brief Create text edit widget as control subwidget.
+ \param parent parent widget
+ \return created text edit widget
*/
QWidget* QDS_TextEdit::createControl( QWidget* parent )
{
}
/*!
+ \brief Called when text is changed by the user.
+
Notify about text changing in text edit.
*/
void QDS_TextEdit::onTextChanged()
emit paramChanged();
emit paramChanged( str );
}
+
+/*!
+ \fn void QDS_TextEdit::returnPressed();
+ \brief The signal is emitted when user presses \c Enter key in the text edit.
+*/
/*!
\class QDS_IntegerValidator
+ \brief A validator for integer values.
- This class to provide validation of user inputted string for datum with 'Integer'
+ This class provides validation of the strings entered by the user for datum with 'Integer'
value type according to datum properties: minimum value, maximum value, filter.
- Inherits from QIntValidator.
+ Inherits QIntValidator.
*/
/*!
- Constructor. Create empty validator object.
+ \brief Constructor.
+
+ Create empty validator object.
+
+ \param p parent object
*/
QDS_IntegerValidator::QDS_IntegerValidator( QObject* p )
: QIntValidator( p )
}
/*!
- Constructor. Create validator object with filter string \af.
+ \brief Constructor.
+
+ Create validator object with filter string \a f.
+
+ \param f filter string
+ \param p parent object
*/
QDS_IntegerValidator::QDS_IntegerValidator( const QString& f, QObject* p )
: QIntValidator( p ),
-myFilter( f )
+ myFilter( f )
{
}
/*!
- Destructor.
+ \brief Destructor.
*/
QDS_IntegerValidator::~QDS_IntegerValidator()
{
}
/*!
- Validate the inputed string \ainput. Reimplemented from QIntValidator. Perform
- standard check by QIntValidator::validate(). If returned state is not Invalid and
- filter specified then perform validation with filter by QRegExpValidator.
+ \brief Validate the entered string \a input.
+
+ Reimplemented from QIntValidator.
+
+ Perform standard check by QIntValidator::validate(). If returned state
+ is not \c QValidator::Invalid and filter is specified then perform validation
+ with filter by QRegExpValidator.
+
+ Returns \c QValidator::Invalid if input is invalid according to this validator's rules,
+ \c QValidator::Intermediate if it is likely that a little more editing will make the
+ input acceptable and \c QValidator::Acceptable if the input is valid.
- Returns Invalid if input is invalid according to this validator's rules,
- Intermediate if it is likely that a little more editing will make the input acceptable
- and Acceptable if the input is valid.
+ \param input string being validated
+ \param pos cursor position
+ \return validation state (\c QValidator::State)
*/
QValidator::State QDS_IntegerValidator::validate( QString& input, int& pos ) const
{
/*!
\class QDS_DoubleValidator
+ \brief A validator for floating point values.
- This class to provide validation of user inputted string for datum with 'Float'
+ This class provides validation of the strings entered by the user for datum with 'Float'
value type according to datum properties: minimum value, maximum value, precision, filter.
- Inherits from QDoubleValidator.
+ Inherits QDoubleValidator.
*/
/*!
- Constructor. Create empty validator object.
+ \brief Constructor.
+
+ Create empty validator object.
+
+ \param p parent object
*/
QDS_DoubleValidator::QDS_DoubleValidator( QObject* p )
: QDoubleValidator( p )
}
/*!
- Constructor. Create validator object with filter string \af.
+ \brief Constructor.
+
+ Create validator object with filter string \a f.
+
+ \param f filter string
+ \param p parent object
*/
QDS_DoubleValidator::QDS_DoubleValidator( const QString& f, QObject* p )
: QDoubleValidator( p ),
-myFilter( f )
+ myFilter( f )
{
}
/*!
- Destructor.
+ \brief Destructor.
*/
QDS_DoubleValidator::~QDS_DoubleValidator()
{
}
/*!
- Validate the inputed string \ainput. Reimplemented from QDoubleValidator. Perform
- standard check by QDoubleValidator::validate(). If returned state is not Invalid and
- filter specified then perform validation with filter by QRegExpValidator.
+ \brief Validate the entered string \a input.
- Returns Invalid if input is invalid according to this validator's rules,
- Intermediate if it is likely that a little more editing will make the input acceptable
- and Acceptable if the input is valid.
+ Reimplemented from QDoubleValidator.
+
+ Perform standard check by QDoubleValidator::validate(). If returned state
+ is not \c QValidator::Invalid and filter is specified then perform validation
+ with filter by QRegExpValidator.
+
+ Returns \c QValidator::Invalid if input is invalid according to this validator's rules,
+ \c QValidator::Intermediate if it is likely that a little more editing will make the
+ input acceptable and \c QValidator::Acceptable if the input is valid.
+
+ \param input string being validated
+ \param pos cursor position
+ \return validation state (\c QValidator::State)
*/
QValidator::State QDS_DoubleValidator::validate( QString& input, int& pos ) const
{
/*!
\class QDS_StringValidator
+ \brief A validator for string values.
- This class to provide validation of user inputted string for datum with 'String'
+ This class provides validation of the strings entered by the user for datum with 'String'
value type according to datum properties: format, filter.
- Inherits from QDoubleValidator.
+ Inherits from QValidator.
*/
/*!
- Constructor. Create empty validator object.
+ \brief Constructor.
+
+ Create empty validator object.
+
+ \param p parent object
*/
QDS_StringValidator::QDS_StringValidator( QObject* p )
: QValidator( p ),
-myLen( -1 )
+ myLen( -1 )
{
}
/*!
- Constructor. Create validator object with filter string \af.
+ \brief Constructor.
+
+ Create validator object with filter string \a f.
+
+ \param f filter string
+ \param p parent object
*/
QDS_StringValidator::QDS_StringValidator( const QString& f, QObject* p )
: QValidator( p ),
-myFlags( f ),
-myLen( -1 )
+ myFlags( f ),
+ myLen( -1 )
{
}
/*!
- Constructor. Create validator object with filter string \aft and format flags \afg.
+ \brief Constructor.
+
+ Create validator object with filter string \a ft and format flags \a fg.
+ \param ft filter string
+ \param fg format string
+ \param p parent object
*/
QDS_StringValidator::QDS_StringValidator( const QString& ft, const QString& fg, QObject* p )
: QValidator( p ),
-myLen( -1 ),
-myFilter( ft ),
-myFlags( fg )
+ myLen( -1 ),
+ myFilter( ft ),
+ myFlags( fg )
{
}
/*!
- Destructor.
+ \brief Destructor.
*/
QDS_StringValidator::~QDS_StringValidator()
{
}
/*!
- Returns valid string length. If length not specified -1 returned.
+ \brief Get maximum valid string length.
+
+ If maximum length is not specified, -1 is returned.
+
+ \return maximum string length
*/
int QDS_StringValidator::length() const
{
}
/*!
- Sets the valid string length \al. If value less than zero valid string
- length not specified.
+ \brief Set maximum valid string length.
+
+ If l <= 0 is not specified, maximum valid length is reset
+ (any string length is valid).
+
+ \param l maximum strin length
*/
void QDS_StringValidator::setLength( const int l )
{
}
/*!
- Validate the inputed string \ainput. Reimplemented from QValidator. Convert specified
- string to upper/lower case if the format flags contains specificator 'u'/'l'.
- If valid string lenght is specified then check given string length. If
- filter specified then perform validation with filter by QRegExpValidator.
-
- Returns Invalid if input is invalid according to this validator's rules,
- Intermediate if it is likely that a little more editing will make the input acceptable
- and Acceptable if the input is valid.
+ \brief Validate the entered string \a input.
+
+ Reimplemented from QValidator.
+
+ Convert specified string to the upper/lower case if the format flags contains
+ specificator 'u'/'l' correspondingly. If valid string length is specified,
+ then check given string length. If filter is specified, then perform also
+ validation with filter by QRegExpValidator.
+
+ Returns \c QValidator::Invalid if input is invalid according to this validator's rules,
+ \c QValidator::Intermediate if it is likely that a little more editing will make the
+ input acceptable and \c QValidator::Acceptable if the input is valid.
+
+ \param input string being validated
+ \param pos cursor position
+ \return validation state (\c QValidator::State)
*/
QValidator::State QDS_StringValidator::validate( QString& input, int& pos ) const
{
#include <QValidator>
-/*!
- class QDS_IntegerValidator
-*/
class QDS_EXPORT QDS_IntegerValidator : public QIntValidator
{
public:
virtual State validate( QString&, int& ) const;
private:
- QString myFilter;
+ QString myFilter; //!< string filter
};
-/*!
- class QDS_DoubleValidator
-*/
class QDS_DoubleValidator : public QDoubleValidator
{
public:
virtual State validate( QString&, int& ) const;
private:
- QString myFilter;
+ QString myFilter; //!< string filter
};
-/*!
- class QDS_StringValidator
-*/
class QDS_EXPORT QDS_StringValidator : public QValidator
{
public:
void setLength( const int );
private:
- int myLen;
- QString myFlags;
- QString myFilter;
+ int myLen; //!< string length
+ QString myFlags; //!< string format flags
+ QString myFilter; //!< string filter
};
#endif