Eneboo - Documentación para desarrolladores
Clases | Tipos públicos | Slots públicos | Señales | Métodos públicos | Tipos protegidos | Slots protegidos | Métodos protegidos | Propiedades | Amigas
Referencia de la Clase QTable

The QTable class provides a flexible editable table widget.table. Más...

#include <qtable.h>

Diagrama de herencias de QTable
QScrollView QScrollView QFrame QFrame QFrame QFrame QWidget QWidget QWidget QWidget QWidget QWidget QWidget QWidget ConnectionTable FLTable QDataTable QDataTable FLDataTable FLDataTable AQDataTableDB AQDataTableDB

Lista de todos los miembros.

Clases

struct  TableWidget

Tipos públicos

enum  SelectionMode {
  Single, Multi, SingleRow, MultiRow,
  NoSelection, Single, Multi, SingleRow,
  MultiRow, NoSelection
}
enum  FocusStyle { FollowStyle, SpreadSheet, FollowStyle, SpreadSheet }
enum  SelectionMode {
  Single, Multi, SingleRow, MultiRow,
  NoSelection, Single, Multi, SingleRow,
  MultiRow, NoSelection
}
enum  FocusStyle { FollowStyle, SpreadSheet, FollowStyle, SpreadSheet }

Slots públicos

virtual void setNumRows (int r)
virtual void setNumCols (int r)
virtual void setShowGrid (bool b)
virtual void hideRow (int row)
virtual void hideColumn (int col)
virtual void showRow (int row)
virtual void showColumn (int col)
bool isRowHidden (int row) const
bool isColumnHidden (int col) const
virtual void setColumnWidth (int col, int w)
virtual void setRowHeight (int row, int h)
virtual void adjustColumn (int col)
virtual void adjustRow (int row)
virtual void setColumnStretchable (int col, bool stretch)
virtual void setRowStretchable (int row, bool stretch)
bool isColumnStretchable (int col) const
bool isRowStretchable (int row) const
virtual void setSorting (bool b)
virtual void swapRows (int row1, int row2, bool swapHeader=FALSE)
virtual void swapColumns (int col1, int col2, bool swapHeader=FALSE)
virtual void swapCells (int row1, int col1, int row2, int col2)
virtual void setLeftMargin (int m)
virtual void setTopMargin (int m)
virtual void setCurrentCell (int row, int col)
void clearSelection (bool repaint=TRUE)
virtual void setColumnMovingEnabled (bool b)
virtual void setRowMovingEnabled (bool b)
virtual void setReadOnly (bool b)
virtual void setRowReadOnly (int row, bool ro)
virtual void setColumnReadOnly (int col, bool ro)
virtual void setDragEnabled (bool b)
bool dragEnabled () const
virtual void insertRows (int row, int count=1)
virtual void insertColumns (int col, int count=1)
virtual void removeRow (int row)
virtual void removeRows (const QMemArray< int > &rows)
virtual void removeColumn (int col)
virtual void removeColumns (const QMemArray< int > &cols)
virtual void editCell (int row, int col, bool replace=FALSE)
void setRowLabels (const QStringList &labels)
void setColumnLabels (const QStringList &labels)
virtual void setNumRows (int r)
virtual void setNumCols (int r)
virtual void setShowGrid (bool b)
virtual void hideRow (int row)
virtual void hideColumn (int col)
virtual void showRow (int row)
virtual void showColumn (int col)
bool isRowHidden (int row) const
bool isColumnHidden (int col) const
virtual void setColumnWidth (int col, int w)
virtual void setRowHeight (int row, int h)
virtual void adjustColumn (int col)
virtual void adjustRow (int row)
virtual void setColumnStretchable (int col, bool stretch)
virtual void setRowStretchable (int row, bool stretch)
bool isColumnStretchable (int col) const
bool isRowStretchable (int row) const
virtual void setSorting (bool b)
virtual void swapRows (int row1, int row2, bool swapHeader=FALSE)
virtual void swapColumns (int col1, int col2, bool swapHeader=FALSE)
virtual void swapCells (int row1, int col1, int row2, int col2)
virtual void setLeftMargin (int m)
virtual void setTopMargin (int m)
virtual void setCurrentCell (int row, int col)
void clearSelection (bool repaint=TRUE)
virtual void setColumnMovingEnabled (bool b)
virtual void setRowMovingEnabled (bool b)
virtual void setReadOnly (bool b)
virtual void setRowReadOnly (int row, bool ro)
virtual void setColumnReadOnly (int col, bool ro)
virtual void setDragEnabled (bool b)
bool dragEnabled () const
virtual void insertRows (int row, int count=1)
virtual void insertColumns (int col, int count=1)
virtual void removeRow (int row)
virtual void removeRows (const QMemArray< int > &rows)
virtual void removeColumn (int col)
virtual void removeColumns (const QMemArray< int > &cols)
virtual void editCell (int row, int col, bool replace=FALSE)
void setRowLabels (const QStringList &labels)
void setColumnLabels (const QStringList &labels)

Señales

void currentChanged (int row, int col)
void clicked (int row, int col, int button, const QPoint &mousePos)
void doubleClicked (int row, int col, int button, const QPoint &mousePos)
void pressed (int row, int col, int button, const QPoint &mousePos)
void selectionChanged ()
void valueChanged (int row, int col)
void contextMenuRequested (int row, int col, const QPoint &pos)
void dropped (QDropEvent *e)
void currentChanged (int row, int col)
void clicked (int row, int col, int button, const QPoint &mousePos)
void doubleClicked (int row, int col, int button, const QPoint &mousePos)
void pressed (int row, int col, int button, const QPoint &mousePos)
void selectionChanged ()
void valueChanged (int row, int col)
void contextMenuRequested (int row, int col, const QPoint &pos)
void dropped (QDropEvent *e)

Métodos públicos

 QTable (QWidget *parent=0, const char *name=0)
 QTable (int numRows, int numCols, QWidget *parent=0, const char *name=0)
 ~QTable ()
QHeaderhorizontalHeader () const
QHeaderverticalHeader () const
virtual void setSelectionMode (SelectionMode mode)
SelectionMode selectionMode () const
virtual void setItem (int row, int col, QTableItem *item)
virtual void setText (int row, int col, const QString &text)
virtual void setPixmap (int row, int col, const QPixmap &pix)
virtual QTableItemitem (int row, int col) const
virtual QString text (int row, int col) const
virtual QPixmap pixmap (int row, int col) const
virtual void clearCell (int row, int col)
virtual QRect cellGeometry (int row, int col) const
virtual int columnWidth (int col) const
virtual int rowHeight (int row) const
virtual int columnPos (int col) const
virtual int rowPos (int row) const
virtual int columnAt (int x) const
virtual int rowAt (int y) const
virtual int numRows () const
virtual int numCols () const
void updateCell (int row, int col)
bool eventFilter (QObject *o, QEvent *)
int currentRow () const
int currentColumn () const
void ensureCellVisible (int row, int col)
bool isSelected (int row, int col) const
bool isRowSelected (int row, bool full=FALSE) const
bool isColumnSelected (int col, bool full=FALSE) const
int numSelections () const
QTableSelection selection (int num) const
virtual int addSelection (const QTableSelection &s)
virtual void removeSelection (const QTableSelection &s)
virtual void removeSelection (int num)
virtual int currentSelection () const
void selectCells (int start_row, int start_col, int end_row, int end_col)
void selectRow (int row)
void selectColumn (int col)
bool showGrid () const
bool columnMovingEnabled () const
bool rowMovingEnabled () const
virtual void sortColumn (int col, bool ascending=TRUE, bool wholeRows=FALSE)
bool sorting () const
virtual void takeItem (QTableItem *i)
virtual void setCellWidget (int row, int col, QWidget *e)
virtual QWidgetcellWidget (int row, int col) const
virtual void clearCellWidget (int row, int col)
virtual QRect cellRect (int row, int col) const
virtual void paintCell (QPainter *p, int row, int col, const QRect &cr, bool selected)
virtual void paintCell (QPainter *p, int row, int col, const QRect &cr, bool selected, const QColorGroup &cg)
virtual void paintFocus (QPainter *p, const QRect &r)
QSize sizeHint () const
bool isReadOnly () const
bool isRowReadOnly (int row) const
bool isColumnReadOnly (int col) const
void setEnabled (bool b)
void repaintSelections ()
virtual void setFocusStyle (FocusStyle fs)
FocusStyle focusStyle () const
void updateHeaderStates ()
 QTable (QWidget *parent=0, const char *name=0)
 QTable (int numRows, int numCols, QWidget *parent=0, const char *name=0)
 ~QTable ()
