Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

Q3DataTable Class Reference

Inheritance diagram for Q3DataTable:

Q3Table Q3ScrollView Q3Frame QFrame QWidget QObject QPaintDevice

List of all members.


Detailed Description

The Q3DataTable class provides a flexible SQL table widget that supports browsing and editing.

Q3DataTable supports various functions for presenting and editing SQL data from a Q3SqlCursor in a table.

If you want a to present your data in a form use QDataBrowser, or for read-only forms, use QDataView instead.

When displaying data, Q3DataTable only retrieves data for visible rows. If the driver supports the 'query size' property the Q3DataTable will have the correct number of rows and the vertical scrollbar will accurately reflect the number of rows displayed in proportion to the number of rows in the dataset. If the driver does not support the 'query size' property, rows are dynamically fetched from the database on an as-needed basis with the scrollbar becoming more accurate as the user scrolls down through the records. This allows extremely large queries to be displayed as quickly as possible, with minimum memory usage.

Q3DataTable inherits Q3Table's API and extends it with functions to sort and filter the data and sort columns. See setSqlCursor(), setFilter(), setSort(), setSorting(), sortColumn() and refresh().

When displaying editable cursors, cell editing will be enabled. (For more information on editable cursors, see Q3SqlCursor). Q3DataTable can be used to modify existing data and to add new records. When a user makes changes to a field in the table, the cursor's edit buffer is used. The table will not send changes in the edit buffer to the database until the user moves to a different record in the grid or presses Enter. Cell editing is initiated by pressing F2 (or right clicking and then clicking the appropriate popup menu item) and canceled by pressing Esc. If there is a problem updating or adding data, errors are handled automatically (see handleError() to change this behavior). Note that if autoEdit() is false navigating to another record will cancel the insert or update.

The user can be asked to confirm all edits with setConfirmEdits(). For more precise control use setConfirmInsert(), setConfirmUpdate(), setConfirmDelete() and setConfirmCancels(). Use setAutoEdit() to control the behavior of the table when the user edits a record and then navigates. (Note that setAutoDelete() is unrelated; it is used to set whether the Q3SqlCursor is deleted when the table is deleted.)

Since the data table can perform edits, it must be able to uniquely identify every record so that edits are correctly applied. Because of this the underlying cursor must have a valid primary index to ensure that a unique record is inserted, updated or deleted within the database otherwise the database may be changed to an inconsistent state.

Q3DataTable creates editors using the default Q3SqlEditorFactory. Different editor factories can be used by calling installEditorFactory(). A property map is used to map between the cell's value and the editor. You can use your own property map with installPropertyMap().

The contents of a cell is available as a QString with text() or as a QVariant with value(). The current record is returned by currentRecord(). Use the find() function to search for a string in the table.

Editing actions can be applied programatically. For example, the insertCurrent() function reads the fields from the current record into the cursor and performs the insert. The updateCurrent() and deleteCurrent() functions perform similarly to update and delete the current record respectively.

Columns in the table can be created automatically based on the cursor (see setSqlCursor()). Columns can be manipulated manually using addColumn(), removeColumn() and setColumn().

The table automatically copies many of the properties of the cursor to format the display of data within cells (alignment, visibility, etc.). The cursor can be changed with setSqlCursor(). The filter (see setFilter()) and sort defined within the table are used instead of the filter and sort set on the cursor. For sorting options see setSort(), sortColumn(), sortAscending() and sortDescending(). Note that sorting operations will not behave as expected if you are using a QSqlSelectCursor because it uses user-defined SQL queries to obtain data.

The text used to represent NULL, true and false values can be changed with setNullText(), setTrueText() and setFalseText() respectively. You can change the appearance of cells by reimplementing paintField().

Whenever a new row is selected in the table the currentChanged() signal is emitted. The primeInsert() signal is emitted when an insert is initiated. The primeUpdate() and primeDelete() signals are emitted when update and deletion are initiated respectively. Just before the database is updated a signal is emitted; beforeInsert(), beforeUpdate() or beforeDelete() as appropriate.

Definition at line 45 of file q3datatable.h.


Public Types

