[DataWidget Index] [DataWidget Hierarchy]
General part of the manager More...
#include <dbdatasource.h>
Inherits: QObject
General part of the manager. The manager consists of two classes. DBDatasource keeps track of the state and emits the signals. A class derrived from DBRecord handles the database connection.
The constructor expects a record created with new. The destructor will delete the record.
Destructor.
Thin wrapper for DBRecord::setQuery
Thin wrapper for DBRecord::setTable
Restricts the dataset to the correspontin detail-recors of the master-record. You have to call setQuery with a proper select statement. It must include parameters for the foreign keys eg. "select * from order where custid = ?"
join | This string describes the foreign keys of the select statement. Pairs of index=index seperated by blanks eg. "1=0 2=1". The first one is the index of the field of the master datasource. The second is the index of the parameter. |
cascadeRemove | If true, removeing a master record also removes the detail records. |
init | Appending a new record will initialize the foreign keys from the corresonding fields. Pairs of index=index seperated by blanks eg. "1=0 2=1". The first one is the index of the field of the master datasource. The second is the index of the field of this source. |
master | The master of this detail datasource. |
Thin wrapper for DBRecord::getNumCols
Thin wrapper for DBRecord::getColumnName
Thin wrapper for DBRecord::getColumnQualifierName
Thin wrapper for DBRecord::getColumnType
Thin wrapper for DBRecord::getColumnTypeName
Thin wrapper for DBRecord::getColumnLength
Thin wrapper for DBRecord::getColumnPrecision
Thin wrapper for DBRecord::getColumnScale
Thin wrapper for DBRecord::getColumnDisplaySize
Thin wrapper for DBRecord::getColumnNullable
Thin wrapper for DBRecord::getColumnUnsigned
Thin wrapper for DBRecord::getColumnMoney
Thin wrapper for DBRecord::getColumnUpdatable
Thin wrapper for DBRecord::getColumnAutoIncrement
Thin wrapper for DBRecord::getNumRows
The datasource is active.
An error occured.
A value of the record was changed but not posted to the database.
A record was appended but not posted to the database.
You can call setValue / getValue.
You cal call post
A widget may offer editing.
SetValue will switch to edit mode.
Changed fields will be written to the database before changing the database cursor.
Returns the state: Inactive, Error, Browse, Edit, Insert, CalcFields
Translates the state id to a string representation.
Thin wrapper for DBRecord::getErrorInfo
Thin wrapper for DBRecord::getCursor
Is the cursor before th first record ?
Is the cursor behind the last record ?
Wrapper for DBRecord::getValue
format |
A printf or strftime format string. WARNING the resust string must not exeed 8000 bytes! The format must correspond to getColumnType()
| ||||||||||||||||
col | the column index, 0 based |
Wrapper for DBRecord::getValue
Wrapper for DBRecord::getValue
Wrapper for DBRecord::getValue
Wrapper for DBRecord::getValue
Wrapper for DBRecord::getValue
Has column a null value
Wrapper for DBRecord::setValue Switches to edit mode, if autoedit is set.
Wrapper for DBRecord::setValue Switches to edit mode, if autoedit is set.
Wrapper for DBRecord::setValue Switches to edit mode, if autoedit is set.
Wrapper for DBRecord::setValue Switches to edit mode, if autoedit is set.
Wrapper for DBRecord::setValue Switches to edit mode, if autoedit is set.
Wrapper for DBRecord::setValue Switches to edit mode, if autoedit is set.
sets the value to null Switches to edit mode, if autoedit is set.
Wrapper for DBRecord::setParameter
Wrapper for DBRecord::setParameter
Wrapper for DBRecord::setParameter
Wrapper for DBRecord::setParameter
Wrapper for DBRecord::setParameter
Wrapper for DBRecord::setParameter
Get the column index of the column, 0 based
column | the name of the column |
Get the column index of the column, 0 based
table | the name of the table respectively the alias (Id did'n work for me, the mysql odbc driver hides the tablename ???) |
column | the name of the column |
Opens the DBRecord.
Closes the DBRecord.
SetValue will switch to edit mode, default: false.
Changed fields will be written to the database before changing the database cursor, default false.
Fetch resultset from database after post, default true.
Marks datasource as readonly. If the DBRecord is readonly the datasource will stay readonly!
Switches to edit mode.
Apends a record and initializes it with 0 resp. "". Switches to insert mode.
setNull | True: init with null values if column allows it. False init with 0 or "". |
Apends a record and initializes it from the current record. Switches to insert mode.
Deletes the current record from the database.
Insert the current record if the datasource is in insert mode. Updates the database if the datasource is in edit mode.
Fetch resultset from database.
Cancels the last edit/append/copy
If you call abort from a slot connected to a beforeXXX signel, it will stop the operation.
Wrapper for DBRecord::first
Wrapper for DBRecord::prior
Wrapper for DBRecord::next
Wrapper for DBRecord::last
Wrapper for DBRecord::moveBy
Wrapper for DBRecord::moveTo
This method saves the current state and suspresses all signals.
This method resores the state.
The state of the datasource changed.
The position of the database cursor changed. If an operation changes the state and the cursor stateChanged is emited first. The datasource also emits cursorChanged if the set changed.
A value of a field changed. If the change is caused by a cursor movement, only cursorChanged is emited.
Something wants to switch to edit mode. You can call abort to keep the old state.
The datasource is now in edit mode.
Something wants to switch to insert mode. You can call abort to keep the old state.
isCopy | True if the new record will be initialized from the current record. |
The datasource is now in insert mode.
isCopy | True if the new record was initialized from the current record. |
Something wants to delete the current record from the database. You can call abort to keep the old state.
The database record is deleted and the next current record is now the current one.
Sonething wants to post the current record to the database. You can call abort to keep the old state.
The chaned values have been written to the database.
Sonething wants to cancel the edit/append/copy call. You can call abort to keep the old state.
The edit/append/copy is canceled.
A beforeXXX slot aborted an operation.
The dataset fetched a record from the database. A setValue call will not be mark the record for update.
A append or copy created a new record. A setValue call will not be mark the record for insert.
| Kdoc |