kexi
KexiTableViewData Class Reference
#include <kexitableviewdata.h>
Detailed Description
Reimplements QPtrList to allow configurable sorting and more. Original author: Till Busch. Reimplemented by Jaroslaw Staniek.
Definition at line 194 of file kexitableviewdata.h.
Public Types | |
typedef QPtrListIterator< KexiTableItem > | Iterator |
Signals | |
void | destroying () |
void | aboutToChangeCell (KexiTableItem *item, int colnum, QVariant &newValue, KexiDB::ResultInfo *result) |
void | aboutToInsertRow (KexiTableItem *item, KexiDB::ResultInfo *result, bool repaint) |
void | aboutToUpdateRow (KexiTableItem *item, KexiDB::RowEditBuffer *buffer, KexiDB::ResultInfo *result) |
void | rowUpdated (KexiTableItem *) |
void | rowInserted (KexiTableItem *, bool repaint) |
void | rowInserted (KexiTableItem *, uint index, bool repaint) |
void | aboutToDeleteRow (KexiTableItem &item, KexiDB::ResultInfo *result, bool repaint) |
void | rowDeleted () |
void | rowsDeleted (const QValueList< int > &rowsToDelete) |
void | reloadRequested () |
void | rowRepaintRequested (KexiTableItem &) |
Public Member Functions | |
KexiTableViewData () | |
KexiTableViewData (KexiDB::Cursor *c) | |
KexiTableViewData (const QValueList< QVariant > &keys, const QValueList< QVariant > &values, KexiDB::Field::Type keyType=KexiDB::Field::Text, KexiDB::Field::Type valueType=KexiDB::Field::Text) | |
KexiTableViewData (KexiDB::Field::Type keyType, KexiDB::Field::Type valueType) | |
virtual | ~KexiTableViewData () |
void | preloadAllRows () |
void | setSorting (int column, bool ascending=true) |
int | sortedColumn () const |
int | sortingOrder () const |
void | addColumn (KexiTableViewColumn *col) |
int | globalColumnID (int visibleID) |
int | visibleColumnID (int globalID) |
bool | isDBAware () |
QString | dbTableName () const |
KexiDB::Cursor * | cursor () const |
uint | columnsCount () const |
KexiTableViewColumn * | column (uint c) |
virtual bool | isReadOnly () const |
virtual void | setReadOnly (bool set) |
virtual bool | isInsertingEnabled () const |
virtual void | setInsertingEnabled (bool set) |
void | clearRowEditBuffer () |
bool | updateRowEditBufferRef (KexiTableItem *item, int colnum, KexiTableViewColumn *col, QVariant &newval, bool allowSignals=true) |
bool | updateRowEditBuffer (KexiTableItem *item, int colnum, KexiTableViewColumn *col, QVariant newval, bool allowSignals=true) |
bool | updateRowEditBuffer (KexiTableItem *item, int colnum, QVariant newval, bool allowSignals=true) |
KexiDB::RowEditBuffer * | rowEditBuffer () const |
KexiDB::ResultInfo * | result () |
bool | saveRowChanges (KexiTableItem &item, bool repaint=false) |
bool | saveNewRow (KexiTableItem &item, bool repaint=false) |
bool | deleteRow (KexiTableItem &item, bool repaint=false) |
void | deleteRows (const QValueList< int > &rowsToDelete, bool repaint=false) |
virtual bool | deleteAllRows (bool repaint=false) |
virtual void | clearInternal () |
void | insertRow (KexiTableItem &item, uint index, bool repaint=false) |
int | autoIncrementedColumn () |
void | reload () |
KexiTableItem * | at (uint index) |
virtual uint | count () const |
bool | isEmpty () const |
KexiTableItem * | first () |
KexiTableItem * | last () |
int | findRef (const KexiTableItem *item) |
void | sort () |
bool | removeFirst () |
bool | removeLast () |
void | append (const KexiTableItem *item) |
void | prepend (const KexiTableItem *item) |
Iterator | iterator () |
Iterator * | createIterator () |
bool | containsROWIDInfo () const |
KexiTableItem * | createItem () const |
Public Attributes | |
KexiTableViewColumn::List | columns |
Protected Member Functions | |
void | init () |
void | init (const QValueList< QVariant > &keys, const QValueList< QVariant > &values, KexiDB::Field::Type keyType, KexiDB::Field::Type valueType) |
virtual int | compareItems (Item item1, Item item2) |
int | cmpStr (Item item1, Item item2) |
int | cmpInt (Item item1, Item item2) |
int | cmpUInt (Item item1, Item item2) |
int | cmpLongLong (Item item1, Item item2) |
int | cmpULongLong (Item item1, Item item2) |
int | cmpDouble (Item item1, Item item2) |
int | cmpDate (Item item1, Item item2) |
int | cmpDateTime (Item item1, Item item2) |
int | cmpTime (Item item1, Item item2) |
bool | saveRow (KexiTableItem &item, bool insert, bool repaint) |
Protected Attributes | |
int | m_key |
short | m_order |
short | m_type |
KexiDB::RowEditBuffer * | m_pRowEditBuffer |
QGuardedPtr< KexiDB::Cursor > | m_cursor |
KexiDB::ResultInfo | m_result |
uint | m_visibleColumnsCount |
QValueVector< int > | m_visibleColumnsIDs |
QValueVector< int > | m_globalColumnsIDs |
bool | m_readOnly: 1 |
bool | m_insertingEnabled: 1 |
bool | m_inside_acceptEditor: 1 |
bool | m_containsROWIDInfo: 1 |
int | m_autoIncrementedColumn |
int(KexiTableViewData::* | cmpFunc )(void *, void *) |
QVariant | m_leftTmp |
QVariant | m_rightTmp |
Static Protected Attributes | |
static unsigned short | charTable [] |
Constructor & Destructor Documentation
|
not db-aware version
Definition at line 216 of file kexitableviewdata.cpp. |
|
db-aware version
Definition at line 223 of file kexitableviewdata.cpp. |
|
Defines two-column table usually used with comboboxes. First column is invisible and contains key values. Second column and contains user-visible value.
Definition at line 245 of file kexitableviewdata.cpp. |
|
Like above constructor, but keys and values are not provided. You can do this later by calling append(KexiTableItem*) method. (KexiTableItem object must have exactly two columns) Definition at line 254 of file kexitableviewdata.cpp. |
Member Function Documentation
|
Emitted before change of the single, currently edited cell. Connect this signal to your slot and set result->success to false to disallow this change. You can also change newValue to other value, or change other columns in item row. |
|
Emited before deleting of a current row. Connect this signal to your slot and set result->success to false to disallow this deleting. |
|
Emited before inserting of a new, current row. Connect this signal to your slot and set result->success to false to disallow this inserting. You can also change columns in item row. |
|
Emited before changing of an edited, current row. Connect this signal to your slot and set result->success to false to disallow this change. You can also change columns in item row. |
|
Adds column col. Warning: col will be owned by this object, and deleted on its destruction. Definition at line 329 of file kexitableviewdata.cpp. |
|
Definition at line 793 of file kexitableviewdata.cpp. |
|
Clears and initializes internal row edit buffer for incoming editing. Creates buffer using KexiDB::RowEditBuffer(false) (false means not db-aware type) if our data is not db-aware, or db-aware buffer if data is db-aware (isDBAware()==true).
Definition at line 526 of file kexitableviewdata.cpp. |
|
Definition at line 394 of file kexitableviewdata.h. |
|
For db-aware data set only: table name is returned; equivalent to cursor()->query()->parentTable()->name(). Definition at line 360 of file kexitableviewdata.cpp. |
|
Deletes all rows. Works either for db-aware and non db-aware tables. Column's definition is not changed. For db-aware version, all rows are removed from a database. Row-edit buffer is cleared. If repaint is true, reloadRequested() signal is emitted after deleting (if at least one row was deleted), so presenters can repaint their contents.
Definition at line 778 of file kexitableviewdata.cpp. |
|
Deletes rows (by number) passed with rowsToDelete. Currently, this method is only for non data-aware tables. Definition at line 734 of file kexitableviewdata.cpp. |
|
Inserts new item at index index. item will be owned by this data object. Note: Reasonable only for not not-db-aware version. Definition at line 754 of file kexitableviewdata.cpp. |
|
Definition at line 256 of file kexitableviewdata.h. |
|
Definition at line 282 of file kexitableviewdata.h. |
|
Definition at line 828 of file kexitableviewdata.cpp. |
|
Preloads all rows provided by cursor (only for db-aware version).
Definition at line 809 of file kexitableviewdata.cpp. |
|
Emits reloadRequested() signal to reload presenters.
Definition at line 372 of file kexitableviewdata.h. |
|
Displayed data needs to be reloaded in all presenters.
|
|
Definition at line 328 of file kexitableviewdata.h. |
|
Current row has been deleted.
|
|
A row has been inserted at index position (not db-aware data only).
|
|
A row has been inserted.
|
|
Rows have been deleted.
|
|
Current row has been updated.
|
|
internal: for saveRowChanges() and saveNewRow()
Definition at line 585 of file kexitableviewdata.cpp. |
|
Sets insertingEnabled flag. If true, empty row is available If set is true, read-only flag will be cleared automatically.
Definition at line 517 of file kexitableviewdata.cpp. |
|
Sets readOnly flag for this data. If set is true, insertingEnabled flag will be cleared automatically.
Definition at line 508 of file kexitableviewdata.cpp. |
|
Sets sorting for column. If column is -1, sorting is disabled. Definition at line 367 of file kexitableviewdata.cpp. |
|
Definition at line 240 of file kexitableviewdata.h. |
|
Definition at line 245 of file kexitableviewdata.h. |
|
Added for convenience. Like above but it's assumed that item item's columns are ordered like in table view, not like in form view. Don't use this with form views. Definition at line 318 of file kexitableviewdata.h. |
|
Added for convenience. Like above but newval is passed by value. Definition at line 309 of file kexitableviewdata.h. |
|
Updates internal row edit buffer: currently edited column col (number colnum) has now assigned new value of newval. Uses column's caption to address the column in buffer if the buffer is of simple type, or db-aware buffer if (isDBAware()==true). (then fields are addressed with KexiDB::Field, instead of caption strings). If allowSignals is true (the default), aboutToChangeCell() signal is emitted. Note that newval may be changed in aboutToChangeCell() signal handler.
Definition at line 535 of file kexitableviewdata.cpp. |
Member Data Documentation
|
Initial value: { } Definition at line 466 of file kexitableviewdata.h. |
|
Columns information Definition at line 269 of file kexitableviewdata.h. |
|
Definition at line 486 of file kexitableviewdata.h. |
|
Used in acceptEditor() to avoid infinite recursion, eg. when we're calling acceptRowEdit() during cell accepting phase. Definition at line 483 of file kexitableviewdata.h. |
|
Temporary, used in compare functions like cmpInt(), cmpString() to avoid memory allocations.
Definition at line 494 of file kexitableviewdata.h. |
|
used to faster lookup columns of simple type (not dbaware)
Definition at line 473 of file kexitableviewdata.h. |
The documentation for this class was generated from the following files: