Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages   Examples  

QdbtBaseTabular Class Reference

The QdbtBaseTabular widget provides a multi-column list of cells that can be scrolled. More...

#include <qdbtbasetabular.h>

Inheritance diagram for QdbtBaseTabular:

Inheritance graph
[legend]
Collaboration diagram for QdbtBaseTabular:

Collaboration graph
[legend]
List of all members.

Public Types

enum  HeaderMode { MODE_QDBTTABULAR = 0x0000, MODE_QLISTVIEW = 0x0001 }
enum  EditResult { NotChanged = 0, Changed = 1, EditESCed = 2, LoseFocus = 3 }
enum  TraverseReasons { KeyPress, MouseClick, MouseDrag }
enum  ConfigureSwitches {
  SELECT_NONE = 0x00000000, SELECT_BY_ROW = 0x00000001, SELECT_MULTIPLE = 0x00000002, CLEAR_SELECTION_UNLESS_CTRL = 0x00000004,
  SHIFT_CLICK_MARKS_REGION = 0x00000008, ALLOW_DESELECT = 0x00000010, ENABLE_JUMP_SCROLL = 0x00000020, SHOW_HEADER = 0x00000100,
  SHOW_CASCADE = 0x00000200, SHOW_VERTICAL_SCROLLBAR = 0x00000400, SHOW_HORIZONTAL_SCROLLBAR = 0x00000800, ENABLE_TOOLTIPS = 0x00001000,
  SELECTION_FOLLOW_KEYBOARD_FOCUS = 0x00002000, TRAVERSE_ROW_ONLY = 0x00004000, TRAVERSE_COLUMN_ONLY = 0x00008000
}

Public Slots

void update ()
void redrawHeader ()
void redrawCascade ()
void setEnabled (bool state)
void fitAll ()
void editCell (int row, int col, bool traverse)
void editCell (int row, int col)
void stopEdit (bool accept)

Signals

void sectionClicked (int col)
void selected (int row, bool state)
void activated (int row)
void cellSelected (int row, int col, bool state)
void cellActivated (int row, int col)
void cellEditDone (int row, int col, int action, const QString &oldText)
void yOffsetChanged (int offset)
void xOffsetChanged (int offset)
void columnWidthChanged (int col, int width)
void rightButtonClicked (int col, int row)
void traceMessage (const QString &)

Public Methods

 QdbtBaseTabular (QWidget *parent=0, const char *name=0, WFlags w=0)
 ~QdbtBaseTabular ()