enum  { Shadow_Mask = 0x00f0, Shape_Mask = 0x000f }
enum  FocusStyle { FollowStyle, SpreadSheet }
enum  PaintDeviceMetric {
  PdmWidth = 1, PdmHeight, PdmWidthMM, PdmHeightMM,
  PdmNumColors, PdmDepth, PdmDpiX, PdmDpiY,
  PdmPhysicalDpiX, PdmPhysicalDpiY
}
enum  Refresh { RefreshData = 1, RefreshColumns = 2, RefreshAll = 3 }
enum  ResizePolicy { Default, Manual, AutoOne, AutoOneFit }
enum  ScrollBarMode { Auto, AlwaysOff, AlwaysOn }
enum  SelectionMode {
  Single, Multi, SingleRow, MultiRow,
  NoSelection
}
enum  Shadow { Plain = 0x0010, Raised = 0x0020, Sunken = 0x0030 }
enum  Shape {
  NoFrame = 0, Box = 0x0001, Panel = 0x0002, WinPanel = 0x0003,
  HLine = 0x0004, VLine = 0x0005, StyledPanel = 0x0006
}

Public Slots

void adjustColumn (int col)
virtual void adjustRow (int row)
void center (int x, int y, float xmargin, float ymargin)
void center (int x, int y)
void clearSelection (bool repaint=true)
bool close ()
void deleteLater ()
virtual void editCell (int row, int col, bool replace=false)
void ensureVisible (int x, int y, int xmargin, int ymargin)
void ensureVisible (int x, int y)
virtual void find (const QString &str, bool caseSensitive, bool backwards)
void hide ()
virtual void hideRow (int row)
virtual void insertColumns (int col, int count=1)
virtual void insertRows (int row, int count=1)
void lower ()
void raise ()
virtual void refresh ()
virtual void removeColumns (const Q3MemArray< int > &cols)
virtual void removeRow (int row)
virtual void removeRows (const Q3MemArray< int > &rows)
void repaint ()
virtual void resizeContents (int w, int h)
void scrollBy (int dx, int dy)
void setColumnLabels (const QStringList &labels)
virtual void setColumnMovingEnabled (bool b)
virtual void setColumnReadOnly (int col, bool ro)
void setColumnStretchable (int col, bool stretch)
void setColumnWidth (int col, int w)
virtual void setContentsPos (int x, int y)
virtual void setCurrentCell (int row, int col)
void setDisabled (bool)
virtual void setDragEnabled (bool b)
void setFocus ()
void setHidden (bool hidden)
virtual void setLeftMargin (int m)
virtual void setReadOnly (bool b)
virtual void setRowHeight (int row, int h)
void setRowLabels (const QStringList &labels)
virtual void setRowMovingEnabled (bool b)
virtual void setRowReadOnly (int row, bool ro)
virtual void setRowStretchable (int row, bool stretch)
virtual void setShowGrid (bool b)
QT_MOC_COMPAT void setShown (bool shown)
virtual void setSorting (bool b)
virtual void setTopMargin (int m)
void setWindowModified (bool)
void show ()
void showFullScreen ()
void showMaximized ()
void showMinimized ()
void showNormal ()
virtual void showRow (int row)
virtual void sortAscending (int col)
virtual void sortDescending (int col)
virtual void swapCells (int row1, int col1, int row2, int col2)
void swapColumns (int col1, int col2, bool swapHeaders=false)
virtual void swapRows (int row1, int row2, bool swapHeader=false)
void update ()
void updateScrollBars ()

Signals

void beforeDelete (QSqlRecord *buf)
void beforeInsert (QSqlRecord *buf)
void beforeUpdate (QSqlRecord *buf)
void clicked (int row, int col, int button, const QPoint &mousePos)
void contentsMoving (int x, int y)
void contextMenuRequested (int row, int col, const QPoint &pos)
void currentChanged (int row, int col)
void currentChanged (QSqlRecord *record)
void cursorChanged (QSql::Op mode)
void customContextMenuRequested (const QPoint &pos)
void destroyed (QObject *=0)
void doubleClicked (int row, int col, int button, const QPoint &mousePos)
void dropped (QDropEvent *e)
void horizontalSliderPressed ()
void horizontalSliderReleased ()
void pressed (int row, int col, int button, const QPoint &mousePos)
void primeDelete (QSqlRecord *buf)
void primeInsert (QSqlRecord *buf)
void primeUpdate (QSqlRecord *buf)
void selectionChanged ()
void valueChanged (int row, int col)
void verticalSliderPressed ()
void verticalSliderReleased ()

Public Member Functions

