gSAFE  1.3.8
Public Member Functions | Protected Attributes | List of all members
HFloating Class Reference

#include <datalib.h>

Inheritance diagram for HFloating:
HDataField HSqlHandler HSqlInterface HBase

Public Member Functions

 HFloating (QString sqlc, QString ex, QString tit, QString t, QString def)
 
 HFloating (HFloating *t)
 
 ~HFloating (void)
 
virtual bool acceptFunction (void)
 
virtual bool acceptSubselect (void)
 
virtual QVariant dbValueToDispValue (QVariant v)
 
void deepcopy_from (HFloating *x)
 
virtual HDataFieldget_clone (void)
 
double getMaximum (void)
 
double getMinimum (void)
 
virtual QString getSQLValue (void)
 
virtual QString getSQLValueAsString (void)
 
virtual QVariant getValue (void)
 
QString getValueAsString (void)
 
virtual QString lowerValidate (void)
 
virtual int setDefval (QVariant v)
 
void setDisplayMode (int minDf, int maxDf, int groupDf)
 
void setMaximum (double m)
 
void setMinimum (double m)
 
virtual int setValue (QVariant v, bool sdisabled=false)
 
virtual QString sqlCreateStringPart (QString switches="")
 
virtual QString sqlInsertHead (void)
 
virtual QString sqlInsertValue (void)
 
virtual QString sqlSelectHead (void)
 
virtual QString sqlUpdate (void)
 
- Public Member Functions inherited from HDataField
 HDataField (QString _sqlColumn, QString _explain, QString tit, QString _tailstr="", bool _editable=true)
 
 HDataField (HDataField *t)
 
 ~HDataField (void)
 
void addMark (QString mark)
 
void addMark (QStringList pmarkers)
 
void addNotValidValue (QString v)
 
void addRole (HDataFieldRole role)
 
QStringList allMarker (void)
 
HDataFieldasColored (int r, int g, int b)
 
HDataFieldasConstant (void)
 
HDataFieldasHide (void)
 
void clearMarkers (void)
 
void clearNotValidValues (void)
 
void clearRoles (void)
 
void clearSqlSynced (void)
 
void deepcopy_from_hdatafield (HDataField *x)
 
QVariant defvalParser (QString s)
 
void delRole (QString name)
 
void doSet (void)
 
int editBoxMaxWidth (void)
 
int getBColor (void)
 
QString getDefaultValue (void)
 
virtual QVariant getDispValue ()
 
QString getExplainText (void)
 
QString getFunction (void)
 
int getGColor (void)
 
bool getLastValidateStatus ()
 
bool getPermanentValidateStatus ()
 
int getPrintCellWidth (void)
 
int getRColor (void)
 
QString getSpecDisplaySortMode (void)
 
QString getSubselect (void)
 
QString getTailText (void)
 
QString getTitleText (void)
 
bool hasMark (QString mark)
 
bool isEditable (void)
 
bool isGuienabled (void)
 
bool isLogged (void)
 
bool isMeldedWithNext (void)
 
bool isNoMiddleStretch (void)
 
bool isPrintCellWrap (void)
 
bool isReallyChanged (void)
 
bool isSet (void)
 
bool isShow (void)
 
bool isSQLField (void)
 
void meldWithNext (void)
 
void noMiddleStretch (void)
 
void notSet (void)
 
void resetFunction (void)
 
void resetLogging (void)
 
void resetMeldWithNext (void)
 
void resetNoMiddleStretch (void)
 
void resetSubselect (void)
 
void resetValidateStatus ()
 
int returnToDefault (void)
 
void setColor (int r, int g, int b)
 
void setData (QString _sqlColumn, QString _explain, QString tit, QString _tailstr="", bool _editable=true)
 
void setEditable (void)
 
void setEditBoxMaxWidth (int max)
 
void setExplainText (QString expl)
 
void setFunction (QString func)
 
void setGuidisabled (void)
 
void setGuienabled (void)
 
void setHide (void)
 
void setLogging (void)
 
void setMaulallyValidateError (QString message)
 
void setNotValidValues (QStringList nvl)
 
void setPrintCellNoWrap (void)
 
void setPrintCellWidth (int w)
 
void setPrintCellWrap (void)
 
void setReadonly (void)
 
void setShow (void)
 
void setSpecDisplaySortMode (QString m)
 
void setSubselect (QString subs)
 
void setTailText (QString tail)
 
void setTitleText (QString titl)
 
void setValidator (QString v="")
 
void sqlSynced (HDataChangeLogger *dclog=NULL, bool forcechange=false, bool forcelog=false)
 
void useRole (QString name)
 
QString validate (void)
 
virtual void value_changed ()
 
- Public Member Functions inherited from HSqlHandler
 HSqlHandler (void)
 
 ~HSqlHandler (void)
 
QSqlQuery * allocateQSqlQuery (void)
 
