KexiTableView Class Reference
#include <kexitableview.h>
Inheritance diagram for KexiTableView:

Detailed Description
KexiTableView class provides a widget for displaying data in a tabular view.
- See also:
- KexiFormScrollView
Definition at line 66 of file kexitableview.h.
Public Types | |
| enum | ScrollDirection { ScrollUp, ScrollDown, ScrollLeft, ScrollRight } |
Public Slots | |
| virtual void | setData (KexiTableViewData *data, bool owner=true) |
| virtual void | clearColumnsInternal (bool repaint) |
| void | adjustColumnWidthToContents (int colNum=-1) |
| void | setColumnWidth (int col, int width) |
| Sets width of column width to width. | |
| void | setColumnStretchEnabled (bool set, int colNum) |
| void | maximizeColumnsWidth (const QValueList< int > &columnList) |
| void | adjustHorizontalHeaderSize () |
| void | setHighlightedRow (int row) |
| void | clearHighlightedRow () |
| virtual void | ensureCellVisible (int row, int col) |
| virtual void | deleteCurrentRow () |
| virtual KexiTableItem * | insertEmptyRow (int row=-1) |
| virtual void | startEditCurrentCell (const QString &setText=QString::null) |
| virtual void | deleteAndStartEditCurrentCell () |
| virtual bool | cancelRowEdit () |
| virtual bool | acceptRowEdit () |
| virtual void | setAcceptsRowEditAfterCellAccepting (bool set) |
| virtual void | setDropsAtRowEnabled (bool set) |
| virtual bool | cancelEditor () |
| virtual bool | acceptEditor () |
| Accepst changes made to the currently active editor. | |
Signals | |
| virtual void | dataSet (KexiTableViewData *data) |
| virtual void | itemSelected (KexiTableItem *) |
| virtual void | cellSelected (int col, int row) |
| void | itemReturnPressed (KexiTableItem *, int row, int col) |
| void | itemDblClicked (KexiTableItem *, int row, int col) |
| void | itemMouseReleased (KexiTableItem *, int row, int col) |
| void | dragOverRow (KexiTableItem *item, int row, QDragMoveEvent *e) |
| void | droppedAtRow (KexiTableItem *item, int row, QDropEvent *e, KexiTableItem *&newItem) |
| virtual void | dataRefreshed () |
| virtual void | itemChanged (KexiTableItem *, int row, int col) |
| signals | |
| virtual void | itemChanged (KexiTableItem *, int row, int col, QVariant oldValue) |
| virtual void | itemDeleteRequest (KexiTableItem *, int row, int col) |
| virtual void | currentItemDeleteRequest () |
| virtual void | newItemAppendedForAfterDeletingInSpreadSheetMode () |
| Emitted for spreadsheet mode when an item was deleted and a new item has been appended. | |
| void | sortedColumnChanged (int col) |
| void | rowEditStarted (int row) |
| emmited when row editing is started (for updating or inserting) | |
| void | rowEditTerminated (int row) |
| emmited when row editing is terminated (for updating or inserting) no matter if accepted or not | |
| void | reloadActions () |
| Emitted in initActions() to force reload actions You should remove existing actions and add them again. | |
Public Member Functions | |
| KexiTableView (KexiTableViewData *data=0, QWidget *parent=0, const char *name=0) | |
| virtual | ~KexiTableView () |
| const Appearance & | appearance () const |
| void | setAppearance (const Appearance &a) |
| QString | columnCaption (int colNum) const |
| KexiDB::Field * | field (int colNum) const |
| virtual void | setSpreadSheetMode () |
| virtual int | rowsPerPage () const |
| QRect | cellGeometry (int row, int col) const |
| int | columnWidth (int col) const |
| int | rowHeight () const |
| int | columnPos (int col) const |
| int | rowPos (int row) const |
| int | columnAt (int pos) const |
| int | rowAt (int pos, bool ignoreEnd=false) const |
| virtual int | lastVisibleRow () const |
| virtual void | updateCell (int row, int col) |
| virtual void | updateCurrentCell () |
| virtual void | updateRow (int row) |
| bool | editableOnDoubleClick () const |
| void | setEditableOnDoubleClick (bool set) |
| bool | verticalHeaderVisible () const |
| void | setVerticalHeaderVisible (bool set) |
| Sets vertical header's visibility. | |
| bool | horizontalHeaderVisible () const |
| void | setHorizontalHeaderVisible (bool set) |
| Sets horizontal header's visibility. | |
| void | print (KPrinter &printer) |
| virtual QSizePolicy | sizePolicy () const |
| virtual QSize | sizeHint () const |
| virtual QSize | minimumSizeHint () const |
| void | setFont (const QFont &f) |
| virtual QSize | tableSize () const |
| void | emitSelected () |
| void | triggerUpdate () |
| single shot after 1ms for contents updatinh | |
| virtual bool | eventFilter (QObject *o, QEvent *e) |
| int | highlightedRow () const |
| KexiTableItem * | highlightedItem () const |
| virtual QScrollBar * | verticalScrollBar () const |
Static Public Member Functions | |
| static void | initCellEditorFactories () |
| Initializes standard editor cell editor factories. This is called internally, once. | |
Protected Slots | |
| void | slotSettingsChanged (int category) |
| virtual void | slotDataDestroying () |
| virtual void | slotRowsDeleted (const QValueList< int > &) |
| void | slotColumnWidthChanged (int col, int os, int ns) |
| updates display after many rows deletion | |
| void | slotSectionHandleDoubleClicked (int section) |
| void | slotUpdate () |
| virtual void | sortColumnInternal (int col, int order=0) |
| implemented because we needed this as slot | |
| void | slotAutoScroll () |
| void | slotTopHeaderSizeChange (int section, int oldSize, int newSize) |
| internal, used when top header's size changed | |
| void | slotEditRequested () |
| receives a signal from cell editors | |
| virtual void | reloadData () |
| virtual void | slotRowRepaintRequested (KexiTableItem &item) |
| Handles KexiTableViewData::rowRepaintRequested() signal. | |
| virtual void | slotAboutToDeleteRow (KexiTableItem &item, KexiDB::ResultInfo *result, bool repaint) |
| Handles KexiTableViewData::aboutToDeleteRow() signal. Prepares info for slotRowDeleted(). | |
| virtual void | slotRowDeleted () |
| Handles KexiTableViewData::rowDeleted() signal to repaint when needed. | |
| virtual void | slotRowInserted (KexiTableItem *item, bool repaint) |
| Handles KexiTableViewData::rowInserted() signal to repaint when needed. | |
| virtual void | slotRowInserted (KexiTableItem *item, uint row, bool repaint) |
| Like above, not db-aware version. | |
| virtual void | vScrollBarValueChanged (int v) |
| virtual void | vScrollBarSliderReleased () |
| virtual void | scrollBarTipTimeout () |
Protected Member Functions | |
| virtual void | initDataContents () |
| virtual void | updateWidgetContentsSize () |
| virtual void | clearVariables () |
| virtual int | currentLocalSortingOrder () const |
| virtual int | currentLocalSortColumn () const |
| virtual void | setLocalSortingOrder (int col, int order) |
| virtual void | updateGUIAfterSorting () |
| virtual void | updateWidgetScrollBars () |
| virtual void | addHeaderColumn (const QString &caption, const QString &description, const QIconSet &icon, int size) |
| bool | isDefaultValueDisplayed (KexiTableItem *item, int col, QVariant *value=0) |
| void | drawContents (QPainter *p, int cx, int cy, int cw, int ch) |
| painting and layout | |
| void | createBuffer (int width, int height) |
| void | paintCell (QPainter *p, KexiTableItem *item, int col, int row, const QRect &cr, bool print=false) |
| void | paintEmptyArea (QPainter *p, int cx, int cy, int cw, int ch) |
| void | updateGeometries () |
| QPoint | contentsToViewport2 (const QPoint &p) |
| void | contentsToViewport2 (int x, int y, int &vx, int &vy) |
| QPoint | viewportToContents2 (const QPoint &vp) |
| virtual void | contentsMousePressEvent (QMouseEvent *e) |
| virtual void | contentsMouseReleaseEvent (QMouseEvent *e) |
| bool | handleContentsMousePressOrRelease (QMouseEvent *e, bool release) |
| virtual void | contentsMouseMoveEvent (QMouseEvent *e) |
| virtual void | contentsMouseDoubleClickEvent (QMouseEvent *e) |
| virtual void | keyPressEvent (QKeyEvent *e) |
| virtual void | focusInEvent (QFocusEvent *e) |
| virtual void | focusOutEvent (QFocusEvent *e) |
| Call this from the subclass. */. | |
| virtual void | resizeEvent (QResizeEvent *e) |
| virtual void | viewportResizeEvent (QResizeEvent *e) |
| virtual void | showEvent (QShowEvent *e) |
| virtual void | contentsDragMoveEvent (QDragMoveEvent *e) |
| virtual void | contentsDropEvent (QDropEvent *e) |
| virtual void | viewportDragLeaveEvent (QDragLeaveEvent *e) |
| virtual void | paletteChange (const QPalette &oldPalette) |
| virtual KexiDataItemInterface * | editor (int col, bool ignoreMissingEditor=false) |
| KexiTableEdit * | tableEditorWidget (int col, bool ignoreMissingEditor=false) |
| virtual void | editorShowFocus (int row, int col) |
| virtual void | createEditor (int row, int col, const QString &addText=QString::null, bool removeOld=false) |
| Creates editors and shows it, what usually means the beginning of a cell editing. | |
| bool | focusNextPrevChild (bool next) |
| bool | shortCutPressed (QKeyEvent *e, const QCString &action_name) |
| void | showContextMenu (const QPoint &pos=QPoint(-1,-1)) |
| void | paintRow (KexiTableItem *item, QPainter *pb, int r, int rowp, int cx, int cy, int colfirst, int collast, int maxwc) |
| virtual void | setHBarGeometry (QScrollBar &hbar, int x, int y, int w, int h) |
| void | setupNavigator () |
| Setups navigator widget. | |
| int | validRowNumber (const QString &text) |
| internal, to determine valid row number when navigator text changed | |
| virtual void | removeEditor () |
| void | updateFonts (bool repaint=false) |
| Internal: updated sched fonts for painting. | |
| void | setBottomMarginInternal (int pixels) |
| virtual void | updateWidgetContents () |
| virtual void | moveToRecordRequested (uint r) |
| for navigator | |
| virtual void | moveToLastRecordRequested () |
| virtual void | moveToPreviousRecordRequested () |
| virtual void | moveToNextRecordRequested () |
| virtual void | moveToFirstRecordRequested () |
| virtual void | addNewRecordRequested () |
| virtual void | copySelection () |
| Copy current selection to a clipboard (e.g. cell). | |
| virtual void | cutSelection () |
| Cut current selection to a clipboard (e.g. cell). | |
| virtual void | paste () |
| Paste current clipboard contents (e.g. to a cell). | |
| virtual void | updateAllVisibleRowsBelow (int row) |
| void | updateAfterCancelRowEdit () |
| void | updateAfterAcceptRowEdit () |
| bool | getVisibleLookupValue (QVariant &cellValue, KexiTableEdit *edit, KexiTableItem *item, KexiTableViewColumn *tvcol) const |
Protected Attributes | |
| KexiTableViewPrivate * | d |
Friends | |
| class | KexiTableItem |
| class | WhatsThis |
| class | KexiTableViewCellToolTip |
Classes | |
| class | Appearance |
Member Enumeration Documentation
|
|
Definition at line 238 of file kexitableview.h. |
Constructor & Destructor Documentation
|
||||||||||||||||
|
|
Definition at line 306 of file kexitableview.cpp. References cancelRowEdit(), d, KexiDataAwareObjectInterface::data(), KexiDataAwareObjectInterface::m_data, and KexiDataAwareObjectInterface::m_owner. |
Member Function Documentation
|
|
Accepst changes made to the currently active editor.
Reimplemented from KexiDataAwareObjectInterface. Definition at line 362 of file kexitableview.h. References KexiDataAwareObjectInterface::acceptEditor(). Referenced by editor(), and keyPressEvent(). |
|
|
Accepts row editing. All changes made to the editing row during this current session will be accepted (saved).
Reimplemented from KexiDataAwareObjectInterface. Definition at line 345 of file kexitableview.h. References KexiDataAwareObjectInterface::acceptRowEdit(). Referenced by KexiTableDesignerView::beforeSwitchTo(), KexiTableDesignerView::buildSchema(), KexiTableDesignerView::changeFieldPropertyForRow(), KexiTableDesignerView::changePropertyVisibility(), KexiTableDesignerView::clearRow(), KexiTableDesignerView::insertFieldInternal(), keyPressEvent(), and KFormDesigner::ConnectionDialog::newItem(). |
|
||||||||||||||||||||
|
Implementation for KexiDataAwareObjectInterface. Adds another section within the horizontal header. Implements KexiDataAwareObjectInterface. Definition at line 348 of file kexitableview.cpp. References KexiTableViewHeader::addLabel(), KexiDataAwareObjectInterface::m_horizontalHeader, and KexiTableViewHeader::setToolTip(). |
|
|
Reimplemented from KexiDataAwareObjectInterface. Definition at line 604 of file kexitableview.h. References KexiDataAwareObjectInterface::addNewRecordRequested(). |
|
|
Adjusts colNum column's width to its (current) contents. If colNum == -1, all columns' width is adjusted. Definition at line 2151 of file kexitableview.cpp. References KexiTableViewData::column(), KexiDataAwareObjectInterface::columns(), KexiDataAwareObjectInterface::columnType(), KexiDataAwareObjectInterface::currentColumn(), KexiDataAwareObjectInterface::hasData(), horizontalHeaderVisible(), KexiTableViewData::isEmpty(), KexiCellEditorFactory::item(), KexiTableViewData::iterator(), kexidbg, KEXITV_MINIMUM_COLUMN_WIDTH, KexiTableEdit::leftMargin(), KexiDataAwareObjectInterface::m_data, KexiDataAwareObjectInterface::m_horizontalHeader, KexiTableEdit::rightMargin(), setColumnWidth(), tableEditorWidget(), and KexiTableEdit::widthForValue(). Referenced by KFormDesigner::ConnectionDialog::ConnectionDialog(), KexiTableDesignerView::initData(), and slotSectionHandleDoubleClicked(). |
|
|
Adjusts the size of the sections to fit the size of the horizontal header as completely as possible. Only sections for which column stretch is enabled will be resized.
Definition at line 2245 of file kexitableview.cpp. References KexiDataAwareObjectInterface::m_horizontalHeader. |
|
|
Definition at line 2516 of file kexitableview.cpp. References KexiTableViewPrivate::appearance, and d. |
|
|
Cancels changes made to the currently active editor. Reverts the editor's value to old one.
Reimplemented from KexiDataAwareObjectInterface. Definition at line 361 of file kexitableview.h. References KexiDataAwareObjectInterface::cancelEditor(). Referenced by editor(), and keyPressEvent(). |
|
|
Cancels row editing All changes made to the editing row during this current session will be undone.
Reimplemented from KexiDataAwareObjectInterface. Definition at line 339 of file kexitableview.h. References KexiDataAwareObjectInterface::cancelRowEdit(). Referenced by editor(), keyPressEvent(), and ~KexiTableView(). |
|
||||||||||||
|
Definition at line 1915 of file kexitableview.cpp. References columnPos(), columnWidth(), rowHeight(), and rowPos(). Referenced by editorShowFocus(), and updateCell(). |
|
||||||||||||
|
for implementation as a signal Implements KexiDataAwareObjectInterface. |
|
|
Called by clearColumns() to clear internals of the object. For example, KexiTableView removes contents of it's horizontal header. Implements KexiDataAwareObjectInterface. Definition at line 428 of file kexitableview.cpp. References KexiDataAwareObjectInterface::m_horizontalHeader, and KexiTableViewHeader::removeLabel(). |
|
|
Sets no row that will be highlighted. Equivalent to setHighlightedRow(-1). Definition at line 297 of file kexitableview.h. |
|
|
Reimplementation for KexiDataAwareObjectInterface Reimplemented from KexiDataAwareObjectInterface. Definition at line 319 of file kexitableview.cpp. References KexiTableViewPrivate::clearVariables(), KexiDataAwareObjectInterface::clearVariables(), and d. |
|
|
|
Definition at line 2139 of file kexitableview.cpp. References KexiDataAwareObjectInterface::m_horizontalHeader. |
|
|
|
|
|
|
|
|
|
||||||||||||||||||||
|
Definition at line 911 of file kexitableview.cpp. References contentsToViewport2(). |
|
|
Definition at line 906 of file kexitableview.cpp. Referenced by contentsToViewport2(), and paintEmptyArea(). |
|
|
Copy current selection to a clipboard (e.g. cell).
Implements KexiDataAwareObjectInterface. Definition at line 2375 of file kexitableview.cpp. References KexiTableViewData::column(), getVisibleLookupValue(), KexiTableEdit::handleCopyAction(), isDefaultValueDisplayed(), KexiDataAwareObjectInterface::m_curCol, KexiDataAwareObjectInterface::m_currentItem, KexiDataAwareObjectInterface::m_data, and tableEditorWidget(). |
|
||||||||||||
|
Definition at line 527 of file kexitableview.cpp. References d, and KexiTableViewPrivate::pBufferPm. Referenced by drawContents(). |
|
||||||||||||||||||||
|
|
Implements KexiDataAwareObjectInterface. |
|
|
Implementation for KexiDataAwareObjectInterface Implements KexiDataAwareObjectInterface. Definition at line 471 of file kexitableview.cpp. References KexiDataAwareObjectInterface::m_horizontalHeader. |
|
|
Implementation for KexiDataAwareObjectInterface Implements KexiDataAwareObjectInterface. Definition at line 456 of file kexitableview.cpp. References KexiDataAwareObjectInterface::m_horizontalHeader. |
|
|
Cut current selection to a clipboard (e.g. cell).
Implements KexiDataAwareObjectInterface. Definition at line 2392 of file kexitableview.cpp. References KexiDataItemInterface::handleAction(), and tableEditorWidget(). |
|
|
Data has been refreshed on-screen - emitted from initDataContents(). Implements KexiDataAwareObjectInterface. |
|
|
Implements KexiDataAwareObjectInterface. |
|
|
Deletes currently selected cell's contents, if allowed. In most cases delete is not accepted immediately but "row editing" mode is just started. Reimplemented from KexiDataAwareObjectInterface. Definition at line 333 of file kexitableview.h. References KexiDataAwareObjectInterface::deleteAndStartEditCurrentCell(). Referenced by keyPressEvent(). |
|
|
Deletes currently selected record; does nothing if no record is currently selected. If record is in edit mode, editing is cancelled before deleting. Reimplemented from KexiDataAwareObjectInterface. Definition at line 310 of file kexitableview.h. References KexiDataAwareObjectInterface::deleteCurrentRow(). Referenced by keyPressEvent(). |
|
||||||||||||||||
|
Referenced by contentsDragMoveEvent(). |
|
||||||||||||||||||||||||
|
||||||||||||||||||||
|
Referenced by contentsDropEvent(). |
|
|