QHeaderhorizontalHeader () const
QHeaderverticalHeader () const
virtual void setSelectionMode (SelectionMode mode)
SelectionMode selectionMode () const
virtual void setItem (int row, int col, QTableItem *item)
virtual void setText (int row, int col, const QString &text)
virtual void setPixmap (int row, int col, const QPixmap &pix)
virtual QTableItemitem (int row, int col) const
virtual QString text (int row, int col) const
virtual QPixmap pixmap (int row, int col) const
virtual void clearCell (int row, int col)
virtual QRect cellGeometry (int row, int col) const
virtual int columnWidth (int col) const
virtual int rowHeight (int row) const
virtual int columnPos (int col) const
virtual int rowPos (int row) const
virtual int columnAt (int x) const
virtual int rowAt (int y) const
virtual int numRows () const
virtual int numCols () const
void updateCell (int row, int col)
bool eventFilter (QObject *o, QEvent *)
int currentRow () const
int currentColumn () const
void ensureCellVisible (int row, int col)
bool isSelected (int row, int col) const
bool isRowSelected (int row, bool full=FALSE) const
bool isColumnSelected (int col, bool full=FALSE) const
int numSelections () const
QTableSelection selection (int num) const
virtual int addSelection (const QTableSelection &s)
virtual void removeSelection (const QTableSelection &s)
virtual void removeSelection (int num)
virtual int currentSelection () const
void selectCells (int start_row, int start_col, int end_row, int end_col)
void selectRow (int row)
void selectColumn (int col)
bool showGrid () const
bool columnMovingEnabled () const
bool rowMovingEnabled () const
virtual void sortColumn (int col, bool ascending=TRUE, bool wholeRows=FALSE)
bool sorting () const
virtual void takeItem (QTableItem *i)
virtual void setCellWidget (int row, int col, QWidget *e)
virtual QWidgetcellWidget (int row, int col) const
virtual void clearCellWidget (int row, int col)
virtual QRect cellRect (int row, int col) const
virtual void paintCell (QPainter *p, int row, int col, const QRect &cr, bool selected)
virtual void paintCell (QPainter *p, int row, int col, const QRect &cr, bool selected, const QColorGroup &cg)
virtual void paintFocus (QPainter *p, const QRect &r)
QSize sizeHint () const
bool isReadOnly () const
bool isRowReadOnly (int row) const
bool isColumnReadOnly (int col) const
void setEnabled (bool b)
void repaintSelections ()
virtual void setFocusStyle (FocusStyle fs)
FocusStyle focusStyle () const
void updateHeaderStates ()

Tipos protegidos

enum  EditMode {
  NotEditing, Editing, Replacing, NotEditing,
  Editing, Replacing
}
enum  EditMode {
  NotEditing, Editing, Replacing, NotEditing,
  Editing, Replacing
}

Slots protegidos

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

Métodos protegidos

void drawContents (QPainter *p, int cx, int cy, int cw, int ch)
void contentsMousePressEvent (QMouseEvent *)
void contentsMouseMoveEvent (QMouseEvent *)
void contentsMouseDoubleClickEvent (QMouseEvent *)
void contentsMouseReleaseEvent (QMouseEvent *)
void contentsContextMenuEvent (QContextMenuEvent *e)
void keyPressEvent (QKeyEvent *)
void focusInEvent (QFocusEvent *)
void focusOutEvent (QFocusEvent *)
void viewportResizeEvent (QResizeEvent *)
void showEvent (QShowEvent *e)
void paintEvent (QPaintEvent *e)
void setEditMode (EditMode mode, int row, int col)
virtual void contentsDragEnterEvent (QDragEnterEvent *e)
virtual void contentsDragMoveEvent (QDragMoveEvent *e)
virtual void contentsDragLeaveEvent (QDragLeaveEvent *e)
virtual void contentsDropEvent (QDropEvent *e)
virtual QDragObjectdragObject ()
virtual void startDrag ()
virtual void paintEmptyArea (QPainter *p, int cx, int cy, int cw, int ch)
virtual void activateNextCell ()
virtual QWidgetcreateEditor (int row, int col, bool initFromCell) const
virtual void setCellContentFromEditor (int row, int col)
virtual QWidgetbeginEdit (int row, int col, bool replace)
virtual void endEdit (int row, int col, bool accept, bool replace)
virtual void resizeData (int len)
virtual void insertWidget (int row, int col, QWidget *w)
int indexOf (int row, int col) const
void windowActivationChange (bool)
bool isEditing () const
EditMode editMode () const
int currEditRow () const
int currEditCol () const
void drawContents (QPainter *p, int cx, int cy, int cw, int ch)
void contentsMousePressEvent (QMouseEvent *)
void contentsMouseMoveEvent (QMouseEvent *)
void contentsMouseDoubleClickEvent (QMouseEvent *)
void contentsMouseReleaseEvent (QMouseEvent *)
void contentsContextMenuEvent (QContextMenuEvent *e)
void keyPressEvent (QKeyEvent *)
void focusInEvent (QFocusEvent *)
void focusOutEvent (QFocusEvent *)
void viewportResizeEvent (QResizeEvent *)
void showEvent (QShowEvent *e)
void paintEvent (QPaintEvent *e)
void setEditMode (EditMode mode, int row, int col)
virtual void contentsDragEnterEvent (QDragEnterEvent *e)
virtual void contentsDragMoveEvent (QDragMoveEvent *e)
virtual void contentsDragLeaveEvent (QDragLeaveEvent *e)
virtual void contentsDropEvent (QDropEvent *e)
virtual QDragObjectdragObject ()
virtual void startDrag ()
virtual void paintEmptyArea (QPainter *p, int cx, int cy, int cw, int ch)
virtual void activateNextCell ()
virtual QWidgetcreateEditor (int row, int col, bool initFromCell) const
virtual void setCellContentFromEditor (int row, int col)
virtual QWidgetbeginEdit (int row, int col, bool replace)
virtual void endEdit (int row, int col, bool accept, bool replace)
virtual void resizeData (int len)
virtual void insertWidget (int row, int col, QWidget *w)
int indexOf (int row, int col) const
void windowActivationChange (bool)
bool isEditing () const
EditMode editMode () const
int currEditRow () const
int currEditCol () const

Propiedades

int numRows
 The number of rows in the table.
int numCols
 The number of columns in the table.
bool showGrid
 whether the table's grid is displayed
bool rowMovingEnabled
 whether rows can be moved by the user
bool columnMovingEnabled
 whether columns can be moved by the user
bool readOnly
 whether the table is read-only
bool sorting
 whether a click on the header of a column sorts that column
SelectionMode selectionMode
 the current selection mode
FocusStyle focusStyle
 how the current (focus) cell is drawn
int numSelections
 The number of selections.

Amigas

class QTableHeader
class QComboTableItem
class QCheckTableItem
class QTableItem

Descripción detallada

The QTable class provides a flexible editable table widget.

table.

QTable is easy to use, although it does have a large API because of the comprehensive functionality that it provides. QTable includes functions for manipulating headers, rows and columns, cells and selections. QTable also provides in-place editing and drag and drop, as well as a useful set of signals. QTable efficiently supports very large tables, for example, tables one million by one million cells are perfectly possible. QTable is economical with memory, using none for unused cells.

    QTable *table = new QTable( 100, 250, this );
    table->setPixmap( 3, 2, pix );
    table->setText( 3, 2, "A pixmap" );

The first line constructs the table specifying its size in rows and columns. We then insert a pixmap and some text into the same cell, with the pixmap appearing to the left of the text. QTable cells can be populated with {QTableItem}s, {QComboTableItem}s or by {QCheckTableItem}s. By default a vertical header appears at the left of the table showing row numbers and a horizontal header appears at the top of the table showing column numbers. (The numbers displayed start at 1, although row and column numbers within QTable begin at 0.)

If you want to use mouse tracking call setMouseTracking( TRUE ) on the viewport; (see QScrollView).

qtableitems.png Table Items

headers


Documentación de las enumeraciones miembro de la clase

enum QTable::EditMode [protected]

NotEditing No cell is currently being edited.

Editing A cell is currently being edited. The editor was initialised with the cell's contents.

Replacing A cell is currently being edited. The editor was not initialised with the cell's contents.

Valores de enumeraciones:
NotEditing 
Editing 
Replacing 
NotEditing 
Editing 
Replacing 
enum QTable::EditMode [protected]
Valores de enumeraciones:
NotEditing 
Editing 
Replacing 
NotEditing 
Editing 
Replacing 
Valores de enumeraciones:
FollowStyle 
SpreadSheet 
FollowStyle 
SpreadSheet 

Specifies how the current cell (focus cell) is drawn.

FollowStyle The current cell is drawn according to the current style and the cell's background is also drawn selected, if the current cell is within a selection

SpreadSheet The current cell is drawn as in a spreadsheet. This means, it is signified by a black rectangle around the cell, and the background of the current cell is always drawn with the widget's base color - even when selected.

Valores de enumeraciones:
FollowStyle 
SpreadSheet 
FollowStyle 
SpreadSheet 
Valores de enumeraciones:
Single 
Multi 
SingleRow 
MultiRow 
NoSelection 
Single 
Multi 
SingleRow 
MultiRow 
NoSelection 

NoSelection No cell can be selected by the user.

Single The user may only select a single range of cells.

Multi The user may select multiple ranges of cells.

SingleRow The user may select one row at once.

MultiRow The user may select multiple rows.

Valores de enumeraciones:
Single 
Multi 
SingleRow 
MultiRow 
NoSelection 
Single 
Multi 
SingleRow 
MultiRow 
NoSelection 

Documentación del constructor y destructor

QTable::QTable ( QWidget parent = 0,
const char *  name = 0 
)

Creates an empty table object called name as a child of parent.