void setHeaderFont (const QFont &font)
const QFont headerFont () const
void setCellFont (const QFont &font)
const QFont cellFont () const
virtual void setDimensions (int rows, int cols)
void changeSection (QdbtSection *section, int col)
QdbtSectionsection (int col) const
void insertRow (int row=-1, bool selectable=TRUE)
void removeRow (int row)
virtual void insertCol (int col=-1)
virtual void removeCol (int col)
int numRows () const
int numCols () const
const QdbtBaseCellcell (int row, int col)
void changeCell (const QdbtBaseCell *const tc, int row, int col)
void setKeyboardFocus (int row, int col)
void exposeCell (int row, int col)
int columnWidth (int col) const
int columnWidthHint (int col) const
int rowHeight (int row) const
bool rowSelected (int row) const
void setRowSelected (int row, bool enable)
void setAutoUpdate (bool state)
bool autoUpdate () const
QSize sizeHint () const
const QFont cascadeFont () const
void setCascadeText (int col, const QString &text)
void setCascadeMode (int col, const int mode)
void setCascadeAlignment (int col, const int align)
void setCascadeFont (const QFont &font)
void setHeaderCursor (const QCursor &newCursor)
void setHeaderAppearance (HeaderMode headerMode)
HeaderMode headerAppearance ()
virtual void exchangeCols (int col1, int col2)
bool currentKeyboardFocus (int &row, int &col)
void clearSelection (bool set=FALSE)
void setColumnVisible (int column, bool visible)
bool columnVisible (int column) const
const QColornotEditableColor () const
void setNotEditableColor (const QColor &col)
void setJumpScrollTimeout (int mSeconds)
int jumpScrollTimeout () const
int configuration () const
void modifyConfiguration (ConfigureSwitches add=SELECT_NONE, ConfigureSwitches revoke=SELECT_NONE)
void setDefaultCell (const QdbtBaseCell &)
bool containsFocus () const
void performTrace (const QString &str)
 frameStyle () const
 setFrameStyle (int)
 frameWidth () const
 contentsRect () const
 Shape {NoFrame=0, Box=0x0001, Panel=0x0002, WinPanel=0x0003, HLine=0x0004, VLine=0x0005, StyledPanel=0x0006, PopupPanel=0x0007, MShape=0x000f}
 Shadow {Plain=0x0010, Raised=0x0020, Sunken=0x0030, MShadow=0x00f0}
 frameShape () const
 setFrameShape (Shape)
 frameShadow () const
 setFrameShadow (Shadow)
 lineWidth () const
 setLineWidth (int)
 margin () const
 setMargin (int)
 midLineWidth () const
 setMidLineWidth (int)
 frameRect () const
 setFrameRect (const QRect &)
 paintEvent (QPaintEvent *)
 resizeEvent (QResizeEvent *)
 drawFrame (QPainter *)
 drawContents (QPainter *)
 frameChanged ()
 updateMask ()
 drawFrameMask (QPainter *)
 drawContentsMask (QPainter *)
 QStyle ()
 QStyle ()
 winId () const
 style () const
 setStyle (QStyle *)
 isTopLevel () const
 isModal () const
 isPopup () const
 isDesktop () const
 isEnabled () const
 isEnabledTo (QWidget *) const
 frameGeometry () const
 geometry () const
 x () const
 y () const
 pos () const
 frameSize () const
 size () const
 width () const
 height () const
 rect () const
 childrenRect () const
 childrenRegion () const
 minimumSize () const
 maximumSize () const
 minimumWidth () const
 minimumHeight () const
 maximumWidth () const
 maximumHeight () const
 setMinimumSize (const QSize &)
 setMinimumSize (int minw, int minh)
 setMaximumSize (const QSize &)
 setMaximumSize (int maxw, int maxh)
 setMinimumWidth (int minw)
 setMinimumHeight (int minh)
 setMaximumWidth (int maxw)
 setMaximumHeight (int maxh)
 sizeIncrement () const
 setSizeIncrement (const QSize &)
 setSizeIncrement (int w, int h)
 baseSize () const
 setBaseSize (const QSize &)
 setBaseSize (int basew, int baseh)
 setFixedSize (const QSize &)
 setFixedSize (int w, int h)
 setFixedWidth (int w)
 setFixedHeight (int h)
 mapToGlobal (const QPoint &) const
 mapFromGlobal (const QPoint &) const
 mapToParent (const QPoint &) const
 mapFromParent (const QPoint &) const
 mapTo (QWidget *, const QPoint &) const
 mapFrom (QWidget *, const QPoint &) const
 topLevelWidget () const
 BackgroundMode {FixedColor, FixedPixmap, NoBackground, PaletteForeground, PaletteButton, PaletteLight, PaletteMidlight, PaletteDark, PaletteMid, PaletteText, PaletteBrightText, PaletteBase, PaletteBackground, PaletteShadow, PaletteHighlight, PaletteHighlightedText, PaletteButtonText, X11ParentRelative}
 backgroundMode () const
 setBackgroundMode (BackgroundMode)
 backgroundColor () const
 foregroundColor () const
 setBackgroundColor (const QColor &)
 backgroundPixmap () const
 setBackgroundPixmap (const QPixmap &)
 colorGroup () const
 palette () const
 ownPalette () const
 setPalette (const QPalette &)
 unsetPalette ()
 font () const
 ownFont () const
 setFont (const QFont &)
 unsetFont ()
 fontMetrics () const
 fontInfo () const
 PropagationMode {NoChildren, AllChildren, SameFont, SamePalette=SameFont}
 cursor () const
 ownCursor () const
 setCursor (const QCursor &)
 unsetCursor ()
 caption () const
 icon () const
 iconText () const
 hasMouseTracking () const
 setMask (const QBitmap &)
 setMask (const QRegion &)
 clearMask ()
 FocusPolicy {NoFocus=0, TabFocus=0x1, ClickFocus=0x2, StrongFocus=0x3, WheelFocus=0x7}
 isActiveWindow () const
 setActiveWindow ()
 isFocusEnabled () const
 focusPolicy () const
 setFocusPolicy (FocusPolicy)
 hasFocus () const
 setFocusProxy (QWidget *)
 focusProxy () const
 grabMouse ()
 grabMouse (const QCursor &)
 releaseMouse ()
 grabKeyboard ()
 releaseKeyboard ()
 isUpdatesEnabled () const
 close (bool alsoDelete)
 close ()
 isVisible () const
 isVisibleTo (QWidget *) const
 visibleRect () const
 isHidden () const
 isMinimized () const
 isMaximized () const
 minimumSizeHint () const
 sizePolicy () const
 setSizePolicy (QSizePolicy)
 heightForWidth (int) const
 adjustSize ()
 layout () const
 updateGeometry ()
 reparent (QWidget *parent, WFlags, const QPoint &, bool showIt=FALSE)
 reparent (QWidget *parent, const QPoint &, bool showIt=FALSE)
 erase ()
 erase (int x, int y, int w, int h)
 erase (const QRect &)
 erase (const QRegion &)
 scroll (int dx, int dy)
 scroll (int dx, int dy, const QRect &)
 drawText (int x, int y, const QString &)
 drawText (const QPoint &, const QString &)
 focusWidget () const
 microFocusHint () const
 acceptDrops () const
 setAcceptDrops (bool on)
 setAutoMask (bool)
 autoMask () const
 BackgroundOrigin {WidgetOrigin, ParentOrigin}
 setBackgroundOrigin (BackgroundOrigin)
 backgroundOrigin () const
 customWhatsThis () const
 parentWidget () const
 testWFlags (WFlags f) const
 setDisabled (bool)
 setCaption (const QString &)
 setIcon (const QPixmap &)
 setIconText (const QString &)
 setMouseTracking (bool enable)
 setFocus ()
 clearFocus ()
 setUpdatesEnabled (bool enable)
 update (int x, int y, int w, int h)
 update (const QRect &)
 repaint ()
 repaint (bool erase)
 repaint (int x, int y, int w, int h, bool erase=TRUE)
 repaint (const QRect &, bool erase=TRUE)
 repaint (const QRegion &, bool erase=TRUE)
 show ()
 hide ()
 showMinimized ()
 showMaximized ()
 showFullScreen ()
 showNormal ()
 polish ()
 constPolish () const
 raise ()
 lower ()
 stackUnder (QWidget *)
 move (int x, int y)
 move (const QPoint &)
 resize (int w, int h)
 resize (const QSize &)
 setGeometry (int x, int y, int w, int h)
 setGeometry (const QRect &)
 setTabOrder (QWidget *, QWidget *)
 mouseGrabber ()
 keyboardGrabber ()
 find (WId)
 event (QEvent *)
 mousePressEvent (QMouseEvent *)
 mouseReleaseEvent (QMouseEvent *)
 mouseDoubleClickEvent (QMouseEvent *)
 mouseMoveEvent (QMouseEvent *)
 wheelEvent (QWheelEvent *)
 keyPressEvent (QKeyEvent *)
 keyReleaseEvent (QKeyEvent *)
 focusInEvent (QFocusEvent *)
 focusOutEvent (QFocusEvent *)
 enterEvent (QEvent *)
 leaveEvent (QEvent *)
 moveEvent (QMoveEvent *)
 closeEvent (QCloseEvent *)
 dragEnterEvent (QDragEnterEvent *)
 dragMoveEvent (QDragMoveEvent *)
 dragLeaveEvent (QDragLeaveEvent *)
 dropEvent (QDropEvent *)
 showEvent (QShowEvent *)
 hideEvent (QHideEvent *)
 customEvent (QCustomEvent *)
 styleChange (QStyle &)
 enabledChange (bool)
 backgroundColorChange (const QColor &)
 backgroundPixmapChange (const QPixmap &)
 paletteChange (const QPalette &)
 fontChange (const QFont &)
 metric (int) const
 create (WId=0, bool initializeWindow=TRUE, bool destroyOldWindow=TRUE)
 destroy (bool destroyWindow=TRUE, bool destroySubWindows=TRUE)
 getWFlags () const
 setWFlags (WFlags)
 clearWFlags (WFlags n)
 focusNextPrevChild (bool next)
 focusData ()
 setKeyCompression (bool)
 setMicroFocusHint (int x, int y, int w, int h, bool text=TRUE)
 eventFilter (QObject *, QEvent *)
 metaObject () const
 className () const
 isA (const char *) const
 inherits (const char *) const
 name () const
 name (const char *defaultName) const
 setName (const char *name)
 isWidgetType () const
 highPriority () const
 signalsBlocked () const
 blockSignals (bool b)
 startTimer (int interval)
 killTimer (int id)
 killTimers ()
 child (const char *name, const char *type=0)
 children () const
 queryList (const char *inheritsClass=0, const char *objName=0, bool regexpMatch=TRUE, bool recursiveSearch=TRUE)
 insertChild (QObject *)
 removeChild (QObject *)
 installEventFilter (const QObject *)
 removeEventFilter (const QObject *)
 connect (const QObject *sender, const char *signal, const char *member) const
 connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 disconnect (const QObject *receiver, const char *member=0)
 disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 dumpObjectTree ()
 dumpObjectInfo ()
 setProperty (const char *name, const QVariant &value)
 property (const char *name) const
 parent () const
 destroyed ()
 tr (const char *)
 tr (const char *, const char *)
 objectTrees ()
 receivers (const char *signal) const
 activate_signal (const char *signal, short)
 activate_signal (const char *signal, int)
 activate_signal (const char *signal, long)
 activate_signal (const char *signal, const char *)
 activate_signal_bool (const char *signal, bool)
 activate_signal_string (const char *signal, QString)
 activate_signal_strref (const char *signal, const QString &)
 sender ()
 initMetaObject ()
 timerEvent (QTimerEvent *)
 childEvent (QChildEvent *)
 connectNotify (const char *signal)
 disconnectNotify (const char *signal)
 checkConnectArgs (const char *signal, const QObject *receiver, const char *member)
 staticMetaObject ()
 normalizeSignalSlot (const char *signalSlot)
 badSuperclassWarning (const char *className, const char *superclassName)
 qt_find_obj_child (QObject *parent, const char *type, const char *name)
 ButtonState {NoButton=0x0000, LeftButton=0x0001, RightButton=0x0002, MidButton=0x0004, MouseButtonMask=0x0007, ShiftButton=0x0008, ControlButton=0x0010, AltButton=0x0020, KeyButtonMask=0x0038, Keypad=0x4000}
 Orientation {Horizontal, Vertical}
 AlignmentFlags {AlignLeft=0x0001, AlignRight=0x0002, AlignHCenter=0x0004, AlignTop=0x0008, AlignBottom=0x0010, AlignVCenter=0x0020, AlignCenter=AlignVCenter|AlignHCenter, SingleLine=0x0040, DontClip=0x0080, ExpandTabs=0x0100, ShowPrefix=0x0200, WordBreak=0x0400, DontPrint=0x1000}
 WidgetFlags {WType_TopLevel=0x00000001, WType_Modal=0x00000002, WType_Popup=0x00000004, WType_Desktop=0x00000008, WType_Mask=0x0000000f, WStyle_Customize=0x00000010, WStyle_NormalBorder=0x00000020, WStyle_DialogBorder=0x00000040, WStyle_NoBorder=0x00000000, WStyle_Title=0x00000080, WStyle_SysMenu=0x00000100, WStyle_Minimize=0x00000200, WStyle_Maximize=0x00000400, WStyle_MinMax=WStyle_Minimize|WStyle_Maximize, WStyle_Tool=0x00000800, WStyle_StaysOnTop=0x00001000, WStyle_Dialog=0x00002000, WStyle_ContextHelp=0x00004000, WStyle_NoBorderEx=0x00008000, WStyle_Mask=0x0000fff0, WDestructiveClose=0x00010000, WPaintDesktop=0x00020000, WPaintUnclipped=0x00040000, WPaintClever=0x00080000, WResizeNoErase=0x00100000, WMouseNoMask=0x00200000, WNorthWestGravity=0x00400000, WRepaintNoErase=0x00800000, WX11BypassWM=0x01000000, WGroupLeader=0x02000000}
 RasterOp {CopyROP, OrROP, XorROP, NotAndROP, EraseROP=NotAndROP, NotCopyROP, NotOrROP, NotXorROP, AndROP, NotEraseROP=AndROP, NotROP, ClearROP, SetROP, NopROP, AndNotROP, OrNotROP, NandROP, NorROP, LastROP=NorROP}
 PenStyle {NoPen, SolidLine, DashLine, DotLine, DashDotLine, DashDotDotLine, MPenStyle=0x0f}
 PenCapStyle {FlatCap=0x00, SquareCap=0x10, RoundCap=0x20, MPenCapStyle=0x30}
 PenJoinStyle {MiterJoin=0x00, BevelJoin=0x40, RoundJoin=0x80, MPenJoinStyle=0xc0}
 TextFormat {PlainText, RichText, AutoText}
 QPainter ()
 QStyleSheet ().
 QStyleSheet () returns TRUE, otherwise as for
 devType () const
 isExtDev () const
 paintingActive () const
 cmd (int, QPainter *, QPDevCmdParam *)
 fontMet (QFont *, int, const char *=0, int=0) const
 fontInf (QFont *, int) const
 bitBlt (QPaintDevice *dst, const QPoint &dp, const QPaintDevice *src, const QRect &sr, RasterOp rop)
 bitBlt (QPaintDevice *dst, int dx, int dy, const QPaintDevice *src, int sx, int sy, int sw, int sh, Qt::RasterOp rop, bool ignoreMask)