bool acceptDrops () const
QString accessibleDescription () const
QString accessibleName () const
QList< QAction * > actions () const
void activateWindow ()
void addAction (QAction *action)
void addActions (QList< QAction * > actions)
virtual void addChild (QWidget *child, int x=0, int y=0)
virtual void addColumn (const QString &fieldName, const QString &label=QString(), int width=-1, const QIconSet &iconset=QIconSet())
virtual int addSelection (const Q3TableSelection &s)
void adjustSize ()
bool autoDelete () const
bool autoEdit () const
bool autoFillBackground () const
QPalette::ColorRole backgroundRole () const
QSize baseSize () const
bool blockSignals (bool b)
int bottomMargin () const
virtual QRect cellGeometry (int row, int col) const
virtual QRect cellRect (int row, int col) const
virtual QWidgetcellWidget (int row, int col) const
QWidgetchildAt (const QPoint &p) const
QWidgetchildAt (int x, int y) const
bool childIsVisible (QWidget *child)
const QObjectListchildren () const
QRect childrenRect () const
QRegion childrenRegion () const
int childX (QWidget *child)
int childY (QWidget *child)
virtual void clearCellWidget (int row, int col)
void clearFocus ()
void clearMask ()
QWidgetclipper () const
virtual int columnAt (int x) const
bool columnMovingEnabled () const
virtual int columnPos (int col) const
virtual int columnWidth (int col) const
bool confirmCancels () const
bool confirmDelete () const
bool confirmEdits () const
bool confirmInsert () const
bool confirmUpdate () const
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
int contentsHeight () const
QRect contentsRect () const
QPoint contentsToViewport (const QPoint &) const
void contentsToViewport (int x, int y, int &vx, int &vy) const
int contentsWidth () const
int contentsX () const
int contentsY () const
Qt::ContextMenuPolicy contextMenuPolicy () const
QWidgetcornerWidget () const
int currentColumn () const
QSqlRecordcurrentRecord () const
int currentRow () const
virtual int currentSelection () const
QCursor cursor () const
Qt::DateFormat dateFormat () const
int depth () const
int devType () const
void disableSizeHintCaching ()
bool disconnect (const QObject *receiver, const char *member=0)
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
bool dragAutoScroll () const
bool dragEnabled () const
void dumpObjectInfo ()
void dumpObjectTree ()
void enableClipper (bool y)
void ensureCellVisible (int row, int col)
void ensurePolished () const
QString falseText () const
QString filter () const
bool findBuffer (const QSqlIndex &idx, int atHint=0)
template<typename T>
findChild (const QString &name=QString()) const
template<typename T>
QList< T > findChildren (const QRegExp &re) const
template<typename T>
QList< T > findChildren (const QString &name=QString()) const
Qt::FocusPolicy focusPolicy () const
QWidgetfocusProxy () const
FocusStyle focusStyle () const
QWidgetfocusWidget () const
const QFontfont () const
QFontInfo fontInfo () const
QFontMetrics fontMetrics () const
QPalette::ColorRole foregroundRole () const
QRect frameGeometry () const
QRect frameRect () const
Shadow frameShadow () const
Shape frameShape () const
QSize frameSize () const
int frameStyle () const
int frameWidth () const
const QRectgeometry () const
void getContentsMargins (int *left, int *top, int *right, int *bottom) const
void grabKeyboard ()
void grabMouse (const QCursor &)
void grabMouse ()
int grabShortcut (const QKeySequence &key, Qt::ShortcutContext context=Qt::WindowShortcut)
Qt::HANDLE handle () const
bool hasFocus () const
bool hasMouseTracking () const
bool hasStaticBackground () const
int height () const
virtual int heightForWidth (int) const
int heightMM () const
void hideColumn (int col)
Q3HeaderhorizontalHeader () const
QScrollBarhorizontalScrollBar () const
ScrollBarMode hScrollBarMode () const
int indexOf (uint i) const
bool inherits (const char *classname) const
QInputContextinputContext ()
QVariant inputMethodQuery (Qt::InputMethodQuery query) const
void insertAction (QAction *before, QAction *action)
void insertActions (QAction *before, QList< QAction * > actions)
void installEditorFactory (Q3SqlEditorFactory *f)
void installEventFilter (QObject *)
void installPropertyMap (Q3SqlPropertyMap *m)
bool isActiveWindow () const
bool isAncestorOf (const QWidget *child) const
bool isColumnHidden (int col) const
bool isColumnReadOnly (int col) const
bool isColumnSelected (int col, bool full=false) const
bool isColumnStretchable (int col) const
bool isEnabled () const
bool isEnabledTo (QWidget *) const
bool isEnabledToTLW () const
bool isFullScreen () const
bool isHidden () const
bool isHorizontalSliderPressed ()
bool isLeftToRight () const
bool isMaximized () const
bool isMinimized () const
bool isModal () const
bool isReadOnly () const
bool isRightToLeft () const
bool isRowHidden (int row) const
bool isRowReadOnly (int row) const
bool isRowSelected (int row, bool full=false) const
bool isRowStretchable (int row) const
bool isSelected (int row, int col) const
bool isTopLevel () const
bool isVerticalSliderPressed ()
bool isVisible () const
bool isVisibleTo (QWidget *) const
bool isWidgetType () const
bool isWindow () const
bool isWindowModified () const
void killTimer (int id)
QLayoutlayout () const
Qt::LayoutDirection layoutDirection () const
int leftMargin () const
bool lineShapesOk () const
int lineWidth () const
int logicalDpiX () const
int logicalDpiY () const
QPoint mapFrom (QWidget *, const QPoint &) const
QPoint mapFromGlobal (const QPoint &) const
QPoint mapFromParent (const QPoint &) const
QPoint mapTo (QWidget *, const QPoint &) const
QPoint mapToGlobal (const QPoint &) const
QPoint mapToParent (const QPoint &) const
int margin () const
QRegion mask () const
int maximumHeight () const
QSize maximumSize () const
int maximumWidth () const
int midLineWidth () const
int minimumHeight () const
QSize minimumSize () const
QSize minimumSizeHint () const
int minimumWidth () const
void move (const QPoint &)
void move (int x, int y)
virtual void moveChild (QWidget *child, int x, int y)
void moveToThread (QThread *thread)
QWidgetnextInFocusChain () const
QRect normalGeometry () const
QString nullText () const
int numColors () const
int numCols () const
int numRows () const
int numSelections () const
QString objectName () const
void overrideWindowFlags (Qt::WindowFlags type)
void overrideWindowState (Qt::WindowStates state)
virtual void paintCell (QPainter *p, int row, int col, const QRect &cr, bool selected)
QPaintEnginepaintEngine () const
virtual void paintFocus (QPainter *p, const QRect &r)
bool paintingActive () const
const QPalettepalette () const
QObjectparent () const
QWidgetparentWidget () const
int physicalDpiX () const
int physicalDpiY () const
virtual QPixmap pixmap (int row, int col) const
QPoint pos () const
QVariant property (const char *name) const
 Q3DataTable (Q3SqlCursor *cursor, bool autoPopulate=false, QWidget *parent=0, const char *name=0)
 Q3DataTable (QWidget *parent=0, const char *name=0)