Call setNumRows() and setNumCols() to set the table size before populating the table if you're using QTableItems.

Ver también:
QWidget::clearWFlags() Qt::WidgetFlags
QTable::QTable ( int  numRows,
int  numCols,
QWidget parent = 0,
const char *  name = 0 
)

Constructs an empty table called name with numRows rows and numCols columns. The table is a child of parent.

If you're using {QTableItem}s to populate the table's cells, you can create QTableItem, QComboTableItem and QCheckTableItem items and insert them into the table using setItem(). (See the notes on large tables for an alternative to using QTableItems.)

Ver también:
QWidget::clearWFlags() Qt::WidgetFlags
QTable::~QTable ( )

Releases all the resources used by the QTable object, including all {QTableItem}s and their widgets.

QTable::QTable ( QWidget parent = 0,
const char *  name = 0 
)
QTable::QTable ( int  numRows,
int  numCols,
QWidget parent = 0,
const char *  name = 0 
)
QTable::~QTable ( )

Documentación de las funciones miembro

void QTable::activateNextCell ( ) [protected, virtual]

This function is called to activate the next cell if in-place editing was finished by pressing the Enter key.

The default behaviour is to move from top to bottom, i.e. move to the cell beneath the cell being edited. Reimplement this function if you want different behaviour, e.g. moving from left to right.

Reimplementado en QDataTable y QDataTable.

virtual void QTable::activateNextCell ( ) [protected, virtual]

Reimplementado en QDataTable y QDataTable.

virtual int QTable::addSelection ( const QTableSelection s) [virtual]
int QTable::addSelection ( const QTableSelection s) [virtual]

Adds a selection described by s to the table and returns its number or -1 if the selection is invalid.

Remember to call QTableSelection::init() and QTableSelection::expandTo() to make the selection valid (see also QTableSelection::isActive(), or use the QTableSelection(int,int,int,int) constructor).

Ver también:
numSelections() removeSelection() clearSelection()
void QTable::adjustColumn ( int  col) [virtual, slot]

Resizes column col so that the column width is wide enough to display the widest item the column contains.

Ver también:
adjustRow()

Reimplementado en QDataTable y QDataTable.

virtual void QTable::adjustColumn ( int  col) [virtual, slot]

Reimplementado en QDataTable y QDataTable.

void QTable::adjustRow ( int  row) [virtual, slot]

Resizes row row so that the row height is tall enough to display the tallest item the row contains.

Ver también:
adjustColumn()
virtual void QTable::adjustRow ( int  row) [virtual, slot]
virtual QWidget* QTable::beginEdit ( int  row,
int  col,
bool  replace 
) [protected, virtual]
QWidget * QTable::beginEdit ( int  row,
int  col,
bool  replace 
) [protected, virtual]

This function is called to start in-place editing of the cell at row, col. Editing is achieved by creating an editor (createEditor() is called) and setting the cell's editor with setCellWidget() to the newly created editor. (After editing is complete endEdit() will be called to replace the cell's content with the editor's content.) If replace is TRUE the editor will start empty; otherwise it will be initialized with the cell's content (if any), i.e. the user will be modifying the original cell content.

Ver también:
endEdit()
virtual QRect QTable::cellGeometry ( int  row,
int  col 
) const [virtual]
QRect QTable::cellGeometry ( int  row,
int  col 
) const [virtual]

Returns the bounding rectangle of the cell at row, col in content coordinates.

QRect QTable::cellRect ( int  row,
int  col 
) const [virtual]

Returns the geometry of cell row, col in the cell's coordinate system. This is a convenience function useful in paintCell(). It is equivalent to QRect( QPoint(0,0), cellGeometry( row, col).size() );

Ver también:
cellGeometry()
virtual QRect QTable::cellRect ( int  row,
int  col 
) const [virtual]
QWidget * QTable::cellWidget ( int  row,
int  col 
) const [virtual]

Returns the widget that has been set for the cell at row, col, or 0 if no widget has been set.

If you don't use {QTableItem}s you may need to reimplement this function: see the notes on large tables.

Ver también:
clearCellWidget() setCellWidget()
virtual QWidget* QTable::cellWidget ( int  row,
int  col 
) const [virtual]
virtual void QTable::clearCell ( int  row,
int  col 
) [virtual]

Reimplementado en QDataTable y QDataTable.

void QTable::clearCell ( int  row,
int  col 
) [virtual]

Removes the QTableItem at row, col.

If you don't use {QTableItem}s you may need to reimplement this function: see the notes on large tables.

Reimplementado en QDataTable y QDataTable.

void QTable::clearCellWidget ( int  row,
int  col 
) [virtual]

Removes the widget (if there is one) set for the cell at row, col.

If you don't use {QTableItem}s you may need to reimplement this function: see the notes on large tables.

This function deletes the widget at row, col. Note that the widget is not deleted immediately; instead QObject::deleteLater() is called on the widget to avoid problems with timing issues.

Ver también:
cellWidget() setCellWidget()
virtual void QTable::clearCellWidget ( int  row,
int  col 
) [virtual]
void QTable::clearSelection ( bool  repaint = TRUE) [slot]

Clears all selections and repaints the appropriate regions if repaint is TRUE.

Ver también:
removeSelection()
void QTable::clearSelection ( bool  repaint = TRUE) [slot]
void QTable::clicked ( int  row,
int  col,
int  button,
const QPoint mousePos 
) [signal]

This signal is emitted when mouse button button is clicked. The cell where the event took place is at row, col, and the mouse's position is in mousePos.

Ver también:
Qt::ButtonState
void QTable::clicked ( int  row,
int  col,
int  button,
const QPoint mousePos 
) [signal]
virtual int QTable::columnAt ( int  x) const [virtual]
int QTable::columnAt ( int  x) const [virtual]

Returns the number of the column at position x. x must be given in content coordinates.

Ver también:
columnPos() rowAt()
void QTable::columnClicked ( int  col) [protected, virtual, slot]

This function is called when the column col has been clicked. The default implementation sorts this column if sorting() is TRUE.

Reimplementado en QDataTable y QDataTable.

virtual void QTable::columnClicked ( int  col) [protected, virtual, slot]

Reimplementado en QDataTable y QDataTable.

virtual void QTable::columnIndexChanged ( int  section,
int  fromIndex,
int  toIndex 
) [protected, virtual, slot]
void QTable::columnIndexChanged ( int  section,
int  fromIndex,
int  toIndex 
) [protected, virtual, slot]

This function is called when column order is to be changed, i.e. when the user moved the column header section from fromIndex to toIndex.

If you want to change the column order programmatically, call swapRows() or swapColumns();

Ver también:
QHeader::indexChange() rowIndexChanged()
bool QTable::columnMovingEnabled ( ) const
bool QTable::columnMovingEnabled ( ) const
virtual int QTable::columnPos ( int  col) const [virtual]
int QTable::columnPos ( int  col) const [virtual]

Returns the x-coordinate of the column col in content coordinates.

Ver también:
columnAt() rowPos()
virtual int QTable::columnWidth ( int  col) const [virtual]
int QTable::columnWidth ( int  col) const [virtual]

Returns the width of column col.

Ver también:
setColumnWidth() rowHeight()
void QTable::columnWidthChanged ( int  col) [protected, virtual, slot]

This function should be called whenever the column width of col has been changed. It updates the geometry of any affected columns and repaints the table to reflect the changes it has made.

virtual void QTable::columnWidthChanged ( int  col) [protected, virtual, slot]
void QTable::contentsContextMenuEvent ( QContextMenuEvent e) [protected, virtual]

Reimplementado de QScrollView.

Reimplementado en FLDataTable, QDataTable y QDataTable.

void QTable::contentsContextMenuEvent ( QContextMenuEvent e) [protected, virtual]

This event handler is called whenever the QScrollView receives a contextMenuEvent() in {e}: the mouse position is translated to be a point on the contents.

Reimplementado de QScrollView.

Reimplementado en FLDataTable, QDataTable y QDataTable.

virtual void QTable::contentsDragEnterEvent ( QDragEnterEvent ) [protected, virtual]

This event handler is called whenever the QScrollView receives a dragEnterEvent(): the drag position is translated to be a point on the contents.

Reimplementado de QScrollView.

void QTable::contentsDragEnterEvent ( QDragEnterEvent e) [protected, virtual]

This event handler is called whenever a QTable object receives a QDragEnterEvent e, i.e. when the user pressed the mouse button to drag something.

The focus is moved to the cell where the QDragEnterEvent occurred.

Reimplementado de QScrollView.

virtual void QTable::contentsDragLeaveEvent ( QDragLeaveEvent ) [protected, virtual]

This event handler is called whenever the QScrollView receives a dragLeaveEvent(): the drag position is translated to be a point on the contents.

Reimplementado de QScrollView.

void QTable::contentsDragLeaveEvent ( QDragLeaveEvent e) [protected, virtual]

This event handler is called when a drag activity leaves this QTable object with event e.

Reimplementado de QScrollView.

virtual void QTable::contentsDragMoveEvent ( QDragMoveEvent ) [protected, virtual]

This event handler is called whenever the QScrollView receives a dragMoveEvent(): the drag position is translated to be a point on the contents.

Reimplementado de QScrollView.