Protected Slots

void setYOffset (int offset)
void setXOffset (int offset)
void setColumnWidth (int col, int width)

Protected Methods

virtual void enterTableEvent (QEvent *)
virtual void leaveTableEvent (QEvent *)
QSize cellSize (int row, int col) const
QPoint cellOffset (int row, int col) const
int xOffset () const
int yOffset () const
int findRow (int yPos) const
int findCol (int xPos) const
int headerHeight () const
virtual bool keyboardFocusTraversal (const int reason, const int sourceRow, const int sourceCol, int &destRow, int &destCol)
virtual bool moveFocusForJumpScroll (const int row, const int col, int &newRow, int &newCol)
void generateRightButtonClicked (int row, int col)
const QdbtPImpl * pimpl () const

Friends

class QdbtHeader
class QdbtTable
class QdbtSection
class QdbtCascade
class QdbtTabularSelectDialog
const QdbtPImpl * QdbtBaseCell::pimpl (QdbtBaseTabular *) const
const QdbtPImpl * QdbtTabularInfo::pimpl (QGuardedPtr< QdbtBaseTabular >)

Detailed Description

The QdbtBaseTabular widget provides a multi-column list of cells that can be scrolled.

Each cell in a QdbtBaseTabular can either be empty or contain a QdbtTableCell. The default behavior of the table is row oriented. The user can select one row at a time. Multiple rows can be selected. A selected row is displayed with reversed colors.