QRect rect () const
void refresh (Refresh mode)
void releaseKeyboard ()
void releaseMouse ()
void releaseShortcut (int id)
void removeAction (QAction *action)
void removeChild (QObject *child)
void removeChild (QWidget *child)
virtual void removeColumn (int col)
void removeEventFilter (QObject *)
virtual void removeSelection (int num)
virtual void removeSelection (const Q3TableSelection &s)
void repaint (const QRegion &)
void repaint (const QRect &)
void repaint (int x, int y, int w, int h)
void repaintContents (bool erase=true)
void repaintContents (const QRect &r, bool erase=true)
void repaintContents (int x, int y, int w, int h, bool erase=true)
void repaintSelections ()
void resize (const QSize &)
void resize (int w, int h)
ResizePolicy resizePolicy () const
int rightMargin () const
virtual int rowAt (int y) const
virtual int rowHeight (int row) const
bool rowMovingEnabled () const
virtual int rowPos (int row) const
void scroll (int dx, int dy, const QRect &)
void scroll (int dx, int dy)
void selectCells (int start_row, int start_col, int end_row, int end_col)
virtual void selectColumn (int col)
Q3TableSelection selection (int num) const
SelectionMode selectionMode () const
void selectRow (int row)
void setAcceptDrops (bool on)
void setAccessibleDescription (const QString &description)
void setAccessibleName (const QString &name)
void setAttribute (Qt::WidgetAttribute, bool on=true)
virtual void setAutoDelete (bool enable)
virtual void setAutoEdit (bool autoEdit)
void setAutoFillBackground (bool enabled)
void setBackgroundRole (QPalette::ColorRole)
void setBaseSize (int basew, int baseh)
void setBaseSize (const QSize &)
virtual void setCellWidget (int row, int col, QWidget *e)
virtual void setColumn (uint col, const QString &fieldName, const QString &label=QString(), int width=-1, const QIconSet &iconset=QIconSet())
virtual void setConfirmCancels (bool confirm)
virtual void setConfirmDelete (bool confirm)
virtual void setConfirmEdits (bool confirm)
virtual void setConfirmInsert (bool confirm)
virtual void setConfirmUpdate (bool confirm)
void setContentsMargins (int left, int top, int right, int bottom)
void setContextMenuPolicy (Qt::ContextMenuPolicy policy)
virtual void setCornerWidget (QWidget *)
void setCursor (const QCursor &)
virtual void setDateFormat (const Qt::DateFormat f)
virtual void setDragAutoScroll (bool b)
void setEnabled (bool b)
virtual void setFalseText (const QString &falseText)
virtual void setFilter (const QString &filter)
void setFixedHeight (int h)
void setFixedSize (int w, int h)
void setFixedSize (const QSize &)
void setFixedWidth (int w)
void setFocus (Qt::FocusReason reason)
void setFocusPolicy (Qt::FocusPolicy policy)
void setFocusProxy (QWidget *)
virtual void setFocusStyle (FocusStyle fs)
void setFont (const QFont &)
void setForegroundRole (QPalette::ColorRole)
void setFrameRect (const QRect &)
void setFrameShadow (Shadow)
void setFrameShape (Shape)
void setFrameStyle (int)
void setGeometry (const QRect &)
void setGeometry (int x, int y, int w, int h)
virtual void setHScrollBarMode (ScrollBarMode)
void setInputContext (QInputContext *)
void setLayout (QLayout *)
void setLayoutDirection (Qt::LayoutDirection direction)
void setLineWidth (int)
void setMargin (int)
virtual void setMargins (int left, int top, int right, int bottom)
void setMask (const QRegion &)
void setMask (const QBitmap &)
void setMaximumHeight (int maxh)
void setMaximumSize (int maxw, int maxh)
void setMaximumSize (const QSize &)
void setMaximumWidth (int maxw)
void setMidLineWidth (int)
void setMinimumHeight (int minh)
void setMinimumSize (int minw, int minh)
void setMinimumSize (const QSize &)
void setMinimumWidth (int minw)
void setMouseTracking (bool enable)
virtual void setNullText (const QString &nullText)
void setNumCols (int c)
void setNumRows (int r)
void setObjectName (const QString &name)
void setPalette (const QPalette &)
void setParent (QObject *)
void setParent (QWidget *parent, Qt::WFlags f)
void setParent (QWidget *parent)
bool setProperty (const char *name, const QVariant &value)
virtual void setResizePolicy (ResizePolicy)
virtual void setSelectionMode (SelectionMode mode)
void setShortcutEnabled (int id, bool enable=true)
void setSizeIncrement (int w, int h)
void setSizeIncrement (const QSize &)
void setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)
void setSizePolicy (QSizePolicy)
virtual void setSort (const QSqlIndex &sort)
virtual void setSort (const QStringList &sort)
virtual void setSqlCursor (Q3SqlCursor *cursor=0, bool autoPopulate=false, bool autoDelete=false)
void setStaticBackground (bool y)
void setStatusTip (const QString &)
void setStyle (QStyle *)
virtual void setText (int row, int col, const QString &text)
void setToolTip (const QString &)
virtual void setTrueText (const QString &trueText)
void setUpdatesEnabled (bool enable)
void setUserData (uint id, QObjectUserData *data)
void setVisible (bool visible)
virtual void setVScrollBarMode (ScrollBarMode)
void setWhatsThis (const QString &)
void setWindowFlags (Qt::WindowFlags type)
void setWindowIcon (const QIcon &icon)
void setWindowIconText (const QString &)
void setWindowModality (Qt::WindowModality windowModality)
void setWindowOpacity (qreal level)
void setWindowRole (const QString &)
void setWindowState (Qt::WindowStates state)
void setWindowTitle (const QString &)
void showChild (QWidget *child, bool yes=true)
void showColumn (int col)
bool showGrid () const
bool signalsBlocked () const
QSize size () const
QSize sizeHint () const
QSize sizeIncrement () const
QSizePolicy sizePolicy () const
QStringList sort () const
void sortColumn (int col, bool ascending=true, bool wholeRows=false)
bool sorting () const
Q3SqlCursorsqlCursor () const
void stackUnder (QWidget *)
int startTimer (int interval)
QString statusTip () const
QStylestyle () const
void styleChange (QStyle &)
bool testAttribute (Qt::WidgetAttribute) const
QString text (int row, int col) const
QThreadthread () const
QString toolTip () const
QWidgettopLevelWidget () const
int topMargin () const
QString trueText () const
bool underMouse () const
void unsetCursor ()
void unsetLayoutDirection ()
void update (const QRegion &)
void update (const QRect &)
void update (int x, int y, int w, int h)
void updateCell (int row, int col)
void updateContents ()
void updateContents (const QRect &r)
void updateContents (int x, int y, int w, int h)
void updateGeometry ()
void updateHeaderStates ()
bool updatesEnabled () const
QObjectUserData * userData (uint id) const
QVariant value (int row, int col) const
Q3HeaderverticalHeader () const
QScrollBarverticalScrollBar () const
QWidgetviewport () const
QSize viewportSize (int, int) const
QPoint viewportToContents (const QPoint &) const
void viewportToContents (int vx, int vy, int &x, int &y) const
int visibleHeight () const
QRegion visibleRegion () const
int visibleWidth () const
ScrollBarMode vScrollBarMode () const
QString whatsThis () const
int width () const
int widthMM () const
QWidgetwindow () const
Qt::WindowFlags windowFlags () const
QIcon windowIcon () const
QString windowIconText () const
Qt::WindowModality windowModality () const
qreal windowOpacity () const
QString windowRole () const
Qt::WindowStates windowState () const
QString windowTitle () const
Qt::WindowType windowType () const
WId winId () const
int x () const
int y () const
 ~Q3DataTable ()

