gSAFE
1.3.8
|
#include <datalib.h>
Public Slots | |
int | actLine (void) |
int | alternateActLine (void) |
int | captureNotify (QString tblname) |
virtual int | clearList (void) |
virtual int | readList (QString filter="", bool all=true) |
int | reReadList (void) |
Public Slots inherited from HTableBase | |
void | addDependTableName (QString n) |
int | errorPassSlot (QString err) |
Signals | |
void | actionOnRecord (QString key) |
void | alternateActionOnRecord (QString key) |
Signals inherited from HTableBase | |
void | dataChanged (void) |
void | dataModifiedSignal (void) |
void | dataUpdatedSignal (void) |
void | doWorking (void) |
void | endWorking (void) |
void | startWorking (void) |
Signals inherited from HSqlHandler | |
void | errorSignal (QString err) |
Public Member Functions | |
HList (QString t) | |
HList (HList *t) | |
~HList (void) | |
QString | activeKey (void) |
void | deepcopy_from_hlist (HList *x) |
virtual QStringList * | getKeys (void) |
virtual QString | getSqlFieldValue (QString sqln) |
virtual QList< QStringList * > * | getValues (void) |
QString | operator[] (int i) |
QString | queryCurrKey (void) |
QStringList * | queryCurrValues (void) |
QString | queryNextKey (void) |
bool | queryNextRecord (void) |
QStringList * | queryNextValues (void) |
void | queryToFirst (void) |
int | recordCount (void) |
void | setActiveKey (QString k) |
Public Member Functions inherited from HTableBase | |
HTableBase (QString t) | |
HTableBase (HTableBase *t) | |
~HTableBase (void) | |
void | addField (HDataField *i) |
void | blockReInitializeBase (QString hide_marker, QString ro_marker) |
void | clearAndFreeConnections (void) |
void | clearConnections (void) |
void | clearRoles (void) |
void | clearSqlSynced (void) |
void | connectTable (HTableBase *ct, int type=INNER_JOIN, QString connconstraint="") |
void | connectTable (HTableBase *ct, QString thiskey, QString thatkey, int type=INNER_JOIN, QString connconstraint="") |
void | dataUpdated (void) |
void | deepcopy_from_htablebase (HTableBase *x) |
void | delRole (QString name) |
HDataField * | fieldByIndex (int i, bool all=false) |
HDataField * | fieldBySqlName (QString sqln, bool all=false, QString containerSqlTable="") |
int | fieldCount (bool withconnect=false) |
void | firstField (void) |
void | freeTable (void) |
QStringList | getExplainHeads (void) |
QStringList | getHeads (int what) |
QStringList | getShortTitleHeads (void) |
bool | isChanged (bool all=false) |
bool | isReallyChanged (void) |
HDataField * | nextField (void) |
HDataField * | nextFieldAll (void) |
QVariant | operator[] (int i) |
void | removeSqlCooseButtons (void) |
void | resetLogging (void) |
void | returnToDefaultAllMarked (QString mark) |
void | setAllNOSet (void) |
void | setAllYESSet (void) |
void | setColor (int r, int g, int b) |
void | setColorAllMarked (QString mark, int r, int g, int b) |
void | setEditable (void) |
void | setEditableAllMarked (QString mark) |
void | setGuiDisabledAllMarked (QString mark) |
void | setGuiEnabledAllMarked (QString mark) |
void | setHide (void) |
void | setHideAllMarked (QString mark) |
void | setLogging (void) |
void | setLoggingAllMarked (QString mark) |
void | setReadolnyAllMarked (QString mark) |
void | setReadonly (void) |
void | setShow (void) |
void | setShowAllMarked (QString mark) |
void | setTableTitle (QString s) |
QString | sqlCreateString (QString switches="") |
QString | sqlSelect (QString tail="", bool all=false, bool keypart=false) |
QString | sqlSelectAll (QString tail="") |
QString | sqlSelectWk (QString tail="", bool all=false) |
QString | sqlSelectWkAll (QString tail="") |
void | sqlSynced (HDataChangeLogger *dclog=NULL, bool forcechange=false, bool forcelog=false) |
QString | sqlTableName (void) |
HDataField * | staticFieldByTitle (QString title="") |
QString | tableTitle (void) |
void | useRole (QString name) |
QString | validate (bool all=true) |
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) |
HPlainDataMatrix * | submitNResultQuery (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) |
HSqlSingleInterface * | myInterface (void) |
QString | sqlConcatenateToLocal (QString string) |
QString | sqlConcatenateToLocal (QStringList fields) |
Public Member Functions inherited from HBase | |
HBase (void) | |
~HBase (void) | |
QString | getWhoami (void) |
Public Attributes | |
bool | last_all |
QString | last_filter |
QString | soft_current_key |
Public Attributes inherited from HTableBase | |
QString | errstr |
bool | extrafeatures |
bool | gui_showtabletitle |
Protected Attributes | |
QString | active_key |
QStringList * | keys |
QStringList::iterator | query_keyiter |
QList< QStringList * >::iterator | query_valiter |
QList< QStringList * > * | values |
Protected Attributes inherited from HTableBase | |
QString | conn_part |
QStack< HTableBase * > * | connectedTableBases |
QStringList * | depend |
int | field |
QString | imc_thatkey |
HTableBase * | imc_thattable |
QString | imc_thiskey |
HDataField_List * | run |
QString | sqlTable |
HDataField_List * | table |
QString | tabletitle |
Protected Attributes inherited from HSqlHandler | |
bool | query_error_occured |
Protected Attributes inherited from HBase | |
QString | whoami |
Additional Inherited Members | |
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 HSqlSingleInterface * | currentDefaultSqlInterface (void) |
static HSqlSingleInterface * | getSqlInterface (QString interfacename) |
static void | setSqlMode (QString modename) |
static void | setSqlModeBackToFirst (void) |
Static Public Attributes inherited from HSqlHandler | |
static int | trans = 0 |
The HList holds a complete sql table or a subset of a table in readonly mode. It contains more record, and you can browse this records, but you can't edit anything.
This is the base class to browse/search/show the list of elements to the user.
The class have a cursor which points to a record. (The user can select a record with this cursor) The keys is usally the HKey fields. So in details the list is contains records which means that we have a key list and a value array list. The key is used to select a record. (For cursor selection, etc) The value array list is the values of the sql table itself. An value array means a sql record values, so the HList contains the list of these value arrays, this is the data to show on display. This class appear in gui as table view (HDispList class), and also can be send to printer or xml excel table.
This list also can be a connected table. (see HTableBase)
The HList is showed by HDispList in gui, looks like this way:
HList::HList | ( | QString | t | ) |
Constructor. Creates an empty list.
t | the sql name of the related sql table |
Definition at line 4396 of file datalib.cpp.
HList::~HList | ( | void | ) |
Destructor.
Definition at line 4419 of file datalib.cpp.
HList::HList | ( | HList * | t | ) |
Deepcopy constructor. It clones the parameter HList to itself. It copies the full data structure and state and attributes and values of the parameter table. But connected tables is not copied neither the connection data. Only the base table is copied! If you would like to copy a whole connected table you have to copy the tables one by one, and connect them again.
x | the source list |
Definition at line 4434 of file datalib.cpp.
|
signal |
This signal is emitted when the user (left) clicked on a record (Can be emitted directly by slot actLine() )
QString HList::activeKey | ( | void | ) |
Return the key of the currently active record. (Other subsystems for example gui can set a record as active)
Definition at line 4701 of file datalib.cpp.
|
slot |
Emits the actionOnRecord signal with the active record ( returned by activeKey() ).
Definition at line 4503 of file datalib.cpp.
|
signal |
This signal is emitted when the user right clicked on a record (Can be emitted directly by slot alternateActLine() )
|
slot |
Emits the alternateActionOnRecord signal with the active record ( returned by activeKey() ).
Definition at line 4511 of file datalib.cpp.
|
slot |
This function is used by HRefreshAgent automatically. Don't need to touch it...
Definition at line 4472 of file datalib.cpp.
|
virtualslot |
Clears the whole HList (clears keys and data values )
Definition at line 4490 of file datalib.cpp.
void HList::deepcopy_from_hlist | ( | HList * | x | ) |
Deepcopy function. It clones the parameter HList to itself. It copies the full data structure and state and attributes and values of the parameter table. But connected tables is not copied neither the connection data. Only the base table is copied! If you would like to copy a whole connected table you have to copy the tables one by one, and connect them again.
x | the source list |
Definition at line 4454 of file datalib.cpp.
|
inlinevirtual |
Returns the keys of the whole HList.
Reimplemented in HFloatTablesAsHList.
|
virtual |
Returns the value of a specified field on the position of active record.
sqln | the name of the field to get. |
Definition at line 4519 of file datalib.cpp.
|
inlinevirtual |
Returns the values of the whole HList.
Reimplemented in HFloatTablesAsHList.
QString HList::operator[] | ( | int | i | ) |
Returns the title string of a specified field (by index).
Definition at line 4680 of file datalib.cpp.
QString HList::queryCurrKey | ( | void | ) |
Step through the records: Returns the current key value.
Definition at line 4744 of file datalib.cpp.
QStringList * HList::queryCurrValues | ( | void | ) |
Step through the records: Returns the values of the current record.
Definition at line 4751 of file datalib.cpp.
QString HList::queryNextKey | ( | void | ) |
Step through the records: Step to the next record and returns the value of the key field.
Definition at line 4728 of file datalib.cpp.
bool HList::queryNextRecord | ( | void | ) |
Step through the records: Step to the next record
Definition at line 4718 of file datalib.cpp.
QStringList * HList::queryNextValues | ( | void | ) |
Step through the records: Step to the next record and returns the values of the records.
Definition at line 4736 of file datalib.cpp.
void HList::queryToFirst | ( | void | ) |
Step through the records: Sets the query cursor to the first record.
Definition at line 4712 of file datalib.cpp.
|
virtualslot |
Reads the list from the sql database. Every record returned by the query is appear on the list.
all | if true the connected tables are readed too. |
filter | part of the SQL query. Where filter is "F" SELECT a,b,c... FROM tablename WHERE TRUE F; For example F = " AND deadline > date(now()) " |
Definition at line 4541 of file datalib.cpp.
|
inline |
|
inlineslot |
Reads the list from the sql database. Same as the readList() but all parameter is strictly same as the previous readList(). Useful to re-read (update) the list from the database. This slot is activated when the refresh agent notify tha table to refresh!
void HList::setActiveKey | ( | QString | k | ) |
Sets a record active by specify the key value
Definition at line 4706 of file datalib.cpp.
bool HList::last_all |
QString HList::last_filter |
QString HList::soft_current_key |
Holds a key value. Used by gui related classes. It is not as hard as the active key, this key is that key where the (visible) gui cursor is stand on. Sometimes this variable is hold more current information about the selection of the user becuse it always point a record. The user don't have to explicitly select one record to fill this variable, but need to explicitly click or activate a record to make active. Fox example when the user scrolls through a list, the soft_current_key will set every key value where the cursor was, but only that record will be the active record where the user activate a record by a click.