Using selectByRow() individual cells can be selected instead of entire rows.

Default the table has a header. The header contains a section for each column. Sections are push buttons, with the following special properties:

The ability to resize a column can be turned off. The header consists of a number of buttons. Each button is a QdbtSection widget (or a widget derived from it) can be modified and using changeSection().

The number of rows and columns of the table can be (re-)set directly using setDimensions() or by inserting rows or inserting columns.

Newly created cells are empty. You can use changeCell() to replace an existing cell with another cell.

Cells can be made editable. This means that their contents can be edited if a user presses the middle mousebutton on a cell.

Warning:
The QdbtBaseTabular assumes ownership of all cells and will delete them when they are not needed.
snapshot1.png
snapshot2.png
snapshot 1
snapshot 2
Examples:

example3.cpp, example5.cpp, and example6.cpp.


Member Enumeration Documentation

enum QdbtBaseTabular::ConfigureSwitches
 

This enum type stores the configuration flags for the tabular. Configuration flags may be considered to be properties of the tabular, that influence its behaviour at runtime.

Enumeration values:
SELECT_NONE  This flag is the neutral flag.
SELECT_BY_ROW  If this flag is set, the tabular is in row selection mode. If this flag is not set, the tabular is in cell selection mode, consequently
See also:
rowSelected(), QdbtBaseCell::isSelected()
SELECT_MULTIPLE  This flag enables selecting multiple entities at once (if it is not applied, the most recently selected entitiy is deselected as soon as a new one is about to be selected automatically)
CLEAR_SELECTION_UNLESS_CTRL  Using this property, the selection of the table is cleared at the begin of every selection session, unless the Control-Key is being pressed.

Together with QdbtBaseTabular::SELECT_MULTIPLE, QdbtBaseTabular::ALLOW_DESELECT and QdbtBaseTabular::SHIFT_CLICK_MARKS_REGION this form the mode that is comparable the the EXTENDED SELECTION mode, Qt offers for QListBox or QListView.

SHIFT_CLICK_MARKS_REGION  If this mode is enabled, clicking a cell marks the intermediate rows or cells between the current position of the keyboard focus and the cell that has been clicked. The keyboard focus is moved to the clicked cells (if allowed to)

Together with QdbtBaseTabular::SELECT_MULTIPLE, QdbtBaseTabular::ALLOW_DESELECT and QdbtBaseTabular::CLEAR_SELECTION_UNLESS_CTRL this form the mode that is comparable the the EXTENDED SELECTION mode, Qt offers for QListBox or QListView.