Static Public Member Functions

static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
static QWidgetfind (WId)
static QWidgetkeyboardGrabber ()
static QWidgetmouseGrabber ()
static uint registerUserData ()
static void setTabOrder (QWidget *, QWidget *)

Protected Types

enum  EditMode { NotEditing, Editing, Replacing }

Protected Slots

virtual void columnIndexChanged (int section, int fromIndex, int toIndex)
virtual void columnWidthChanged (int col)
virtual void rowHeightChanged (int row)
virtual void rowIndexChanged (int section, int fromIndex, int toIndex)

Protected Member Functions

virtual void actionEvent (QActionEvent *)
void activateNextCell ()
virtual bool beginInsert ()
virtual QWidgetbeginUpdate (int row, int col, bool replace)
QSize cachedSizeHint () const
void changeEvent (QEvent *)
virtual void childEvent (QChildEvent *)
void clearCell (int row, int col)
virtual void closeEvent (QCloseEvent *)
void columnClicked (int col)
virtual QSql::Confirm confirmCancel (QSql::Op m)
virtual QSql::Confirm confirmEdit (QSql::Op m)
virtual void connectNotify (const char *signal)
void contentsContextMenuEvent (QContextMenuEvent *e)
virtual void contentsDragEnterEvent (QDragEnterEvent *e)
virtual void contentsDragLeaveEvent (QDragLeaveEvent *e)
virtual void contentsDragMoveEvent (QDragMoveEvent *e)
virtual void contentsDropEvent (QDropEvent *e)
void contentsMouseDoubleClickEvent (QMouseEvent *)
void contentsMouseMoveEvent (QMouseEvent *)
void contentsMousePressEvent (QMouseEvent *e)
void contentsMouseReleaseEvent (QMouseEvent *)
virtual void contentsWheelEvent (QWheelEvent *)
void contextMenuEvent (QContextMenuEvent *)
void create (WId=0, bool initializeWindow=true, bool destroyOldWindow=true)
QWidgetcreateEditor (int row, int col, bool initFromCell) const
int currEditCol () const
int currEditRow () const
virtual void customEvent (QEvent *)
virtual bool deleteCurrent ()
void destroy (bool destroyWindow=true, bool destroySubWindows=true)
virtual void disconnectNotify (const char *signal)
virtual void dragEnterEvent (QDragEnterEvent *)
virtual void dragLeaveEvent (QDragLeaveEvent *)
virtual void dragMoveEvent (QDragMoveEvent *)
virtual Q3DragObjectdragObject ()
void drawContents (QPainter *p, int cx, int cy, int cw, int ch)
virtual void drawContentsOffset (QPainter *, int ox, int oy, int cx, int cy, int cw, int ch)
virtual void drawFrame (QPainter *)
virtual void dropEvent (QDropEvent *)
EditMode editMode () const
virtual void enabledChange (bool)
void endEdit (int row, int col, bool accept, bool replace)
virtual void enterEvent (QEvent *)
bool event (QEvent *e)
bool eventFilter (QObject *o, QEvent *e)
virtual int fieldAlignment (const QSqlField *field)
void focusInEvent (QFocusEvent *)
bool focusNextChild ()
bool focusNextPrevChild (bool next)
void focusOutEvent (QFocusEvent *)
bool focusPreviousChild ()
void fontChange (const QFont &)
void frameChanged ()
virtual void handleError (const QSqlError &e)
virtual void hideEvent (QHideEvent *)
int indexOf (int row, int col) const
virtual void inputMethodEvent (QInputMethodEvent *)
virtual bool insertCurrent ()
virtual void insertWidget (int row, int col, QWidget *w)
bool isEditing () const
Q3TableItemitem (int row, int col) const
void keyPressEvent (QKeyEvent *)
virtual void keyReleaseEvent (QKeyEvent *)
virtual void languageChange ()
virtual void leaveEvent (QEvent *)
int metric (PaintDeviceMetric) const
void mouseDoubleClickEvent (QMouseEvent *)
void mouseMoveEvent (QMouseEvent *)
void mousePressEvent (QMouseEvent *)
void mouseReleaseEvent (QMouseEvent *)
virtual void moveEvent (QMoveEvent *)
void paintCell (QPainter *p, int row, int col, const QRect &cr, bool selected, const QColorGroup &cg)
virtual void paintEmptyArea (QPainter *p, int cx, int cy, int cw, int ch)
void paintEvent (QPaintEvent *e)
virtual void paintField (QPainter *p, const QSqlField *field, const QRect &cr, bool selected)
virtual void paletteChange (const QPalette &)
int receivers (const char *signal) const
void repaintCell (int row, int col)
void reset ()
void resetInputContext ()
void resizeData (int len)
void resizeEvent (QResizeEvent *)
QObjectsender () const
void setCachedSizeHint (const QSize &sh) const
virtual void setCellContentFromEditor (int row, int col)
void setEditMode (EditMode mode, int row, int col)
virtual void setHBarGeometry (QScrollBar &hbar, int x, int y, int w, int h)
void setItem (int row, int col, Q3TableItem *item)
void setPixmap (int row, int col, const QPixmap &pix)
void setSize (Q3SqlCursor *sql)
virtual void setVBarGeometry (QScrollBar &vbar, int x, int y, int w, int h)
void showEvent (QShowEvent *e)
virtual void startDrag ()
virtual void tabletEvent (QTabletEvent *)
void takeItem (Q3TableItem *i)
virtual void timerEvent (QTimerEvent *)
virtual bool updateCurrent ()
void updateMicroFocus ()
virtual void viewportContextMenuEvent (QContextMenuEvent *)
virtual void viewportDragEnterEvent (QDragEnterEvent *)
virtual void viewportDragLeaveEvent (QDragLeaveEvent *)
virtual void viewportDragMoveEvent (QDragMoveEvent *)
virtual void viewportDropEvent (QDropEvent *)
virtual void viewportMouseDoubleClickEvent (QMouseEvent *)
virtual void viewportMouseMoveEvent (QMouseEvent *)
virtual void viewportMousePressEvent (QMouseEvent *)
virtual void viewportMouseReleaseEvent (QMouseEvent *)
virtual void viewportPaintEvent (QPaintEvent *)
void viewportResizeEvent (QResizeEvent *)
virtual void viewportWheelEvent (QWheelEvent *)
void wheelEvent (QWheelEvent *)
void windowActivationChange (bool)