void cloneSqlSettingsFrom (HSqlHandler *other)
 
void commit (void)
 
bool errorStatus (void)
 
void rollback (void)
 
bool submit0ResultQuery (QString q, QString err, bool tdisabled=false)
 
QVariant submit1ResultQuery (QString q, QString err, bool tdisabled=false)
 
HPlainDataMatrixsubmitNResultQuery (int N, QString q, QString err, bool tdisabled=false)
 
void transaction (void)
 
QSqlDatabase workDB (void)
 
- Public Member Functions inherited from HSqlInterface
 HSqlInterface ()
 
 ~HSqlInterface ()
 
void cloneSqlInterfaceSettingsFrom (HSqlInterface *other)
 
HSqlSingleInterfacemyInterface (void)
 
QString sqlConcatenateToLocal (QString string)
 
QString sqlConcatenateToLocal (QStringList fields)
 
- Public Member Functions inherited from HBase
 HBase (void)
 
 ~HBase (void)
 
QString getWhoami (void)
 

Protected Attributes

int dMgroup
 
int dMmaxDf
 
int dMminDf
 
double maximum
 
double minimum
 
double value
 
- Protected Attributes inherited from HDataField
int color_b
 
int color_g
 
int color_r
 
QString defval
 
QString derived
 
bool editable
 
int editboxmaxwidth
 
QString explain
 
QString function
 
bool guienabled
 
bool lastvalidate_result
 
bool logged
 
QString manual_validate_error
 
QStringList markers
 
bool meldwithnext
 
bool nomiddlestretch
 
QStringList notvalid
 
bool permanentvalidate_result
 
QList< HDataFieldRoleroles
 
int set
 
bool show
 
QString spec_disp_sort
 
bool sql
 
QString sqlColumn
 
bool sync_valueInSql
 
QString tailstr
 
QString title
 
QString valid
 
QString valueInSql
 
bool wcell_print
 
int wcellw_print
 
- Protected Attributes inherited from HSqlHandler
bool query_error_occured
 
- Protected Attributes inherited from HBase
QString whoami
 

Additional Inherited Members

- Public Slots inherited from HDataField
void disableControlSlot (void)
 
void enableControlSlot (void)
 
- Signals inherited from HDataField
void dataChanged (void)
 
void disableControl (void)
 
void enableControl (void)
 
void updateStaticDisplayElementsSignal (void)
 
- Signals inherited from HSqlHandler
void errorSignal (QString err)
 
- Static Public Member Functions inherited from HSqlHandler
static void setCustomSqlDatabase (QString databaseName, QString sqlinterfacename="")
 
static void setDefaultSqlDatabase (void)
 
- Static Public Member Functions inherited from HSqlInterface
static HSqlSingleInterfacecurrentDefaultSqlInterface (void)
 
static HSqlSingleInterfacegetSqlInterface (QString interfacename)
 
static void setSqlMode (QString modename)
 
static void setSqlModeBackToFirst (void)
 
- Public Attributes inherited from HDataField
QString conn_sqlTable
 
bool connected
 
- Static Public Attributes inherited from HSqlHandler
static int trans = 0
 

Detailed Description

This is a field type class.
HFloating holds an floating point value, which is a floating point value in the sql database too.

Gui appearance: Simple one lined text edit box (QLineEdit)

Definition at line 3058 of file datalib.h.

Constructor & Destructor Documentation

HFloating::HFloating ( QString  sqlc,
QString  ex,
QString  tit,
QString  t,
QString  def 
)

Creates a HFloating field.

Parameters
sqlcthe sql name of the field
exthe explain text of the field
titthe title text of the field
tthe tail string of the field
defthe default text of the field

Definition at line 6584 of file datalib.cpp.

HFloating::~HFloating ( void  )

Destructor

Definition at line 6600 of file datalib.cpp.

HFloating::HFloating ( HFloating t)

Deepcopy constructor

Definition at line 6605 of file datalib.cpp.

Member Function Documentation

virtual bool HFloating::acceptFunction ( void  )
inlinevirtual

If this functions returns true then the field accepts sql functions. Otherwise the setFunction() function is do nothing This function can be redefined in descendats!

See Also
setFunction

Reimplemented from HDataField.

Definition at line 3095 of file datalib.h.

virtual bool HFloating::acceptSubselect ( void  )
inlinevirtual

If this functions returns true then the field accepts sql subselects instead of read a simple value. Otherwise setSubselect() function is do nothing This function can be redefined in descendats!

See Also
setSubselect

Reimplemented from HDataField.

Definition at line 3096 of file datalib.h.

QVariant HFloating::dbValueToDispValue ( QVariant  v)
virtual