ALLOW_DESELECT  This flag enables the user to delesect an entity by selecting it once more. However, this option does only affect the user's interaction with the table, so that for example entities may be selected/deselected normally by means of the surrounding programm, even if the deselect option is not specified
ENABLE_JUMP_SCROLL  To enable the 'jump scroll' mode (pressing a key while not editing the tabular's content will then traverse the keyboard focus to next cells beginning with the keyed in text) set this configuration switch
See also:
setJumpScrollTimeout() and moveFocusForJumpScroll()
SHOW_HEADER  If set, the header of the tabular is being displayed
See also:
setHeaderAppearance() and setHeaderCursor()
SHOW_CASCADE  If set, the cascaded header of the tabular is being displayed
See also:
setCascadeText(), setCascadeMode(), setCascadeFont(), setCascadeAlignment()
SHOW_VERTICAL_SCROLLBAR  This switch can be used to configure the visibility of the individual scrollbars of the tabular component. By default, it is set, since the vertical scrollbar by default is visible. If removed, the vertical scrollbar becomes invisible.
SHOW_HORIZONTAL_SCROLLBAR  This switch can be used to configure the visibility of the individual scrollbars of the tabular component. By default, it is set, since the horizontal scrollbar by default is visible. If removed, the horizontal scrollbar becomes invisible.
ENABLE_TOOLTIPS  If set, tooltips will show up if the content of cell is not totally visible.
SELECTION_FOLLOW_KEYBOARD_FOCUS  This flag makes the selection of the tabular follow the keyboard focus if traversed using the arrow keys. More precisely, the entity where the keyboard focus is traversed to becomes selected (the mode of the tabular then is used to determine, how and if other cells/rows are affected.
TRAVERSE_ROW_ONLY  If this option is set, the keyboard focus may only traverse with the current row. If it is set together with QdbtBaseTabular::TRAVERSE_COLUMN_ONLY, the keyboard focus is locked to its current position.
TRAVERSE_COLUMN_ONLY  If this option is set, the keyboard focus may only traverse with the current column. If it is set together with QdbtBaseTabular::TRAVERSE_ROW_ONLY, the keyboard focus is locked to its current position.

enum QdbtBaseTabular::EditResult
 

Along with the signal QdbtBaseTabular::cellEditDone() the result of an edit session is being transmitted to help the surrounding programm determin, how to react to his user interaction. The classification of the result of an edit session is subject to the implementation of each individual cell.

Enumeration values:
NotChanged  The content has not changed during the edit operation
Changed  The content of the cell has changed during this edit session
EditESCed  By request of the user (typically by pressing the escape key if a text edit field is considered) this edit session has been canceled
LoseFocus  The tabular lost the focus during the edit operation. The programm now may decide if this should result in cancelling or accepting the current edit session or if the edit operation shall remain until the user decides to finish it.

enum QdbtBaseTabular::HeaderMode
 

This enumberation type lists the possible types, how a tabular's header may be visulized.

Enumeration values:
MODE_QDBTTABULAR  The tabular's header is displayed the normal way, with a beveled box at the end of the header if the area of the widget should exceed the needed width of the tabular.
MODE_QLISTVIEW  The above mentioned beveled box is not drawn. The space exceeding the necessary width is left blank.

enum QdbtBaseTabular::TraverseReasons
 

Enumberation type for the possible reasons for a keyboard focus traverse. Such a value is passed to the virtual method keyboardFocusTraversal() as formal parameter reason ).

Enumeration values:
KeyPress  The keyboard focus traversal was caused by a key press.
MouseClick  The keyboard focus traversal was caused by clicking a cell with the mouse.
MouseDrag  The keyboard focus traversal was caused by clicking a cell and then dragging the mouse to a different cell.


Constructor & Destructor Documentation

QdbtBaseTabular::QdbtBaseTabular QWidget   parent = 0,
const char *    name = 0,
WFlags    f = 0
 

Constructs an empty tabular (dimension 0 x 0) with an empty header. The parent, name and f arguments are passed to the QFrame constructor.

QdbtBaseTabular::~QdbtBaseTabular  
 

Destroys the table.


Member Function Documentation

void QdbtBaseTabular::activated int    row [signal]
 

This signal is emitted whenever the user double clicks on a row. The index of the row is passed as an argument.

Notice that this signal is only emitted if selection by row is enabled.

See also:
selectByRow() and cellActivated().

bool QdbtBaseTabular::autoUpdate   const
 

Returns TRUE if the view updates itself automatically whenever it is changed in some way.

See also:
setAutoUpdate().

const QFont QdbtBaseTabular::cascadeFont   const
 

Returns the font which is currently set for the cascaded header.

const QdbtBaseCell * QdbtBaseTabular::cell int    row,
int    col
 

Returns a pointer to the cell-object at location (row, col) in the table.

See also:
changeCell().

Reimplemented in QdbtTabular.

void QdbtBaseTabular::cellActivated int    row,
int    col
[signal]
 

This signal is emitted whenever the user double clicks on a cell. The location of the cell is passed as an argument.

Notice that this signal is only emitted if selection by row is disabled.

See also:
selectByRow() and activated().

void QdbtBaseTabular::cellEditDone int    row,
int    col,
int    action,
const QString   oldValue
[signal]
 

This signal is emitted when the user has finished editing a cell. The location (row, col) of the cell in the table is passed as an argument as well as the formed content of the tables's cell. Since this signal is emitted always when editing is finished, the reason that ended editing as encoded into the action argument. Possible results are

  • NotChanged: Editing finished and content did not change
  • Changed: Editing finished and content of cell did change
  • EditESCed: Editing was cancelled by pressing ESC. Since the content of the cell has automatically been reverted, it 'did' not change.
  • LoseFocus: If the focus is being removed from the tabular while being edited, this signal is emitted. Loss of focus can occure, if the focus is removed from the widget while editing or if another cell within the same table is selected for editing

const QFont QdbtBaseTabular::cellFont   const
 

Returns the font that is currently used for the header.

See also:
setHeaderFont().

QPoint QdbtBaseTabular::cellOffset int    row,
int    col
const [protected]
 

Returns the offset in pixels of the cell at location (row,\a col) in the table.

The offset is based on the scrollable part of the table (excluding the header). Therefore, it includes parts of the table that are not visible because of scrolling.

void QdbtBaseTabular::cellSelected int    row,
int    col,
bool    state
[signal]
 

This signal is emitted whenever the highlight status of a cell is changed. The location of the cell and the new state are passed as arguments. If the value of state is TRUE the cell is currently highlighted.

Notice that this signal is only emitted if selection by row is disabled.

See also:
selectByRow() and selected().

QSize QdbtBaseTabular::cellSize int    row,
int    col
const [protected]
 

Returns the current size of the cell at location (row,\a col) in the table. The cells themselves are not aware of their size.

void QdbtBaseTabular::changeCell const QdbtBaseCell *const    tc,
int    row,
int    col
 

Deletes the contents of the cell at row row and column col and replaces it with a deep copy of the cell tc. If tc is the null pointer, the cell will become empty.

See also:
cell().

void QdbtBaseTabular::changeSection QdbtSection   section,
int    col
 

Sets a user specified widget representing the section of the header above column col.

If you want to change the look and/or feel of the default section, you should inherit your own widget from QdbtSection and supply a dynamicly allocated object as the section argument:

Example:

Assume you have a widget MySection that inherits from QdbtSection, then you can change column col of a table widget tabular like this

  MySection *section=new MySection(tabular);
  tabular->changeSection(section,col);

Warning:
The QdbtBaseTabular widget assumes ownership of the section widgets, do not delete them manually.
See also:
section() and QdbtSection.
Examples:
example3.cpp, example5.cpp, and example6.cpp.

void QdbtBaseTabular::clearSelection bool    state = FALSE
 

This function clears (if state is FALSE ) or sets (if state is TRUE ) all selections within the tabular. Signals are emitted in the ususal way for each cell or raw, modified in this manner.

Warning:
This function is depending on the current mode of the tabular (cell/row).
Examples:
example5.cpp.

bool QdbtBaseTabular::columnVisible int    column const
 

This function examines, if a column is visible (by returning TRUE ) or if it is hidden ( FALSE ).

int QdbtBaseTabular::columnWidth int    col const
 

Returns the width in pixels of the column at index col.

See also:
rowHeight() and columnWidthHint().

void QdbtBaseTabular::columnWidthChanged int    col,
int    width
[signal]
 

This signals is emitted, whenever the column with changes

int QdbtBaseTabular::columnWidthHint int    col const
 

Returns the minimal width that is required to fully display all cells in the column at index col including the header.

See also:
fitAll().
Examples:
example5.cpp.

int QdbtBaseTabular::configuration   const
 

Read the current configuration of the tabular. This configuration is composed out of the flags specified in QdbtBaseTabular::ConfigureSwitches .

bool QdbtBaseTabular::containsFocus   const
 

Returns TRUE if any of the tabular's components (the table, the header or the cell editor or the current editing session) contains the focus.

bool QdbtBaseTabular::currentKeyboardFocus int &    row,
int &    col
 

Returns the position of the keyboard focus within the widget. The return value answers whether the keyboard focus is currently shown at all (or if the focus is currently within another widget), row and col are set to the position of the focus. The values assigned to row are between -1 and numRows()-1 (-1 if no row has the focus), those for col between -1 and numCols()-1.

Warning:
This function is read the input focus, not to set it.

void QdbtBaseTabular::editCell int    row,
int    col
[slot]
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

QdbtBaseTabular::editCell( row, col, FALSE );

void QdbtBaseTabular::editCell int    row,
int    col,
bool    traverse
[slot]
 

Sets the edit focus on the cell at location (row, col) in the table. Normally, the user is allowed to edit cells by clicking the middle mouse button those cells that are enabled for editing (see QdbtTableCell::setEditable()). This function can force the editing of a certain cell regardless of the edit state of the cell.

If editing a cell, which has not been created previously, this is done 'on the fly'.

The traverse flag may be set to TRUE, if the hilighted cell shall be moved to this position, too.

Examples:
example5.cpp.

void QdbtBaseTabular::enterTableEvent QEvent   ev [protected, virtual]
 

A virtual function that handles the mouse enter events of the table excluding the header.

Does not do anything at the moment.

void QdbtBaseTabular::exchangeCols int    col1,
int    col2
[virtual]
 

Exchange columns col1 and col2 within the table. Header-Cells are also exchanged, the cascaded header is left untouched.

Reimplemented in QdbtTabular.

void QdbtBaseTabular::exposeCell int    row,
int    col
 

Scrolls the table so that the cell at (row, col), in such a way that the cell is visible for the largest part possible. The amount of scrolling is minimized. It is 0 if the cell is already completely visible.

int QdbtBaseTabular::findCol int    xPos const [protected]
 

Returns the index of the column at position xPos, where xPos is in widget coordinates. Returns -1 if xPos is outside the valid range.

See also:
findRow().

int QdbtBaseTabular::findRow int    yPos const [protected]
 

Returns the index of the row at position yPos, where yPos is in widget coordinates. Returns -1 if yPos is outside the valid range.

See also:
findCol() and headerHeight().

void QdbtBaseTabular::fitAll   [slot]
 

Resizes the table's columns so that all cells fit (are not truncated).

See also:
sizeHint() and columnWidthHint().
Examples:
example3.cpp.

QdbtBaseTabular::HeaderMode QdbtBaseTabular::headerAppearance  
 

This function answers the mode, in which the tabular widget's header is currently being displayed (or would be displayed, if it is hidden). This mode may be one of the following:

  • MODE_QLISTVIEW
  • MODE_QDBTTABULAR

const QFont QdbtBaseTabular::headerFont   const
 

Returns the font that is currently used for the header.

See also:
setHeaderFont().

int QdbtBaseTabular::headerHeight   const [protected]
 

Returns the height of the header in pixels. If the header is currently invisible 0 is returned.

void QdbtBaseTabular::insertCol int    col = -1 [virtual]
 

Insert a new column at column-index index A value of index=-1 will append a column to the end of the table

See also:
changeSection(), removeCol() and setDimensions().

Reimplemented in QdbtTabular.

void QdbtBaseTabular::insertRow int    row = -1,
bool    selectable = TRUE
 

Insert a new row at row-index row in the table. A value of row=-1 will append a row to the end of the table. Each cell in the new row is empty.

If selectable is set to TRUE (the default) the row may be selected by the user.

If selectable is set to FALSE the row is not selectable by the user.

Notice that the value of selectable only has effect if the selection of rows is enabled.

See also: removeRow(), selectByRow(), setDimensions(), changeCell(), numRows().

int QdbtBaseTabular::jumpScrollTimeout   const
 

Returns the timeout in msec, after that the keyed in text for jump scroll mode is being cleared.

See also:
setJumpScrollTimeout(), moveFocusForJumpScroll()

bool QdbtBaseTabular::keyboardFocusTraversal const int    reason,
const int    sourceRow,
const int    sourceCol,
int &    destRow,
int &    destCol
[protected, virtual]
 

This function decides if a (requested) traversal of the keyboard focus is allowed or will be rejected. This traversal will cause the focus to move from sourceRow, sourceCol to destRow, destCol and is caused by a reason (namely KeyPress, MouseClick or MouseDrag from the enum type QdbtBaseTabular::TraverseReasons ). By returning TRUE, the focus movement is accepted, FALSE rejects the focus traversal.

Warning:
Please understand that the resulting Position destRow and destCol may be changed by this function. However this may result in strange behaviour of the widget and should hardly be necessary to use.
See also:
TraverseReasons

void QdbtBaseTabular::leaveTableEvent QEvent   ev [protected, virtual]
 

A virtual function that handles the mouse leave events of the table excluding the header.

Does not do anything at the moment.

Examples:
example2.cpp.

void QdbtBaseTabular::modifyConfiguration ConfigureSwitches    add = SELECT_NONE,
ConfigureSwitches    revoke = SELECT_NONE
 

Modify (set and/or revoke) the configuration for the tabular instance. When a switch is specified as add -parameter, this configuration is added to the current tabular configuration, revoke is used for removing a single configuration switch from the tabulars current configuration. Specifying QdbtBaseTabular::SELECT_NONE as parameter add or revoke may be used to add no switch to the tabular configuration or revoke no switch from the current configuration.

Examples:
example5.cpp.

bool QdbtBaseTabular::moveFocusForJumpScroll const int    row,
const int    col,
int &    newRow,
int &    newCol
[protected, virtual]
 

This function computes the next cell for the jump scroll mode. When pressing keys while not editing a cell, this mode is active. It searches for the next cell entity which has a text starting with the character sequence just keyed in (the sequence is automatically being cleared after a user defined timeout interval if no key is being pressed)

Parameters:
row  Current row of the jump scroll focus (not necessarily the keyboard focus)
col  Current column of the jump scroll focus (not necessarily the keyboard focus)
newRow  New row for the jump scroll focus
newCol  New column for the jump scoll focus
Returns:
TRUE, if the jump focus shall be placed at the new location, FALSE, if the jump scoll search should be canceled
See also:
setJumpScrollTimeout(), jumpScrollTimeout(), ENABLE_JUMP_SCROLL

const QColor & QdbtBaseTabular::notEditableColor   const [inline]
 

Returns the baground color for cells that are not editable. If this color is not valid (QColor::isValid()), the default background color is used.

int QdbtBaseTabular::numCols   const
 

Returns the number of columns in the table.

See also:
numRows().
Examples:
example5.cpp.

int QdbtBaseTabular::numRows   const
 

Returns the number of rows in the table (not counting the header).

See also:
numCols().
Examples:
example5.cpp.

void QdbtBaseTabular::performTrace const QString   str [inline]
 

This member may be called from the tabular components (or the tabular itself) the record and send a traceable message using the signal QdbtBaseTabular::traceMessage().

const QdbtPImpl * QdbtBaseTabular::pimpl   const [inline, protected]
 

Returns a pointer to the private implementation member for subclasses (but be careful!)

void QdbtBaseTabular::redrawCascade   [slot]
 

This function draws the cascaded header. It should not be used unless absolutely necessary since redraws are normally done automatically.

void QdbtBaseTabular::redrawHeader   [slot]
 

This function draws the header. It should not be used unless absolutely necessary since redraws are normally done automatically.

void QdbtBaseTabular::removeCol int    col [virtual]
 

Removes the column at index index (and its section) from the table. All cells in the column will be deleted.

See also:
insertCol() and setDimensions().

Reimplemented in QdbtTabular.

void QdbtBaseTabular::removeRow int    row
 

Removes row at row from the table. All cells in the row will be deleted.

See also:
insertRow() and setDimensions().

void QdbtBaseTabular::rightButtonClicked int    row,
int    col
[signal]
 

This signal is used to inform the programm, that the right mousebutton has been pressed on top of the cell at row row and column col.

int QdbtBaseTabular::rowHeight int    row const
 

Returns the height in pixels of the row at index row.

See also:
columnWidth().

bool QdbtBaseTabular::rowSelected int    row const
 

Returns TRUE if the row at index index is currently selected. Notice that this function only returns useful values if selection by row is enabled.

See also:
setRowSelected() and selectByRow().

QdbtSection * QdbtBaseTabular::section int    col const
 

Returns a pointer to the widget representing the section of the header above column col.

You can use this pointer to get or set the text and/or alignment of the section.

Warning:
The table widget assumes control over the resize and location of the section widget. Do not change these properties manually.
See also:
changeSection() and QdbtSection.
Examples:
example5.cpp.

void QdbtBaseTabular::sectionClicked int    index [signal]
 

This signal is emitted if the user clicks on a section button. A section represents the header above a column. The index of the column is passed as an argument.

void QdbtBaseTabular::selected int    index,
bool    state
[signal]
 

This signal is emitted whenever the highlight status of a row is changed. The index of the row and the new state are passed as arguments. If the value of state is TRUE the row is currently highlighted.

Notice that this signal is only emitted if selection by row is enabled.

See also:
selectByRow() and cellSelected().

void QdbtBaseTabular::setAutoUpdate bool    state
 

Sets the auto-update option of the table view to enable.

If enable is TRUE (this is the default) then the table updates it self automatically whenever it has changed in some way (for example when a flag is changed).

If enable is FALSE, the table does NOT repaint itself, or update its internal state variables itself when it is changed. This can be useful to avoid flicker during large changes, and is singularly useless otherwise: Disable auto-update, do the changes, re-enable auto-update, and call update().

Warning:
Do not leave the view in this state for a long time (i.e. between events ). If, for example, the user interacts with the table when auto-update is off, strange things can happen.
Setting auto-update to TRUE does not repaint the view, you must call update() to do this.

See also:
autoUpdate() and update().
Examples:
example5.cpp.

void QdbtBaseTabular::setCascadeAlignment int    col,
const int    align
 

Select the alignment (in terms of Qt, meaning e.g. Qt::AlignCenter) of an indivual cell. Useless unless cells is and End-Cell.

This function does not initiate an automatic redraw of the cascaded header.

void QdbtBaseTabular::setCascadeFont const QFont   font
 

Select the font, in which the cascaded cells are displayed.

This function does not initiate an automatic redraw of the cascaded header.

void QdbtBaseTabular::setCascadeMode int    col,
const int    mode
 

Set the mode of a single cascade-cell. Currently only two modes are supported: End-Cell-Mode (0) or Continue-Cell-Mode (1).

In End-Cell-Mode a sequence of cascaded continue-mode cells 'ends' displaying the text set for the end-cell.

In Continue-Cell-Mode the cells is not displayed as an indivual cells. I adds its space to the following cells (which if it is another continue-cell adds this iteratively to its successor a.s.o.) A sequence of Continue-Cells is terminated by one End-Cell or the last column of the tabular.

This function does not initiate an automatic redraw of the cascaded header.

Examples:
example6.cpp.

void QdbtBaseTabular::setCascadeText int    col,
const QString   text
 

The text of a cascaed headed is set using this function. Please keep in mind that using this function may have no effect unless using the setCascadeMode() function to set the correct mode of the cell.

This function does not initiate an automatic redraw of the cascaded header.

Examples:
example6.cpp.

void QdbtBaseTabular::setCellFont const QFont   font
 

Sets the font that is used for the text of each cell to font.

See also:
cellFont() and setHeaderFont().
Examples:
example3.cpp.

void QdbtBaseTabular::setColumnVisible int    column,
bool    visible
 

Make a column appear and disappear. This function may be used to hide a column entirely, so that the user cannot set it or resize it any more. This is achieved by passing the number of the column and a visible-state of FALSE . Consequently, setting the visiblity-state to TRUE shows the column again.

Examples:
example5.cpp.

void QdbtBaseTabular::setColumnWidth int    col,
int    width
[protected, slot]
 

Sets the width of column at col to width pixels.

See also:
columnWidth(), columnWidthHint(), setYOffset() and setYOffset()

Reimplemented in QdbtTabular.

void QdbtBaseTabular::setDefaultCell const QdbtBaseCell   defCell
 

Sets a copy of a cell as the table's default cell. This cell is used, whenever a cell is not explicitely set within the table's cell matrix.

Using this mechanism it should be easy to implement a tabular acting like in model-view-controller approch.

void QdbtBaseTabular::setDimensions int    rows,
int    cols
[virtual]
 

Set the dimension of the table to rows rows and cols columns. If the table is made smaller, the cells that fall outside the table will be deleted. If the table is made larger, empty cells are created. All cells that are inside the area covered by both the old size and the new size remain unchanged.

Try to use this function whenever possible, because it is much more efficient than repeatedly inserting rows and columns.

See also:
insertRow(), removeRow(), insertCol(), removeCol() and clear().

Reimplemented in QdbtTabular.

Examples:
example6.cpp.

void QdbtBaseTabular::setEnabled bool    state [slot]
 

Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

Examples:
example5.cpp.

void QdbtBaseTabular::setHeaderAppearance HeaderMode    header_mode
 

The tabular widget by default fills the remaining space in the header bar with a beveled box. The header_mode may be one of the following modes:

  • MODE_QLISTVIEW: Display header as the QListView-Widget does (without a beveled box at the end)
  • MODE_QDBTTABULAR: Show the header as normally done by the QdbtBaseTabular-Widget (includeing the beveled box at the end of the header)

void QdbtBaseTabular::setHeaderCursor const QCursor   newCursor
 

In order to acompish a consistend look-and-feel with the other Qt-Widgets (which may change) it may be necessary to override the cursor shape when resizing the header or the tabular widget.

void QdbtBaseTabular::setHeaderFont const QFont   font
 

Sets the font that is used for the text in the table's sections to font

See also:
headerFont() and setCellFont().
Examples:
example3.cpp.

void QdbtBaseTabular::setJumpScrollTimeout int    mSeconds
 

When entering text in the jump scroll mode, the timout ( mSeconds ) describes the time, after which the input is being cleared.

Setting this amount of time to 0 will resolve is no strings being accumulated. This, the used can traverse through all beginning with e.g. 'f' by keping the 'f' Key pressed down.

See also:
moveFocusForJumpScroll(), jumpScrollTimeout()

void QdbtBaseTabular::setKeyboardFocus int    row,
int    col
 

This function explicitly sets the keyboard focus to a cell within the tabular.

void QdbtBaseTabular::setNotEditableColor const QColor   col
 

All Cells, that are not editable, may be displayed using a different background color. This colors can be set using this function. If no or an invalid color is set, the default background color is used.

void QdbtBaseTabular::setRowSelected int    row,
bool    status
 

Sets the select state of the row at index index to status. If status is TRUE the row will be highlighted (selected). If status is FALSE the row will not be highlighted (unselected).

See also:
rowSelected().

void QdbtBaseTabular::setXOffset int    offset [protected, slot]
 

This slot sets the horizontal offset of the tabular. This feature may be used to synchronize two tables while scolling. If the offset did not change, the table is not scrolled either.

See also:
setYOffset(), setColumnWidth()

Reimplemented in QdbtTabular.

void QdbtBaseTabular::setYOffset int    offset [protected, slot]
 

This slot sets the vertical offset of the tabular. This feature may be used to synchronize two tables while scolling. If the offset did not change, the table is not scrolled either.

See also:
setXOffset(), setColumnWidth()

Reimplemented in QdbtTabular.

QSize QdbtBaseTabular::sizeHint   const
 

Returns the preferred size of the table. The size is chosen so that all cells fit without the need for scrollbars.

Notice, that if there are many or large cells in the table, the returned size may be very large.

See also:
fitAll().

Reimplemented from QWidget.

void QdbtBaseTabular::stopEdit bool    accept [slot]
 

Stops editing in progress. Is accept is TRUE, the result is accepted as if the user had pressed return, if accept is FALSE the changes are being discarded.

void QdbtBaseTabular::traceMessage const QString   [signal]
 

You may connect to this signal to trace internal messages, the tabular may generate (depending on the trace-support being compiled into the tabular or not)

void QdbtBaseTabular::update   [slot]
 

Updates the widget unless updates are disabled or the widget is hidden.

Updating the widget will redraw each cell that is exposed. Cells erase themselves when they are redrawn, thus minimizing the amount of flickering.

Notice, that this function repaints the table correctly in all cases, whereas repaint() does not.

Reimplemented from QWidget.

Examples:
example5.cpp.

int QdbtBaseTabular::xOffset   const [protected]
 

Returns the x coordinate in table coordinates of the pixel which is currently on the left edge of the view.

See also:
yOffset().

void QdbtBaseTabular::xOffsetChanged int    offset [signal]
 

This signal is sent, of the horizontal scrollbar value changed or if this scrollbar has been moved.

int QdbtBaseTabular::yOffset   const [protected]
 

Returns the y coordinate in table coordinates of the pixel which is currently on the top edge of the view.

See also:
xOffset().

void QdbtBaseTabular::yOffsetChanged int    offset [signal]
 

This signal is sent, of the vertical scrollbar value changed or if this scrollbar has been moved.


Friends And Related Function Documentation

const QdbtPImpl* QdbtBaseCell::pimpl QdbtBaseTabular *    const [friend]
 

Allows the base-cell's pimpl-member to loock up the private implementation member from it tabular context

const QdbtPImpl* QdbtTabularInfo::pimpl QGuardedPtr< QdbtBaseTabular >    [friend]
 

Allows the pimpl-member from QdbtTabularInfo to access the private implementation details

friend class QdbtTabularSelectDialog [friend]
 

Allow the selection dialog (part of the debug-library) to see the currently instantiated list of tabulars


The documentation for this class was generated from the following files:
Generated on Mon Apr 22 12:21:55 2002 for QdbtTabular by doxygen1.2.15-20020421