Protected Attributes

QObjectData * d_ptr
ushort painters

Static Protected Attributes

static const QMetaObject staticQtMetaObject

Properties

bool acceptDrops
 whether drop events are enabled for this widget
QString accessibleDescription
 the widget's description as seen by assistive technologies
QString accessibleName
 the widget's name as seen by assistive technologies
bool autoEdit
 whether the data table automatically applies edits
bool autoFillBackground
 whether the widget background is filled automatically
QSize baseSize
 the base size of the widget
QRect childrenRect
 the bounding rectangle of the widget's children
QRegion childrenRegion
 the combined region occupied by the widget's children
bool columnMovingEnabled
 whether columns can be moved by the user
bool confirmCancels
 whether the data table confirms cancel operations
bool confirmDelete
 whether the data table confirms delete operations
bool confirmEdits
 whether the data table confirms edit operations
bool confirmInsert
 whether the data table confirms insert operations
bool confirmUpdate
 whether the data table confirms update operations
int contentsHeight
 the height of the contents area
QRect contentsRect
 the frame's contents rectangle (including the margins)
int contentsWidth
 the width of the contents area
int contentsX
 the X coordinate of the contents that are at the left edge of the viewport.
int contentsY
 the Y coordinate of the contents that are at the top edge of the viewport.