void QTable::contentsDragMoveEvent ( QDragMoveEvent e) [protected, virtual]

This event handler is called whenever a QTable object receives a QDragMoveEvent e, i.e. when the user actually drags the mouse.

The focus is moved to the cell where the QDragMoveEvent occurred.

Reimplementado de QScrollView.

virtual void QTable::contentsDropEvent ( QDropEvent ) [protected, virtual]

This event handler is called whenever the QScrollView receives a dropEvent(): the drop position is translated to be a point on the contents.

Reimplementado de QScrollView.

void QTable::contentsDropEvent ( QDropEvent e) [protected, virtual]

This event handler is called when the user ends a drag and drop by dropping something onto this QTable and thus triggers the drop event, e.

Reimplementado de QScrollView.

void QTable::contentsMouseDoubleClickEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QScrollView.

Reimplementado en FLDataTable.

void QTable::contentsMouseDoubleClickEvent ( QMouseEvent e) [protected, virtual]

This event handler is called whenever the QScrollView receives a mouseDoubleClickEvent(): the click position in e is translated to be a point on the contents.

The default implementation generates a normal mouse press event.

Reimplementado de QScrollView.

Reimplementado en FLDataTable.

void QTable::contentsMouseMoveEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QScrollView.

void QTable::contentsMouseMoveEvent ( QMouseEvent e) [protected, virtual]

This event handler is called whenever the QScrollView receives a mouseMoveEvent(): the mouse position in e is translated to be a point on the contents.

Reimplementado de QScrollView.

void QTable::contentsMousePressEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QScrollView.

Reimplementado en QDataTable y QDataTable.

void QTable::contentsMousePressEvent ( QMouseEvent e) [protected, virtual]

This event handler is called whenever the QScrollView receives a mousePressEvent(): the press position in e is translated to be a point on the contents.

Reimplementado de QScrollView.

Reimplementado en QDataTable y QDataTable.

void QTable::contentsMouseReleaseEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QScrollView.

void QTable::contentsMouseReleaseEvent ( QMouseEvent e) [protected, virtual]

This event handler is called whenever the QScrollView receives a mouseReleaseEvent(): the release position in e is translated to be a point on the contents.

Reimplementado de QScrollView.

void QTable::contextMenuRequested ( int  row,
int  col,
const QPoint pos 
) [signal]

This signal is emitted when the user invokes a context menu with the right mouse button (or with a system-specific keypress). The cell where the event took place is at row, col. pos is the position where the context menu will appear in the global coordinate system. This signal is always emitted, even if the contents of the cell are disabled.

void QTable::contextMenuRequested ( int  row,
int  col,
const QPoint pos 
) [signal]
virtual QWidget* QTable::createEditor ( int  row,
int  col,
bool  initFromCell 
) const [protected, virtual]

Reimplementado en QDataTable y QDataTable.

QWidget * QTable::createEditor ( int  row,
int  col,
bool  initFromCell 
) const [protected, virtual]

This function returns the widget which should be used as an editor for the contents of the cell at row, col.

If initFromCell is TRUE, the editor is used to edit the current contents of the cell (so the editor widget should be initialized with this content). If initFromCell is FALSE, the content of the cell is replaced with the new content which the user entered into the widget created by this function.

The default functionality is as follows: if initFromCell is TRUE or the cell has a QTableItem and the table item's QTableItem::isReplaceable() is FALSE then the cell is asked to create an appropriate editor (using QTableItem::createEditor()). Otherwise a QLineEdit is used as the editor.

If you want to create your own editor for certain cells, implement a custom QTableItem subclass and reimplement QTableItem::createEditor().

If you are not using {QTableItem}s and you don't want to use a QLineEdit as the default editor, subclass QTable and reimplement this function with code like this:

    QTableItem *i = item( row, col );
    if ( initFromCell || ( i && !i->isReplaceable() ) )
        // If we had a QTableItem ask the base class to create the editor
        return QTable::createEditor( row, col, initFromCell );
    else
        return ...(create your own editor)

Ownership of the editor widget is transferred to the caller.

If you reimplement this function return 0 for read-only cells. You will need to reimplement setCellContentFromEditor() to retrieve the data the user entered.

Ver también:
QTableItem::createEditor()

Reimplementado en QDataTable y QDataTable.

int QTable::currEditCol ( ) const [protected]

Returns the current edited column

int QTable::currEditCol ( ) const [protected]
int QTable::currEditRow ( ) const [protected]

Returns the current edited row

int QTable::currEditRow ( ) const [protected]
void QTable::currentChanged ( int  row,
int  col 
) [signal]
void QTable::currentChanged ( int  row,
int  col 
) [signal]

This signal is emitted when the current cell has changed to row, col.

int QTable::currentColumn ( ) const [inline]
int QTable::currentColumn ( ) const [inline]

Returns the current column.

Ver también:
currentRow()
int QTable::currentRow ( void  ) const [inline]
int QTable::currentRow ( void  ) const [inline]

Returns the current row.

Ver también:
currentColumn()
int QTable::currentSelection ( ) const [virtual]

Returns the number of the current selection or -1 if there is no current selection.

Ver también:
numSelections()
virtual int QTable::currentSelection ( ) const [virtual]
void QTable::doubleClicked ( int  row,
int  col,
int  button,
const QPoint mousePos 
) [signal]

This signal is emitted when mouse button button is double-clicked. The cell where the event took place is at row, col, and the mouse's position is in mousePos.

Ver también:
Qt::ButtonState
void QTable::doubleClicked ( int  row,
int  col,
int  button,
const QPoint mousePos 
) [signal]
bool QTable::dragEnabled ( ) const [slot]

If this function returns TRUE, the table supports dragging.

Ver también:
setDragEnabled();
bool QTable::dragEnabled ( ) const [slot]
virtual QDragObject* QTable::dragObject ( ) [protected, virtual]
QDragObject * QTable::dragObject ( ) [protected, virtual]

If the user presses the mouse on a selected cell, starts moving (i.e. dragging), and dragEnabled() is TRUE, this function is called to obtain a drag object. A drag using this object begins immediately unless dragObject() returns 0.

By default this function returns 0. You might reimplement it and create a QDragObject depending on the selected items.

Ver también:
dropped()
void QTable::drawContents ( QPainter p,
int  cx,
int  cy,
int  cw,
int  ch 
) [protected, virtual]

Draws the table contents on the painter p. This function is optimized so that it only draws the cells inside the cw pixels wide and ch pixels high clipping rectangle at position cx, cy.

Additionally, drawContents() highlights the current cell.

Reimplementado de QScrollView.

Reimplementado en QDataTable y QDataTable.

void QTable::drawContents ( QPainter p,
int  clipx,
int  clipy,
int  clipw,
int  cliph 
) [protected, virtual]

Reimplement this function if you are viewing a drawing area rather than a widget.

The function should draw the rectangle (clipx, clipy, clipw, cliph) of the contents using painter p. The clip rectangle is in the scrollview's coordinates.

For example:

    {
        // Fill a 40000 by 50000 rectangle at (100000,150000)

        // Calculate the coordinates...
        int x1 = 100000, y1 = 150000;
        int x2 = x1+40000-1, y2 = y1+50000-1;

        // Clip the coordinates so X/Windows will not have problems...
        if (x1 < clipx) x1=clipx;
        if (y1 < clipy) y1=clipy;
        if (x2 > clipx+clipw-1) x2=clipx+clipw-1;
        if (y2 > clipy+cliph-1) y2=clipy+cliph-1;

        // Paint using the small coordinates...
        if ( x2 >= x1 && y2 >= y1 )
            p->fillRect(x1, y1, x2-x1+1, y2-y1+1, red);
    }

The clip rectangle and translation of the painter p is already set appropriately.

Reimplementado de QScrollView.

Reimplementado en QDataTable y QDataTable.

void QTable::dropped ( QDropEvent e) [signal]

This signal is emitted when a drop event occurred on the table.

e contains information about the drop.

void QTable::dropped ( QDropEvent e) [signal]
void QTable::editCell ( int  row,
int  col,
bool  replace = FALSE 
) [virtual, slot]

Starts editing the cell at row, col.

If replace is TRUE the content of this cell will be replaced by the content of the editor when editing is finished, i.e. the user will be entering new data; otherwise the current content of the cell (if any) will be modified in the editor.

Ver también:
beginEdit()
virtual void QTable::editCell ( int  row,
int  col,
bool  replace = FALSE 
) [virtual, slot]
QTable::EditMode QTable::editMode ( ) const [protected]

Returns the current edit mode

Ver también:
QTable::EditMode
EditMode QTable::editMode ( ) const [protected]
virtual void QTable::endEdit ( int  row,
int  col,
bool  accept,
bool  replace 
) [protected, virtual]

Reimplementado en QDataTable y QDataTable.

void QTable::endEdit ( int  row,
int  col,
bool  accept,
bool  replace 
) [protected, virtual]

This function is called when in-place editing of the cell at row, col is requested to stop.

If the cell is not being edited or accept is FALSE the function returns and the cell's contents are left unchanged.

If accept is TRUE the content of the editor must be transferred to the relevant cell. If replace is TRUE the current content of this cell should be replaced by the content of the editor (this means removing the current QTableItem of the cell and creating a new one for the cell). Otherwise (if possible) the content of the editor should just be set to the existing QTableItem of this cell.

