KexiTableViewData Class Reference
#include <kexitableviewdata.h>
Inheritance diagram for KexiTableViewData:

Detailed Description
Reimplements QPtrList to allow configurable sorting and more. Original author: Till Busch. Reimplemented by Jaroslaw Staniek.
Definition at line 222 of file kexitableviewdata.h.
Public Types | |
| typedef QPtrListIterator< KexiTableItem > | Iterator |
Public Slots | |
| void | deleteLater () |
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 *) |
| Current row has been updated. | |
| void | rowInserted (KexiTableItem *, bool repaint) |
| A row has been inserted. | |
| void | rowInserted (KexiTableItem *, uint index, bool repaint) |
| A row has been inserted at index position (not db-aware data only). | |
| void | aboutToDeleteRow (KexiTableItem &item, KexiDB::ResultInfo *result, bool repaint) |
| void | rowDeleted () |
| Current row has been deleted. | |
| void | rowsDeleted (const QValueList< int > &rowsToDelete) |
| Rows have been deleted. | |
| void | reloadRequested () |
| Displayed data needs to be reloaded in all presenters. | |
| void | rowRepaintRequested (KexiTableItem &) |
Public Member Functions | |
| KexiTableViewData () | |
| not db-aware version | |
| KexiTableViewData (KexiDB::Cursor *c) | |
| db-aware version | |
| 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, QVariant *visibleValueForLookupField=0) |
| 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 () |
| Emits reloadRequested() signal to reload presenters. | |
| 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) |
| int | cmpBLOB (Item item1, Item item2) |
| Compare function for BLOB data (QByteArray). Uses size as the weight. | |
| bool | saveRow (KexiTableItem &item, bool insert, bool repaint) |
| internal: for saveRowChanges() and saveNewRow() | |
Protected Attributes | |
| int | m_sortedColumn |
| (logical) sorted column number, set by setSorting() can differ from m_realSortedColumn if there's lookup column used | |
| int | m_realSortedColumn |
| real sorted column number, set by setSorting(), used by cmp*() methods | |
| short | m_order |
| short | m_type |
| int | m_itemSize |
| KexiDB::RowEditBuffer * | m_pRowEditBuffer |
| QGuardedPtr< KexiDB::Cursor > | m_cursor |
| KexiDB::ResultInfo | m_result |
| used to faster lookup columns of simple type (not dbaware) | |
| 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 |
| Temporary, used in compare functions like cmpInt(), cmpString() to avoid memory allocations. | |
| QVariant | m_rightTmp |
| Temporary, used in compare functions like cmpInt(), cmpString() to avoid memory allocations. | |
Static Protected Attributes | |
| static unsigned short | charTable [] |
Member Typedef Documentation
|
|
Definition at line 227 of file kexitableviewdata.h. |
Constructor & Destructor Documentation
|
|
not db-aware version
Definition at line 229 of file kexitableviewdata.cpp. References init(). |
|
|
db-aware version
Definition at line 237 of file kexitableviewdata.cpp. References addColumn(), columns, KexiDB::QueryColumnInfo::indexForVisibleLookupValue(), init(), m_containsROWIDInfo, m_cursor, m_itemSize, KexiDB::QueryColumnInfo::visible, KexiDB::QuerySchema::WithInternalFields, and KexiDB::QuerySchema::WithInternalFieldsAndRowID. |
|
||||||||||||||||||||
|
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 274 of file kexitableviewdata.cpp. References init(). |
|
||||||||||||
|
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 283 of file kexitableviewdata.cpp. References init(). |
|
|
Definition at line 290 of file kexitableviewdata.cpp. References clearInternal(), and destroying(). |
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. Referenced by updateRowEditBufferRef(). |
|
||||||||||||||||
|
Emited before deleting of a current row. Connect this signal to your slot and set result->success to false to disallow this deleting. Referenced by deleteRow(). |
|
||||||||||||||||
|
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. Referenced by saveNewRow(). |
|
||||||||||||||||
|
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. Referenced by saveRowChanges(). |
|
|
Adds column col. Warning: col will be owned by this object, and deleted on its destruction. Definition at line 351 of file kexitableviewdata.cpp. References columns, m_autoIncrementedColumn, m_containsROWIDInfo, m_cursor, KexiTableViewColumn::m_data, m_globalColumnsIDs, m_itemSize, m_visibleColumnsCount, m_visibleColumnsIDs, and KexiTableViewColumn::visible(). Referenced by init(), KFormDesigner::ConnectionDialog::initTable(), KexiTableDesignerView::KexiTableDesignerView(), KexiTableViewData(), and KexiComboBoxPopup::setData(). |
|
|
|
Definition at line 405 of file kexitableviewdata.h. Referenced by KexiTableView::contentsDragMoveEvent(), KexiTableView::contentsDropEvent(), KexiTableView::highlightedItem(), KexiDataAwareObjectInterface::itemAt(), and KexiSimplePrintingEngine::paintPage(). |
|
|
Definition at line 836 of file kexitableviewdata.cpp. References columns, and m_autoIncrementedColumn. |
|
|
Definition at line 805 of file kexitableviewdata.cpp. References clearRowEditBuffer(), count(), and removeLast(). Referenced by KexiDataAwareObjectInterface::clearColumns(), deleteAllRows(), and ~KexiTableViewData(). |
|
|
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 561 of file kexitableviewdata.cpp. References KexiDB::RowEditBuffer::clear(), isDBAware(), and m_pRowEditBuffer. Referenced by KexiDataAwareObjectInterface::cancelRowEdit(), clearInternal(), KexiTableView::createEditor(), and KexiFormScrollView::createEditor(). |
|
||||||||||||
|
Compare function for BLOB data (QByteArray). Uses size as the weight.
Definition at line 537 of file kexitableviewdata.cpp. References CMP_NULLS, m_leftTmp, and m_rightTmp. Referenced by setSorting(). |
|
||||||||||||
|
Definition at line 481 of file kexitableviewdata.cpp. References CAST_AND_COMPARE. Referenced by setSorting(). |
|
||||||||||||
|
Definition at line 486 of file kexitableviewdata.cpp. References CAST_AND_COMPARE. Referenced by setSorting(). |
|
||||||||||||
|
Definition at line 476 of file kexitableviewdata.cpp. References CAST_AND_COMPARE. Referenced by setSorting(). |
|
||||||||||||
|
Definition at line 456 of file kexitableviewdata.cpp. References CAST_AND_COMPARE. Referenced by setSorting(). |
|
||||||||||||
|
Definition at line 466 of file kexitableviewdata.cpp. References CAST_AND_COMPARE. Referenced by setSorting(). |
|
||||||||||||
|
Definition at line 496 of file kexitableviewdata.cpp. References charTable, CMP_NULLS, m_leftTmp, m_order, and m_rightTmp. Referenced by setSorting(). |
|
||||||||||||
|
Definition at line 491 of file kexitableviewdata.cpp. References CAST_AND_COMPARE. Referenced by setSorting(). |
|
||||||||||||
|
Definition at line 461 of file kexitableviewdata.cpp. References CAST_AND_COMPARE. Referenced by setSorting(). |
|
||||||||||||
|
Definition at line 471 of file kexitableviewdata.cpp. References CAST_AND_COMPARE. Referenced by setSorting(). |
|
|
|
Definition at line 292 of file kexitableviewdata.h. Referenced by KexiTableView::columnPos(), and KexiDataAwareObjectInterface::initDataContents(). |
|
||||||||||||
|
Definition at line 434 of file kexitableviewdata.cpp. References cmpFunc. |
|
|
Definition at line 425 of file kexitableviewdata.h. |
|
|
|
|
Definition at line 417 of file kexitableviewdata.h. |
|
|
Definition at line 290 of file kexitableviewdata.h. Referenced by KexiTableView::editor(). |
|
|
For db-aware data set only: table name is returned; equivalent to cursor()->query()->parentTable()->name(). Definition at line 379 of file kexitableviewdata.cpp. References m_cursor. Referenced by KexiDataAwareObjectInterface::deleteAllRows(). |
|
|
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 821 of file kexitableviewdata.cpp. References clearInternal(), m_cursor, and reloadRequested(). Referenced by KexiDataAwareObjectInterface::deleteAllRows(), KexiTableDesignerView::initData(), KFormDesigner::ConnectionDialog::updateSignalList(), and KFormDesigner::ConnectionDialog::updateSlotList(). |
|
|
Definition at line 345 of file kexitableviewdata.cpp. References m_cursor. |
|
||||||||||||
|
Definition at line 749 of file kexitableviewdata.cpp. References aboutToDeleteRow(), KexiDB::ResultInfo::clear(), KexiDB::getHTMLErrorMesage(), m_containsROWIDInfo, m_cursor, m_result, KexiDB::ResultInfo::msg, rowDeleted(), and KexiDB::ResultInfo::success. Referenced by KexiDataAwareObjectInterface::deleteItem(). |
|
||||||||||||
|
Deletes rows (by number) passed with rowsToDelete. Currently, this method is only for non data-aware tables. Definition at line 777 of file kexitableviewdata.cpp. References first(), and rowsDeleted(). |
|
|
Referenced by ~KexiTableViewData(). |
|
|
Definition at line 410 of file kexitableviewdata.h. Referenced by KexiDataAwareObjectInterface::slotAboutToDeleteRow(), KexiDataAwareObjectInterface::slotRowInserted(), KexiTableView::slotRowRepaintRequested(), and KexiDataAwareObjectInterface::sort(). |
|
|
Definition at line 408 of file kexitableviewdata.h. Referenced by deleteRows(), and KexiTableView::print(). |
|
|
Definition at line 279 of file kexitableviewdata.h. Referenced by KexiTableView::columnAt(). |
|
||||||||||||||||||||
|
Definition at line 296 of file kexitableviewdata.cpp. References addColumn(), append(), init(), KexiDB::Field::setPrimaryKey(), and KexiTableViewColumn::setVisible(). |
|
|
Definition at line 322 of file kexitableviewdata.cpp. References columns, m_autoIncrementedColumn, m_containsROWIDInfo, m_cursor, m_globalColumnsIDs, m_insertingEnabled, m_itemSize, m_order, m_pRowEditBuffer, m_readOnly, m_realSortedColumn, m_sortedColumn, m_type, m_visibleColumnsCount, and m_visibleColumnsIDs. Referenced by init(), and KexiTableViewData(). |
|
||||||||||||||||
|
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 797 of file kexitableviewdata.cpp. References count(), and rowInserted(). Referenced by KexiDataAwareObjectInterface::insertItem(). |
|
|
Definition at line 284 of file kexitableviewdata.h. Referenced by clearRowEditBuffer(), and updateRowEditBufferRef(). |
|
|
Definition at line 407 of file kexitableviewdata.h. Referenced by KexiTableView::adjustColumnWidthToContents(). |
|
|
Definition at line 310 of file kexitableviewdata.h. Referenced by KexiDataAwareObjectInterface::isInsertingEnabled(), and KexiDataAwareObjectInterface::setInsertingEnabled(). |
|
|
Definition at line 872 of file kexitableviewdata.cpp. References m_cursor, and m_readOnly. Referenced by KexiDataAwareObjectInterface::isReadOnly(), and KexiDataAwareObjectInterface::setReadOnly(). |
|
|
|
Definition at line 409 of file kexitableviewdata.h. Referenced by KexiDataAwareObjectInterface::deleteItem(). |
|
|
Preloads all rows provided by cursor (only for db-aware version).
Definition at line 852 of file kexitableviewdata.cpp. References append(), and m_cursor. Referenced by KexiSimplePrintingEngine::init(), KexiFormView::initDataSource(), and KexiDataTableView::setData(). |
|
|
Definition at line 415 of file kexitableviewdata.h. |
|
|
Emits reloadRequested() signal to reload presenters.
Definition at line 403 of file kexitableviewdata.h. Referenced by KexiDataAwareObjectInterface::deleteAllRows(). |
|
|
Displayed data needs to be reloaded in all presenters.
Referenced by deleteAllRows(). |
|
|
Definition at line 412 of file kexitableviewdata.h. |
|
|
Definition at line 413 of file kexitableviewdata.h. Referenced by KexiDataAwareObjectInterface::cancelRowEdit(), and clearInternal(). |
|
|
Definition at line 359 of file kexitableviewdata.h. Referenced by KexiDataAwareObjectInterface::acceptEditor(), KexiDataAwareObjectInterface::acceptRowEdit(), and KexiDataAwareObjectInterface::deleteItem(). |
|
|
Current row has been deleted.
Referenced by deleteRow(). |
|
|
||||||||||||||||
|
A row has been inserted at index position (not db-aware data only).
|
|
||||||||||||
|
A row has been inserted.
Referenced by insertRow(), and saveNewRow(). |
|
|
Referenced by saveRow(). |
|
|
Rows have been deleted.
Referenced by deleteRows(). |