Qt::ContextMenuPolicy contextMenuPolicy
 how the widget shows a context menu
QCursor cursor
 the cursor shape for this widget
Qt::DateFormat dateFormat
 the format used for displaying date/time values
bool dragAutoScroll
 whether autoscrolling in drag move events is enabled
bool enabled
 whether the widget is enabled
QString falseText
 the text used to represent false values
QString filter
 the data filter for the data table
bool focus
 whether this widget (or its focus proxy) has the keyboard input focus
Qt::FocusPolicy focusPolicy
 the way the widget accepts keyboard focus
FocusStyle focusStyle
 how the current (focus) cell is drawn
QFont font
 the font currently set for the widget
QRect frameGeometry
 geometry of the widget relative to its parent including any window frame
QRect frameRect
 the frame's rectangle
Shadow frameShadow
 the frame shadow value from the frame style
Shape frameShape
 the frame shape value from the frame style
QSize frameSize
 the size of the widget including any window frame
int frameWidth
 the width of the frame that is drawn.
bool fullScreen
 whether the widget is full screen
QRect geometry
 the geometry of the widget relative to its parent and excluding the window frame
int height
 the height of the widget excluding any window frame
ScrollBarMode hScrollBarMode
 the mode for the horizontal scroll bar
bool isActiveWindow
 whether this widget's window is the active window