setCellContentFromEditor() is called to replace the contents of the cell with the contents of the cell's editor.

Finally clearCellWidget() is called to remove the editor widget.

Ver también:
setCellContentFromEditor(), beginEdit()

Reimplementado en QDataTable y QDataTable.

void QTable::ensureCellVisible ( int  row,
int  col 
)
void QTable::ensureCellVisible ( int  row,
int  col 
)

Scrolls the table until the cell at row, col becomes visible.

bool QTable::eventFilter ( QObject obj,
QEvent e 
) [virtual]

This event filter ensures the scroll bars are updated when a single contents widget is resized, shown, hidden or destroyed; it passes mouse events to the QScrollView. The event is in e and the object is in obj.

Reimplementado de QScrollView.

Reimplementado en FLDataTable, QDataTable y QDataTable.

bool QTable::eventFilter ( QObject o,
QEvent e 
) [virtual]

Reimplementado de QScrollView.

Reimplementado en FLDataTable, QDataTable y QDataTable.

void QTable::focusInEvent ( QFocusEvent ) [protected, virtual]

Reimplementado de QWidget.

void QTable::focusInEvent ( QFocusEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive keyboard focus events (focus received) for the widget.

A widget normally must setFocusPolicy() to something other than NoFocus in order to receive focus events. (Note that the application programmer can call setFocus() on any widget, even those that do not normally accept focus.)

The default implementation updates the widget (except for toplevel widgets that do not specify a focusPolicy() ). It also calls setMicroFocusHint(), hinting any system-specific input tools about the focus of the user's attention.

Ver también:
focusOutEvent(), setFocusPolicy(), keyPressEvent(), keyReleaseEvent(), event(), QFocusEvent

Reimplementado de QWidget.

void QTable::focusOutEvent ( QFocusEvent ) [protected, virtual]

Reimplementado de QWidget.

Reimplementado en FLDataTable.

void QTable::focusOutEvent ( QFocusEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive keyboard focus events (focus lost) for the widget.

A widget normally must setFocusPolicy() to something other than NoFocus in order to receive focus events. (Note that the application programmer can call setFocus() on any widget, even those that do not normally accept focus.)

The default implementation updates the widget (except for toplevel widgets that do not specify a focusPolicy() ). It also calls setMicroFocusHint(), hinting any system-specific input tools about the focus of the user's attention.

Ver también:
focusInEvent(), setFocusPolicy(), keyPressEvent(), keyReleaseEvent(), event(), QFocusEvent

Reimplementado de QWidget.

Reimplementado en FLDataTable.

FocusStyle QTable::focusStyle ( ) const
FocusStyle QTable::focusStyle ( ) const
void QTable::hideColumn ( int  col) [virtual, slot]

Hides column col.

Ver también:
showColumn() hideRow()

Reimplementado en QDataTable y QDataTable.

virtual void QTable::hideColumn ( int  col) [virtual, slot]

Reimplementado en QDataTable y QDataTable.

virtual void QTable::hideRow ( int  row) [virtual, slot]
void QTable::hideRow ( int  row) [virtual, slot]

Hides row row.

Ver también:
showRow() hideColumn()
QHeader * QTable::horizontalHeader ( ) const

Returns the table's top QHeader.

This header contains the column labels.

To modify a column label use QHeader::setLabel(), e.g. table/statistics/statistics.cpp horizontalHeader

Ver también:
verticalHeader() setTopMargin() QHeader
QHeader* QTable::horizontalHeader ( ) const
int QTable::indexOf ( int  row,
int  col 
) const [protected]
int QTable::indexOf ( int  row,
int  col 
) const [protected]

Returns a single integer which identifies a particular row and col by mapping the 2D table to a 1D array.

This is useful, for example, if you have a sparse table and want to use a QIntDict to map integers to the cells that are used.

void QTable::insertColumns ( int  col,
int  count = 1 
) [virtual, slot]

Inserts count empty columns at column col. Also clears the selection(s).

Ver también:
insertRows() removeColumn()
virtual void QTable::insertColumns ( int  col,
int  count = 1 
) [virtual, slot]
void QTable::insertRows ( int  row,
int  count = 1 
) [virtual, slot]

Inserts count empty rows at row row. Also clears the selection(s).

Ver también:
insertColumns() removeRow()
virtual void QTable::insertRows ( int  row,
int  count = 1 
) [virtual, slot]
virtual void QTable::insertWidget ( int  row,
int  col,
QWidget w 
) [protected, virtual]
void QTable::insertWidget ( int  row,
int  col,
QWidget w 
) [protected, virtual]

Inserts widget w at row, col into the internal data structure. See the documentation of setCellWidget() for further details.

If you don't use {QTableItem}s you may need to reimplement this function: see the notes on large tables.

bool QTable::isColumnHidden ( int  col) const [slot]

Returns TRUE if column col is hidden; otherwise returns FALSE.

Ver también:
hideColumn(), isRowHidden()
bool QTable::isColumnHidden ( int  col) const [slot]
bool QTable::isColumnReadOnly ( int  col) const
bool QTable::isColumnReadOnly ( int  col) const

Returns TRUE if column col is read-only; otherwise returns FALSE.

Whether a cell in this column is editable or read-only depends on the cell's EditType, and this setting: see QTableItem::EditType.

Ver también:
setColumnReadOnly() isRowReadOnly()
bool QTable::isColumnSelected ( int  col,
bool  full = FALSE 
) const
bool QTable::isColumnSelected ( int  col,
bool  full = FALSE 
) const

Returns TRUE if column col is selected; otherwise returns FALSE.

If full is FALSE (the default), 'column is selected' means that at least one cell in the column is selected. If full is TRUE, then 'column is selected' means every cell in the column is selected.

Ver también:
isRowSelected() isSelected()
bool QTable::isColumnStretchable ( int  col) const [slot]

Returns TRUE if column col is stretchable; otherwise returns FALSE.

Ver también:
setColumnStretchable() isRowStretchable()
bool QTable::isColumnStretchable ( int  col) const [slot]
bool QTable::isEditing ( ) const [protected]
bool QTable::isEditing ( ) const [protected]

Returns TRUE if the EditMode is Editing or Replacing; otherwise (i.e. the EditMode is NotEditing) returns FALSE.

Ver también:
QTable::EditMode
bool QTable::isReadOnly ( ) const
bool QTable::isReadOnly ( ) const
bool QTable::isRowHidden ( int  row) const [slot]

Returns TRUE if row row is hidden; otherwise returns FALSE.

Ver también:
hideRow(), isColumnHidden()
bool QTable::isRowHidden ( int  row) const [slot]
bool QTable::isRowReadOnly ( int  row) const
bool QTable::isRowReadOnly ( int  row) const

Returns TRUE if row row is read-only; otherwise returns FALSE.

Whether a cell in this row is editable or read-only depends on the cell's EditType, and this setting: see QTableItem::EditType.

Ver también:
setRowReadOnly() isColumnReadOnly()
bool QTable::isRowSelected ( int  row,
bool  full = FALSE 
) const

Returns TRUE if row row is selected; otherwise returns FALSE.

If full is FALSE (the default), 'row is selected' means that at least one cell in the row is selected. If full is TRUE, then 'row is selected' means every cell in the row is selected.

Ver también:
isColumnSelected() isSelected()
bool QTable::isRowSelected ( int  row,
bool  full = FALSE 
) const
bool QTable::isRowStretchable ( int  row) const [slot]

Returns TRUE if row row is stretchable; otherwise returns FALSE.

Ver también:
setRowStretchable() isColumnStretchable()
bool QTable::isRowStretchable ( int  row) const [slot]
bool QTable::isSelected ( int  row,
int  col 
) const
bool QTable::isSelected ( int  row,
int  col 
) const

Returns TRUE if the cell at row, col is selected; otherwise returns FALSE.

Ver también:
isRowSelected() isColumnSelected()
virtual QTableItem* QTable::item ( int  row,
int  col 
) const [virtual]

Reimplementado en QDataTable y QDataTable.

QTableItem * QTable::item ( int  row,
int  col 
) const [virtual]

Returns the QTableItem representing the contents of the cell at row, col.

If row or col are out of range or no content has been set for this cell, item() returns 0.

If you don't use {QTableItem}s you may need to reimplement this function: see the notes on large tables.

Ver también:
setItem()

Reimplementado en QDataTable y QDataTable.

void QTable::keyPressEvent ( QKeyEvent e) [protected, virtual]

This event handler, for event e, can be reimplemented in a subclass to receive key press events for the widget.

A widget must call setFocusPolicy() to accept focus initially and have focus in order to receive a key press event.

If you reimplement this handler, it is very important that you explicitly ignore the event if you do not understand it, so that the widget's parent can interpret it; otherwise, the event will be implicitly accepted. Although top-level widgets are able to choose whether to accept or ignore unknown events because they have no parent widgets that could otherwise handle them, it is good practice to explicitly ignore events to make widgets as reusable as possible.

The default implementation closes popup widgets if the user presses Esc. Otherwise the event is ignored.

Ver también:
keyReleaseEvent(), QKeyEvent::ignore(), setFocusPolicy(), focusInEvent(), focusOutEvent(), event(), QKeyEvent

Reimplementado de QWidget.

Reimplementado en QDataTable y QDataTable.

void QTable::keyPressEvent ( QKeyEvent e) [protected, virtual]

Reimplementado de QWidget.

Reimplementado en QDataTable y QDataTable.

virtual int QTable::numCols ( ) const [virtual]

Reimplementado en QDataTable y QDataTable.

virtual int QTable::numCols ( ) const [virtual]

Reimplementado en QDataTable y QDataTable.

virtual int QTable::numRows ( ) const [virtual]

Reimplementado en QDataTable y QDataTable.

virtual int QTable::numRows ( ) const [virtual]

Reimplementado en QDataTable y QDataTable.

int QTable::numSelections ( ) const
int QTable::numSelections ( ) const
virtual void QTable::paintCell ( QPainter p,
int  row,
int  col,
const QRect cr,
bool  selected 
) [virtual]
virtual void QTable::paintCell ( QPainter p,
int  row,
int  col,
const QRect cr,
bool  selected,
const QColorGroup cg 
) [virtual]

Reimplementado en FLDataTable, FLTable, QDataTable y QDataTable.

void QTable::paintCell ( QPainter p,
int  row,
int  col,
const QRect cr,
bool  selected,
const QColorGroup cg 
) [virtual]

Paints the cell at row, col on the painter p. The painter has already been translated to the cell's origin. cr describes the cell coordinates in the content coordinate system.

If selected is TRUE the cell is highlighted.

cg is the colorgroup which should be used to draw the cell content.

If you want to draw custom cell content, for example right-aligned text, you must either reimplement paintCell(), or subclass QTableItem and reimplement QTableItem::paint() to do the custom drawing.

If you're using a QTableItem subclass, for example, to store a data structure, then reimplementing QTableItem::paint() may be the best approach. For data you want to draw immediately, e.g. data retrieved from a database, it is probably best to reimplement paintCell(). Note that if you reimplement paintCell(), i.e. don't use {QTableItem}s, you must reimplement other functions: see the notes on large tables.

Note that the painter is not clipped by default in order to get maximum efficiency. If you want clipping, use code like this:

    p->setClipRect( cellRect(row, col), QPainter::CoordPainter );
    //... your drawing code
    p->setClipping( FALSE );

Reimplementado en FLDataTable, FLTable, QDataTable y QDataTable.

void QTable::paintCell ( QPainter p,
int  row,
int  col,
const QRect cr,
bool  selected 
) [virtual]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Use the other paintCell() function. This function is only included for backwards compatibilty.

virtual void QTable::paintEmptyArea ( QPainter p,
int  cx,
int  cy,
int  cw,
int  ch 
) [protected, virtual]
void QTable::paintEmptyArea ( QPainter p,
int  cx,
int  cy,
int  cw,
int  ch 
) [protected, virtual]

This function fills the cw pixels wide and ch pixels high rectangle starting at position cx, cy with the background color using the painter p.

paintEmptyArea() is invoked by drawContents() to erase or fill unused areas.

void QTable::paintEvent ( QPaintEvent event) [protected, virtual]

Processes the paint event event.

Paints the frame and the contents.

Opens the painter on the frame and calls drawFrame(), then drawContents().

Reimplementado de QFrame.

void QTable::paintEvent ( QPaintEvent e) [protected, virtual]

Reimplementado de QFrame.

void QTable::paintFocus ( QPainter p,
const QRect cr 
) [virtual]

Draws the focus rectangle of the current cell (see currentRow(), currentColumn()).

The painter p is already translated to the cell's origin, while cr specifies the cell's geometry in content coordinates.

virtual void QTable::paintFocus ( QPainter p,
const QRect r 
) [virtual]
virtual QPixmap QTable::pixmap ( int  row,
int  col 
) const [virtual]
QPixmap QTable::pixmap ( int  row,
int  col 
) const [virtual]

Returns the pixmap set for the cell at row, col, or a null-pixmap if the cell contains no pixmap.

Ver también:
setPixmap()
void QTable::pressed ( int  row,
int  col,
int  button,
const QPoint mousePos 
) [signal]
void QTable::pressed ( int  row,
int  col,
int  button,
const QPoint mousePos 
) [signal]

This signal is emitted when mouse button button is pressed. The cell where the event took place is at row, col, and the mouse's position is in mousePos.

Ver también:
Qt::ButtonState
void QTable::removeColumn ( int  col) [virtual, slot]

Removes column col, and deletes all its cells including any table items and widgets the cells may contain. Also clears the selection(s).

Ver también:
removeColumns() hideColumn() insertColumns() removeRow()
virtual void QTable::removeColumn ( int  col) [virtual, slot]
void QTable::removeColumns ( const QMemArray< int > &  cols) [virtual, slot]

Removes the columns listed in the array cols, and deletes all their cells including any table items and widgets the cells may contain.

The array passed in must only contain valid columns (in the range from 0 to numCols() - 1) with no duplicates, and must be sorted in ascending order. Also clears the selection(s).

Ver también:
removeColumn() insertColumns() removeRows()
virtual void QTable::removeColumns ( const QMemArray< int > &  cols) [virtual, slot]
void QTable::removeRow ( int  row) [virtual, slot]

Removes row row, and deletes all its cells including any table items and widgets the cells may contain. Also clears the selection(s).

Ver también:
hideRow() insertRows() removeColumn() removeRows()
virtual void QTable::removeRow ( int  row) [virtual, slot]
void QTable::removeRows ( const QMemArray< int > &  rows) [virtual, slot]

Removes the rows listed in the array rows, and deletes all their cells including any table items and widgets the cells may contain.

The array passed in must only contain valid rows (in the range from 0 to numRows() - 1) with no duplicates, and must be sorted in ascending order. Also clears the selection(s).

Ver también:
removeRow() insertRows() removeColumns()
virtual void QTable::removeRows ( const QMemArray< int > &  rows) [virtual, slot]
void QTable::removeSelection ( int  num) [virtual]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Removes selection number num from the table.

Ver también:
numSelections() addSelection() clearSelection()
void QTable::removeSelection ( const QTableSelection s) [virtual]

If the table has a selection, s, this selection is removed from the table.

Ver también:
addSelection() numSelections()
virtual void QTable::removeSelection ( const QTableSelection s) [virtual]
virtual void QTable::removeSelection ( int  num) [virtual]
void QTable::repaintSelections ( )
void QTable::repaintSelections ( )

Repaints all selections

virtual void QTable::resizeData ( int  len) [protected, virtual]

Reimplementado en QDataTable y QDataTable.

void QTable::resizeData ( int  len) [protected, virtual]

This is called when QTable's internal array needs to be resized to len elements.

If you don't use QTableItems you should reimplement this as an empty method to avoid wasting memory. See the notes on large tables for further details.

Reimplementado en QDataTable y QDataTable.

int QTable::rowAt ( int  y) const [virtual]

Returns the number of the row at position y. y must be given in content coordinates.

Ver también:
rowPos() columnAt()
virtual int QTable::rowAt ( int  y) const [virtual]
virtual int QTable::rowHeight ( int  row) const [virtual]
int QTable::rowHeight ( int  row) const [virtual]

Returns the height of row row.

Ver también:
setRowHeight() columnWidth()
virtual void QTable::rowHeightChanged ( int  row) [protected, virtual, slot]
void QTable::rowHeightChanged ( int  row) [protected, virtual, slot]

This function should be called whenever the row height of row has been changed. It updates the geometry of any affected rows and repaints the table to reflect the changes it has made.

void QTable::rowIndexChanged ( int  section,
int  fromIndex,
int  toIndex 
) [protected, virtual, slot]

This function is called when the order of the rows is to be changed, i.e. the user moved the row header section section from fromIndex to toIndex.

If you want to change the order programmatically, call swapRows() or swapColumns();

Ver también:
QHeader::indexChange() columnIndexChanged()
virtual void QTable::rowIndexChanged ( int  section,
int  fromIndex,
int  toIndex 
) [protected, virtual, slot]
bool QTable::rowMovingEnabled ( ) const
bool QTable::rowMovingEnabled ( ) const
int QTable::rowPos ( int  row) const [virtual]

Returns the y-coordinate of the row row in content coordinates.

Ver también:
rowAt() columnPos()
virtual int QTable::rowPos ( int  row) const [virtual]
void QTable::selectCells ( int  start_row,
int  start_col,
int  end_row,
int  end_col 
)
void QTable::selectCells ( int  start_row,
int  start_col,
int  end_row,
int  end_col 
)

Selects the range starting at start_row and start_col and ending at end_row and end_col.

Ver también:
QTableSelection
void QTable::selectColumn ( int  col)

Selects the column col.

Ver también:
QTableSelection
void QTable::selectColumn ( int  col)
QTableSelection QTable::selection ( int  num) const
QTableSelection QTable::selection ( int  num) const

Returns selection number num, or an inactive QTableSelection if num is out of range (see QTableSelection::isActive()).

void QTable::selectionChanged ( ) [signal]
void QTable::selectionChanged ( ) [signal]

This signal is emitted whenever a selection changes.

Ver también:
QTableSelection
SelectionMode QTable::selectionMode ( ) const
SelectionMode QTable::selectionMode ( ) const
void QTable::selectRow ( int  row)

Selects the row row.

Ver también:
QTableSelection
void QTable::selectRow ( int  row)
virtual void QTable::setCellContentFromEditor ( int  row,
int  col 
) [protected, virtual]
void QTable::setCellContentFromEditor ( int  row,
int  col 
) [protected, virtual]

This function is called to replace the contents of the cell at row, col with the contents of the cell's editor.

If there already exists a QTableItem for the cell, it calls QTableItem::setContentFromEditor() on this QTableItem.

If, for example, you want to create different {QTableItem}s depending on the contents of the editor, you might reimplement this function.

If you want to work without {QTableItem}s, you will need to reimplement this function to save the data the user entered into your data structure. (See the notes on large tables.)

Ver también:
QTableItem::setContentFromEditor() createEditor()
virtual void QTable::setCellWidget ( int  row,
int  col,
QWidget e 
) [virtual]
void QTable::setCellWidget ( int  row,
int  col,
QWidget e 
) [virtual]

Sets the widget e to the cell at row, col and takes care of placing and resizing the widget when the cell geometry changes.

By default widgets are inserted into a vector with numRows() * numCols() elements. In very large tables you will probably want to store the widgets in a data structure that consumes less memory (see the notes on large tables). To support the use of your own data structure this function calls insertWidget() to add the widget to the internal data structure. To use your own data structure reimplement insertWidget(), cellWidget() and clearCellWidget().

Cell widgets are created dynamically with the new operator. The cell widgets are destroyed automatically once the table is destroyed; the table takes ownership of the widget when using setCellWidget.

void QTable::setColumnLabels ( const QStringList labels) [slot]

Sets the section labels of the horizontalHeader() to labels

void QTable::setColumnLabels ( const QStringList labels) [slot]
virtual void QTable::setColumnMovingEnabled ( bool  b) [virtual, slot]
void QTable::setColumnMovingEnabled ( bool  b) [virtual, slot]
virtual void QTable::setColumnReadOnly ( int  col,
bool  ro 
) [virtual, slot]
void QTable::setColumnReadOnly ( int  col,
bool  ro 
) [virtual, slot]

If ro is TRUE, column col is set to be read-only; otherwise the column is set to be editable.

Whether a cell in this column is editable or read-only depends on the cell's EditType, and this setting: see QTableItem::EditType.

Ver también:
isColumnReadOnly() setRowReadOnly() setReadOnly()
void QTable::setColumnStretchable ( int  col,
bool  stretch 
) [virtual, slot]

If stretch is TRUE, column col is set to be stretchable; otherwise column col is set to be unstretchable.

If the table widget's width decreases or increases stretchable columns will grow narrower or wider to fit the space available as completely as possible. The user cannot manually resize stretchable columns.

Ver también:
isColumnStretchable() setRowStretchable() adjustColumn()

Reimplementado en QDataTable y QDataTable.

virtual void QTable::setColumnStretchable ( int  col,
bool  stretch 
) [virtual, slot]

Reimplementado en QDataTable y QDataTable.

void QTable::setColumnWidth ( int  col,
int  w 
) [virtual, slot]

Resizes column col to be w pixels wide.

Ver también:
columnWidth() setRowHeight()

Reimplementado en QDataTable y QDataTable.

virtual void QTable::setColumnWidth ( int  col,
int  w 
) [virtual, slot]

Reimplementado en QDataTable y QDataTable.

void QTable::setCurrentCell ( int  row,
int  col 
) [virtual, slot]

Moves the focus to the cell at row, col.

Ver también:
currentRow() currentColumn()
virtual void QTable::setCurrentCell ( int  row,
int  col 
) [virtual, slot]
void QTable::setDragEnabled ( bool  b) [virtual, slot]

If b is TRUE, the table starts a drag (see dragObject()) when the user presses and moves the mouse on a selected cell.

virtual void QTable::setDragEnabled ( bool  b) [virtual, slot]
void QTable::setEditMode ( EditMode  mode,
int  row,
int  col 
) [protected]
void QTable::setEditMode ( EditMode  mode,
int  row,
int  col 
) [protected]

Sets the current edit mode to mode, the current edit row to row and the current edit column to col.

Ver también:
EditMode
void QTable::setEnabled ( bool  b) [virtual]

Reimplementado de QScrollView.

void QTable::setEnabled ( bool  enable) [virtual]

Reimplementado de QScrollView.

void QTable::setFocusStyle ( FocusStyle  fs) [virtual]
virtual void QTable::setFocusStyle ( FocusStyle  fs) [virtual]
virtual void QTable::setItem ( int  row,
int  col,
QTableItem item 
) [virtual]

Reimplementado en QDataTable y QDataTable.

void QTable::setItem ( int  row,
int  col,
QTableItem item 
) [virtual]

Inserts the table item item into the table at row row, column col, and repaints the cell. If a table item already exists in this cell it is deleted and replaced with item. The table takes ownership of the table item.

If you don't use {QTableItem}s you may need to reimplement this function: see the notes on large tables.

Ver también:
item() takeItem()

Reimplementado en QDataTable y QDataTable.

virtual void QTable::setLeftMargin ( int  m) [virtual, slot]
void QTable::setLeftMargin ( int  m) [virtual, slot]

Sets the left margin to be m pixels wide.

The verticalHeader(), which displays row labels, occupies this margin.

In an Arabic or Hebrew localization, the verticalHeader() will appear on the right side of the table, and this call will set the right margin.

Ver también:
leftMargin() setTopMargin() verticalHeader()
virtual void QTable::setNumCols ( int  r) [virtual, slot]

Reimplementado en QDataTable y QDataTable.

void QTable::setNumCols ( int  r) [virtual, slot]

Reimplementado en QDataTable y QDataTable.

virtual void QTable::setNumRows ( int  r) [virtual, slot]

Reimplementado en QDataTable y QDataTable.

void QTable::setNumRows ( int  r) [virtual, slot]

Reimplementado en QDataTable y QDataTable.

void QTable::setPixmap ( int  row,
int  col,
const QPixmap pix 
) [virtual]

Sets the pixmap in the cell at row, col to pix.

If the cell does not contain a table item a QTableItem is created with an EditType of OnTyping, otherwise the existing table item's pixmap (if any) is replaced with pix.

Note that {QComboTableItem}s and {QCheckTableItem}s don't show pixmaps.

Ver también:
pixmap() setText() setItem() QTableItem::setPixmap()

Reimplementado en QDataTable y QDataTable.

virtual void QTable::setPixmap ( int  row,
int  col,
const QPixmap pix 
) [virtual]

Reimplementado en QDataTable y QDataTable.

void QTable::setReadOnly ( bool  b) [virtual, slot]
virtual void QTable::setReadOnly ( bool  b) [virtual, slot]
void QTable::setRowHeight ( int  row,
int  h 
) [virtual, slot]

Resizes row row to be h pixels high.

Ver también:
rowHeight() setColumnWidth()
virtual void QTable::setRowHeight ( int  row,
int  h 
) [virtual, slot]
void QTable::setRowLabels ( const QStringList labels) [slot]

Sets the section labels of the verticalHeader() to labels

void QTable::setRowLabels ( const QStringList labels) [slot]
void QTable::setRowMovingEnabled ( bool  b) [virtual, slot]
virtual void QTable::setRowMovingEnabled ( bool  b) [virtual, slot]
void QTable::setRowReadOnly ( int  row,
bool  ro 
) [virtual, slot]

If ro is TRUE, row row is set to be read-only; otherwise the row is set to be editable.

Whether a cell in this row is editable or read-only depends on the cell's EditType, and this setting: see QTableItem::EditType.

Ver también:
isRowReadOnly() setColumnReadOnly() setReadOnly()
virtual void QTable::setRowReadOnly ( int  row,
bool  ro 
) [virtual, slot]
void QTable::setRowStretchable ( int  row,
bool  stretch 
) [virtual, slot]

If stretch is TRUE, row row is set to be stretchable; otherwise row row is set to be unstretchable.

If the table widget's height decreases or increases stretchable rows will grow shorter or taller to fit the space available as completely as possible. The user cannot manually resize stretchable rows.

Ver también:
isRowStretchable() setColumnStretchable()
virtual void QTable::setRowStretchable ( int  row,
bool  stretch 
) [virtual, slot]
void QTable::setSelectionMode ( SelectionMode  mode) [virtual]
virtual void QTable::setSelectionMode ( SelectionMode  mode) [virtual]
virtual void QTable::setShowGrid ( bool  b) [virtual, slot]
void QTable::setShowGrid ( bool  b) [virtual, slot]
void QTable::setSorting ( bool  b) [virtual, slot]
virtual void QTable::setSorting ( bool  b) [virtual, slot]
void QTable::setText ( int  row,
int  col,
const QString text 
) [virtual]

Sets the text in the cell at row, col to text.

If the cell does not contain a table item a QTableItem is created with an EditType of OnTyping, otherwise the existing table item's text (if any) is replaced with text.

Ver también:
text() setPixmap() setItem() QTableItem::setText()
virtual void QTable::setText ( int  row,
int  col,
const QString text 
) [virtual]
void QTable::setTopMargin ( int  m) [virtual, slot]

Sets the top margin to be m pixels high.

The horizontalHeader(), which displays column labels, occupies this margin.

Ver también:
topMargin() setLeftMargin()
virtual void QTable::setTopMargin ( int  m) [virtual, slot]
virtual void QTable::showColumn ( int  col) [virtual, slot]

Reimplementado en QDataTable y QDataTable.

void QTable::showColumn ( int  col) [virtual, slot]

Shows column col.

Ver también:
hideColumn() showRow()

Reimplementado en QDataTable y QDataTable.

void QTable::showEvent ( QShowEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive widget show events.

Non-spontaneous show events are sent to widgets immediately before they are shown. The spontaneous show events of top-level widgets are delivered afterwards.

Ver también:
event(), QShowEvent

Reimplementado de QWidget.

void QTable::showEvent ( QShowEvent e) [protected, virtual]

Reimplementado de QWidget.

bool QTable::showGrid ( ) const
bool QTable::showGrid ( ) const
virtual void QTable::showRow ( int  row) [virtual, slot]
void QTable::showRow ( int  row) [virtual, slot]

Shows row row.

Ver también:
hideRow() showColumn()
QSize QTable::sizeHint ( ) const [virtual]

Reimplementado de QScrollView.

QSize QTable::sizeHint ( ) const [virtual]

Reimplementado de QScrollView.

virtual void QTable::sortColumn ( int  col,
bool  ascending = TRUE,
bool  wholeRows = FALSE 
) [virtual]

Reimplementado en QDataTable, QDataTable y ConnectionTable.

void QTable::sortColumn ( int  col,
bool  ascending = TRUE,
bool  wholeRows = FALSE 
) [virtual]

Sorts column col. If ascending is TRUE the sort is in ascending order, otherwise the sort is in descending order.

If wholeRows is TRUE, entire rows are sorted using swapRows(); otherwise only cells in the column are sorted using swapCells().

Note that if you are not using QTableItems you will need to reimplement swapRows() and swapCells(). (See the notes on large tables.)

Ver también:
swapRows()

Reimplementado en QDataTable, QDataTable y ConnectionTable.

bool QTable::sorting ( ) const
bool QTable::sorting ( ) const
void QTable::startDrag ( ) [protected, virtual]

Starts a drag.

Usually you don't need to call or reimplement this function yourself.

Ver también:
dragObject();
virtual void QTable::startDrag ( ) [protected, virtual]
void QTable::swapCells ( int  row1,
int  col1,
int  row2,
int  col2 
) [virtual, slot]

Swaps the contents of the cell at row1, col1 with the contents of the cell at row2, col2.

This function is also called when the table is sorted.

If you don't use {QTableItem}s and want your users to be able to swap cells, you will need to reimplement this function. (See the notes on large tables.)

Ver también:
swapColumns() swapRows()
virtual void QTable::swapCells ( int  row1,
int  col1,
int  row2,
int  col2 
) [virtual, slot]
void QTable::swapColumns ( int  col1,
int  col2,
bool  swapHeader = FALSE 
) [virtual, slot]

Swaps the data in col1 with col2.

This function is used to swap the positions of two columns. It is called when the user changes the order of columns (see setColumnMovingEnabled(), and when columns are sorted.

If you don't use {QTableItem}s and want your users to be able to swap columns you will need to reimplement this function. (See the notes on large tables.)

If swapHeader is TRUE, the columns' header contents is also swapped.

Ver también:
swapCells()

Reimplementado en QDataTable y QDataTable.

virtual void QTable::swapColumns ( int  col1,
int  col2,
bool  swapHeader = FALSE 
) [virtual, slot]

Reimplementado en QDataTable y QDataTable.

void QTable::swapRows ( int  row1,
int  row2,
bool  swapHeader = FALSE 
) [virtual, slot]

Swaps the data in row1 and row2.

This function is used to swap the positions of two rows. It is called when the user changes the order of rows (see setRowMovingEnabled()), and when rows are sorted.

If you don't use {QTableItem}s and want your users to be able to swap rows, e.g. for sorting, you will need to reimplement this function. (See the notes on large tables.)

If swapHeader is TRUE, the rows' header contents is also swapped.

This function will not update the QTable, you will have to do this manually, e.g. by calling updateContents().

Ver también:
swapColumns() swapCells()
virtual void QTable::swapRows ( int  row1,
int  row2,
bool  swapHeader = FALSE 
) [virtual, slot]
void QTable::takeItem ( QTableItem i) [virtual]

Takes the table item i out of the table. This function does not delete the table item. You must either delete the table item yourself or put it into a table (using setItem()) which will then take ownership of it.

Use this function if you want to move an item from one cell in a table to another, or to move an item from one table to another, reinserting the item with setItem().

If you want to exchange two cells use swapCells().

Reimplementado en QDataTable y QDataTable.

virtual void QTable::takeItem ( QTableItem i) [virtual]

Reimplementado en QDataTable y QDataTable.

virtual QString QTable::text ( int  row,
int  col 
) const [virtual]

Reimplementado en QDataTable y QDataTable.

QString QTable::text ( int  row,
int  col 
) const [virtual]

Returns the text in the cell at row, col, or QString::null if the relevant item does not exist or has no text.

Ver también:
setText() setPixmap()

Reimplementado en QDataTable y QDataTable.

void QTable::updateCell ( int  row,
int  col 
)

Repaints the cell at row, col.

void QTable::updateCell ( int  row,
int  col 
)
void QTable::updateHeaderStates ( )

This functions updates all the header states to be in sync with the current selections. This should be called after programatically changing, adding or removing selections, so that the headers are updated.

void QTable::updateHeaderStates ( )
void QTable::valueChanged ( int  row,
int  col 
) [signal]
void QTable::valueChanged ( int  row,
int  col 
) [signal]

This signal is emitted when the user changed the value in the cell at row, col.

QHeader * QTable::verticalHeader ( ) const

Returns the table's vertical QHeader.

This header contains the row labels.

Ver también:
horizontalHeader() setLeftMargin() QHeader
QHeader* QTable::verticalHeader ( ) const
void QTable::viewportResizeEvent ( QResizeEvent e) [protected, virtual]

Reimplementado de QScrollView.

void QTable::viewportResizeEvent ( QResizeEvent ) [protected, virtual]

To provide simple processing of events on the contents, this function receives all resize events sent to the viewport.

Ver también:
QWidget::resizeEvent()

Reimplementado de QScrollView.

void QTable::windowActivationChange ( bool  oldActive) [protected, virtual]

Reimplementado de QWidget.

void QTable::windowActivationChange ( bool  oldActive) [protected, virtual]

This virtual function is called for a widget when its window is activated or deactivated by the window system. oldActive is the previous state; you can get the new setting from isActiveWindow().

Reimplement this function if your widget needs to know when its window becomes activated or deactivated.

The default implementation updates the visible part of the widget if the inactive and the active colorgroup are different for colors other than the highlight and link colors.

Ver también:
setActiveWindow(), isActiveWindow(), update(), palette()

Reimplementado de QWidget.


Documentación de las funciones relacionadas y clases amigas

QCheckTableItem [friend]
QComboTableItem [friend]
QTableHeader [friend]
QTableItem [friend]

Documentación de propiedades

bool QTable::columnMovingEnabled [read, write]

whether columns can be moved by the user

The default is FALSE. Columns are moved by dragging whilst holding down the Ctrl key.

Atención:
If QTable is used to move header sections as a result of user interaction, the mapping between header indexes and section exposed by QHeader will not reflect the order of the headers in the table; i.e., QTable does not call QHeader::moveSection() to move sections but handles move operations internally.
Ver también:
rowMovingEnabled
FocusStyle QTable::focusStyle [read, write]

how the current (focus) cell is drawn

The default style is SpreadSheet.

Ver también:
QTable::FocusStyle
int QTable::numCols [read, write]

The number of columns in the table.

Ver también:
numRows

Reimplementado en QDataTable.

int QTable::numRows [read, write]

The number of rows in the table.

Ver también:
numCols

Reimplementado en QDataTable.

int QTable::numSelections [read]

The number of selections.

Ver también:
currentSelection()
bool QTable::readOnly [read, write]

whether the table is read-only

Whether a cell in the table is editable or read-only depends on the cell's EditType, and this setting: see QTableItem::EditType.

Ver también:
QWidget::enabled setColumnReadOnly() setRowReadOnly()
bool QTable::rowMovingEnabled [read, write]

whether rows can be moved by the user

The default is FALSE. Rows are moved by dragging whilst holding down the Ctrl key.

Atención:
If QTable is used to move header sections as a result of user interaction, the mapping between header indexes and section exposed by QHeader will not reflect the order of the headers in the table; i.e., QTable does not call QHeader::moveSection() to move sections but handles move operations internally.
Ver también:
columnMovingEnabled
SelectionMode QTable::selectionMode [read, write]

the current selection mode

The default mode is Multi which allows the user to select multiple ranges of cells.

Ver también:
SelectionMode setSelectionMode()
bool QTable::showGrid [read, write]

whether the table's grid is displayed

The grid is shown by default.

bool QTable::sorting [read, write]

whether a click on the header of a column sorts that column

Ver también:
sortColumn()

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'