Converting function, you can give a HDataFiled(or descendant) value to this function, and you get the corresponding sql value of the given value.
This function usally redefined in descendats!
In simple typed fields this function do a trivial conversion for example a text field do "text"->"'text'" conversion. Other cases where the field is more complex (HSqlChoose for example) this conversion can be more complex.

In HSqlChoose can be:
"Joe Black" -> "id_0123"
"Little Richard" -> "id_03453"
"John Wayne" -> "id_0197"
etc...


In a HCharHash the result can be:
"Animal" -> "a"
"Plant" -> "p"
"Objects" -> "o"
etc...

Reimplemented from HDataField.

Definition at line 6626 of file datalib.cpp.

void HFloating::deepcopy_from ( HFloating x)

Deepcopy from the given parameter

Definition at line 6611 of file datalib.cpp.

HDataField * HFloating::get_clone ( void  )
virtual

Returns a clone of this field

Reimplemented from HDataField.

Definition at line 6621 of file datalib.cpp.

double HFloating::getMaximum ( void  )
inline

Returns the maximum value of the field (check in validation)

Definition at line 3109 of file datalib.h.

double HFloating::getMinimum ( void  )
inline

Returns the minimum value of the field (check in validation)

Definition at line 3107 of file datalib.h.

QString HFloating::getSQLValue ( void  )
virtual

Returns the value of the field in that format which accepted by the sql database.

Reimplemented from HDataField.

Definition at line 6673 of file datalib.cpp.

QString HFloating::getSQLValueAsString ( void  )
virtual

Returns string format of the field's value. Very similar to getSQLValue() but the result is always acceptable in an sql varchar field. (Mostly used by the logger system, when every kind of values are stored in varchar. The gsafe try to keep the value as close to the original sql database value as possible)

Reimplemented from HDataField.

Definition at line 6678 of file datalib.cpp.

QVariant HFloating::getValue ( void  )
virtual

Returns the value of the field.

Reimplemented from HDataField.

Definition at line 6668 of file datalib.cpp.

QString HFloating::getValueAsString ( void  )

Returns the current value as QString according to the values set with setDisplayMode() function. This function returns the value only (Does not append the tailtext. If you would like to append the tailtext too use the dbValueToDispValue() function)

Definition at line 6635 of file datalib.cpp.

QString HFloating::lowerValidate ( void  )
virtual

Subtype (descendant) specific validation. (In HDataField this function does nothing) Descendants can be redefine this function to handle their validations.

Returns
it returns an empty string if the value passed, otherwise the error string

Reimplemented from HDataField.

Definition at line 6640 of file datalib.cpp.

int HFloating::setDefval ( QVariant  v)
virtual

Sets the default value of the field.

Returns
0 if success.

Reimplemented from HDataField.

Definition at line 6661 of file datalib.cpp.

void HFloating::setDisplayMode ( int  minDf,
int  maxDf,
int  groupDf 
)
inline

Sets the displaying method of the double value. Controls the return value of dbValueToDispValue()

Parameters
minDfspecified the minimum displayed decimal digit fragments.
maxDfspecified the maximum displayed decimal digit fragments.
groupDfthe displayed digits will be groupped by three digit. (if groupDf=1 means "2334455.34" displayed "2 334 455.45" )

Definition at line 3117 of file datalib.h.

void HFloating::setMaximum ( double  m)
inline

Sets the maximum value of the field (check in validation)

Definition at line 3105 of file datalib.h.

void HFloating::setMinimum ( double  m)
inline

Sets the minimum value of the field (check in validation)

Definition at line 3103 of file datalib.h.

int HFloating::setValue ( QVariant  v,
bool  sdisabled = false 
)
virtual

Sets the value of the field.

Parameters
sdisabledif this parameter is true the dataChanged() signal is disabled
Returns
0 if success.

Reimplemented from HDataField.

Definition at line 6649 of file datalib.cpp.

QString HFloating::sqlCreateStringPart ( QString  switches = "")
virtual

Returns the part of the CREATE TABLE sql command which creates this field

Reimplemented from HDataField.

Definition at line 6703 of file datalib.cpp.

QString HFloating::sqlInsertHead ( void  )
virtual

Returns the sql name of the field (in insert) This function can be redefined in descendats!

Reimplemented from HDataField.

Definition at line 6683 of file datalib.cpp.

QString HFloating::sqlInsertValue ( void  )
virtual

Returns the sql value of the field (in insert) This function can be redefined in descendats!

Reimplemented from HDataField.

Definition at line 6688 of file datalib.cpp.

QString HFloating::sqlSelectHead ( void  )
virtual

Returns the sql name of the field (in select) This function can be redefined in descendats!

Reimplemented from HDataField.

Definition at line 6698 of file datalib.cpp.

QString HFloating::sqlUpdate ( void  )
virtual

Returns the sql update part of the field ( name='VALUE' ) This function can be redefined in descendats!

Reimplemented from HDataField.

Definition at line 6693 of file datalib.cpp.


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