Qt::LayoutDirection layoutDirection
 the layout direction for this widget
int lineWidth
 the line width
int margin
 the width of the margin
bool maximized
 whether this widget is maximized
int maximumHeight
 the widget's maximum height
QSize maximumSize
 the widget's maximum size
int maximumWidth
 the widget's maximum width
int midLineWidth
 the width of the mid-line
bool minimized
 whether this widget is minimized (iconified)
int minimumHeight
 the widget's minimum height
QSize minimumSize
 the widget's minimum size
QSize minimumSizeHint
 the recommended minimum size for the widget
int minimumWidth
 the widget's minimum width
bool modal
 whether the widget is a modal widget
bool mouseTracking
 whether mouse tracking is enabled for the widget
QRect normalGeometry
 the geometry a toplevel widget has when it is not maximized or fullscreen
QString nullText
 the text used to represent NULL values
int numCols
 the number of columns in the table
int numRows
 the number of rows in the table
int numSelections
 The number of selections.
QString objectName
 the name of this object
QPalette palette
 the widget's palette
QPoint pos
 the position of the widget within its parent widget
bool readOnly
 whether the table is read-only
QRect rect
 the internal geometry of the widget excluding any window frame
ResizePolicy resizePolicy
 the resize policy
bool rowMovingEnabled
 whether rows can be moved by the user
SelectionMode selectionMode
 the current selection mode
bool showGrid
 whether the table's grid is displayed
QSize size
 the size of the widget excluding any window frame
QSize sizeHint
 the recommended size for the widget
QSize sizeIncrement
 the size increment of the widget
QSizePolicy sizePolicy
 the default layout behavior of the widget
QStringList sort
 the data table's sort
bool sorting
 whether a click on the header of a column sorts that column
QString statusTip
 the widget's status tip
QString toolTip
 the widget's tooltip
QString trueText
 the text used to represent true values
bool updatesEnabled
 whether updates are enabled
bool visible
 whether the widget is visible
int visibleHeight
 the vertical amount of the content that is visible
int visibleWidth
 the horizontal amount of the content that is visible
ScrollBarMode vScrollBarMode
 the mode for the vertical scroll bar
QString whatsThis
 the widget's What's This help text.
int width
 the width of the widget excluding any window frame
QIcon windowIcon
 the widget's icon
QString windowIconText
 the widget's icon text
Qt::WindowModality windowModality
 which windows are blocked by the modal widget
bool windowModified
 whether the document shown in the window has unsaved changes
double windowOpacity
 The level of opacity for the window.
QString windowTitle
 the window title (caption)
int x
 the x coordinate of the widget relative to its parent including any window frame
int y
 the y coordinate of the widget relative to its parent and including any window frame

Private Slots

void doInsertCurrent ()
void doUpdateCurrent ()
void loadNextPage ()
void setCurrentSelection (int row, int col)
void sliderPressed ()
void sliderReleased ()
void updateCurrentSelection ()

Private Member Functions

QWidgetbeginEdit (int row, int col, bool replace)
void drawContents (QPainter *p)
void endInsert ()
void endUpdate ()
QString fieldToString (const QSqlField *field)
void init ()
void updateRow (int row)

Private Attributes

Q3DataTablePrivate * d

Friends

class Q3CheckTableItem
class Q3ComboTableItem
class Q3TableHeader
class Q3TableItem
class QCoreApplication
class QCoreApplicationPrivate
struct QMetaObject
class QThreadData
class QWidget

Related Functions

(Note that these are not member functions.)

qFindChild (const QObject *obj, const QString &name)
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
QList< T > qFindChildren (const QObject *obj, const QString &name)
T * qobject_cast (QObject *object)
 QObjectList
void * qt_find_obj_child (QObject *parent, const char *type, const QString &name)
const Q_GUI_EXPORT QX11Infoqt_x11Info (const QPaintDevice *pd)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index