- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | Friends

# QTableWidget Class Reference

Search for all occurrences

## Detailed Description

Definition at line 220 of file qtablewidget.h.

`#include <qtablewidget.h>`

Inheritance diagram for QTableWidget:
[legend]

List of all members.

## Public Slots
void | scrollToItem (const QTableWidgetItem *item, QAbstractItemView::ScrollHint hint=EnsureVisible)
void | insertRow (int row)
void | insertColumn (int column)
void | removeRow (int row)
void | removeColumn (int column)
void | clear ()
void | clearContents ()
## Signals
void | itemPressed (QTableWidgetItem *item)
void | itemClicked (QTableWidgetItem *item)
void | itemDoubleClicked (QTableWidgetItem *item)
void | itemActivated (QTableWidgetItem *item)
void | itemEntered (QTableWidgetItem *item)
void | itemChanged (QTableWidgetItem *item)
void | currentItemChanged (QTableWidgetItem *current, QTableWidgetItem *previous)
void | itemSelectionChanged ()
void | cellPressed (int row, int column)
void | cellClicked (int row, int column)
void | cellDoubleClicked (int row, int column)
void | cellActivated (int row, int column)
void | cellEntered (int row, int column)
void | cellChanged (int row, int column)
void | currentCellChanged (int currentRow, int currentColumn, int previousRow, int previousColumn)
## Public Member Functions
| QTableWidget (QWidget *parent=0)
| QTableWidget (int rows, int columns, QWidget *parent=0)
| ~QTableWidget ()
void | setRowCount (int rows)
int | rowCount () const
void | setColumnCount (int columns)
int | columnCount () const
int | row (const QTableWidgetItem *item) const
int | column (const QTableWidgetItem *item) const
QTableWidgetItem * | item (int row, int column) const
void | setItem (int row, int column, QTableWidgetItem *item)
QTableWidgetItem * | takeItem (int row, int column)
QTableWidgetItem * | verticalHeaderItem (int row) const
void | setVerticalHeaderItem (int row, QTableWidgetItem *item)
QTableWidgetItem * | takeVerticalHeaderItem (int row)
QTableWidgetItem * | horizontalHeaderItem (int column) const
void | setHorizontalHeaderItem (int column, QTableWidgetItem *item)
QTableWidgetItem * | takeHorizontalHeaderItem (int column)
void | setVerticalHeaderLabels (const QStringList &labels)
void | setHorizontalHeaderLabels (const QStringList &labels)
int | currentRow () const
int | currentColumn () const
QTableWidgetItem * | currentItem () const
void | setCurrentItem (QTableWidgetItem *item)
void | setCurrentItem (QTableWidgetItem *item, QItemSelectionModel::SelectionFlags command)
void | setCurrentCell (int row, int column)
void | setCurrentCell (int row, int column, QItemSelectionModel::SelectionFlags command)
void | sortItems (int column, Qt::SortOrder order=Qt::AscendingOrder)
void | setSortingEnabled (bool enable)
bool | isSortingEnabled () const
void | editItem (QTableWidgetItem *item)
void | openPersistentEditor (QTableWidgetItem *item)
void | closePersistentEditor (QTableWidgetItem *item)
QWidget * | cellWidget (int row, int column) const
void | setCellWidget (int row, int column, QWidget *widget)
void | removeCellWidget (int row, int column)
bool | isItemSelected (const QTableWidgetItem *item) const
void | setItemSelected (const QTableWidgetItem *item, bool select)
void | setRangeSelected (const QTableWidgetSelectionRange &range, bool select)
QList< QTableWidgetSelectionRange > | selectedRanges () const
QList< QTableWidgetItem * > | selectedItems ()
QList< QTableWidgetItem * > | findItems (const QString &text, Qt::MatchFlags flags) const
int | visualRow (int logicalRow) const
int | visualColumn (int logicalColumn) const
QTableWidgetItem * | itemAt (const QPoint &p) const
QTableWidgetItem * | itemAt (int x, int y) const
QRect | visualItemRect (const QTableWidgetItem *item) const
const QTableWidgetItem * | itemPrototype () const
void | setItemPrototype (const QTableWidgetItem *item)
## Protected Member Functions
bool | event (QEvent *e)
virtual QStringList | mimeTypes () const
virtual QMimeData * | mimeData (const QList< QTableWidgetItem * > items) const
virtual bool | dropMimeData (int row, int column, const QMimeData *data, Qt::DropAction action)
virtual Qt::DropActions | supportedDropActions () const
QList< QTableWidgetItem * > | items (const QMimeData *data) const
QModelIndex | indexFromItem (QTableWidgetItem *item) const
QTableWidgetItem * | itemFromIndex (const QModelIndex &index) const
void | dropEvent (QDropEvent *event)
## Properties
int | rowCount
int | columnCount
## Friends
class | QTableModel

## Constructor & Destructor Documentation

QTableWidget | ( | QWidget * | parent = `0` | ) | `[explicit]`

QTableWidget | ( | int | rows,
|  | int | columns,
|  | QWidget * | parent = `0`
| ) |  |

~QTableWidget | ( |  | ) |

## Member Function Documentation

void setRowCount | ( | int | rows | ) |

Search for all occurrences

int rowCount | ( |  | ) | const

Search for all occurrences

void setColumnCount | ( | int | columns | ) |

Search for all occurrences

int columnCount | ( |  | ) | const

Search for all occurrences

int row | ( | const QTableWidgetItem * | item | ) | const

Search for all occurrences

int column | ( | const QTableWidgetItem * | item | ) | const

Search for all occurrences

QTableWidgetItem* item | ( | int | row,
|  | int | column
| ) |  | const

Search for all occurrences

void setItem | ( | int | row,
|  | int | column,
|  | QTableWidgetItem * | item
| ) |  |

Search for all occurrences

QTableWidgetItem* takeItem | ( | int | row,
|  | int | column
| ) |  |

Search for all occurrences

QTableWidgetItem* verticalHeaderItem | ( | int | row | ) | const

Search for all occurrences

void setVerticalHeaderItem | ( | int | row,
|  | QTableWidgetItem * | item
| ) |  |

Search for all occurrences

QTableWidgetItem* takeVerticalHeaderItem | ( | int | row | ) |

Search for all occurrences

QTableWidgetItem* horizontalHeaderItem | ( | int | column | ) | const

Search for all occurrences

void setHorizontalHeaderItem | ( | int | column,
|  | QTableWidgetItem * | item
| ) |  |

Search for all occurrences

QTableWidgetItem* takeHorizontalHeaderItem | ( | int | column | ) |

Search for all occurrences

void setVerticalHeaderLabels | ( | const QStringList & | labels | ) |

Search for all occurrences

void setHorizontalHeaderLabels | ( | const QStringList & | labels | ) |

Search for all occurrences

int currentRow | ( |  | ) | const

Search for all occurrences

int currentColumn | ( |  | ) | const

Search for all occurrences

QTableWidgetItem* currentItem | ( |  | ) | const

Search for all occurrences

void setCurrentItem | ( | QTableWidgetItem * | item | ) |

Search for all occurrences

void setCurrentItem | ( | QTableWidgetItem * | item,
|  | QItemSelectionModel::SelectionFlags | command
| ) |  |

Search for all occurrences

void setCurrentCell | ( | int | row,
|  | int | column
| ) |  |

Search for all occurrences

void setCurrentCell | ( | int | row,
|  | int | column,
|  | QItemSelectionModel::SelectionFlags | command
| ) |  |

Search for all occurrences

void sortItems | ( | int | column,
|  | Qt::SortOrder | order = `Qt::AscendingOrder`
| ) |  |

Search for all occurrences

void setSortingEnabled | ( | bool | enable | ) |

Search for all occurrences

Reimplemented from QTableView.

bool isSortingEnabled | ( |  | ) | const

Search for all occurrences

Reimplemented from QTableView.

void editItem | ( | QTableWidgetItem * | item | ) |

Search for all occurrences

void openPersistentEditor | ( | QTableWidgetItem * | item | ) |

Search for all occurrences

void closePersistentEditor | ( | QTableWidgetItem * | item | ) |

Search for all occurrences

QWidget* cellWidget | ( | int | row,
|  | int | column
| ) |  | const

Search for all occurrences

void setCellWidget | ( | int | row,
|  | int | column,
|  | QWidget * | widget
| ) |  |

Search for all occurrences

void removeCellWidget | ( | int | row,
|  | int | column
| ) |  | `[inline]`

Search for all occurrences

Definition at line 353 of file qtablewidget.h.

    { setCellWidget(arow, acolumn, 0); }

bool isItemSelected | ( | const QTableWidgetItem * | item | ) | const

Search for all occurrences

void setItemSelected | ( | const QTableWidgetItem * | item,
|  | bool | select
| ) |  |

Search for all occurrences

void setRangeSelected | ( | const QTableWidgetSelectionRange & | range,
|  | bool | select
| ) |  |

Search for all occurrences

QList<QTableWidgetSelectionRange> selectedRanges | ( |  | ) | const

Search for all occurrences

QList<QTableWidgetItem*> selectedItems | ( |  | ) |

Search for all occurrences

QList<QTableWidgetItem*> findItems | ( | const QString & | text,
|  | Qt::MatchFlags | flags
| ) |  | const

Search for all occurrences

int visualRow | ( | int | logicalRow | ) | const

Search for all occurrences

int visualColumn | ( | int | logicalColumn | ) | const

Search for all occurrences

QTableWidgetItem* itemAt | ( | const QPoint & | p | ) | const

Search for all occurrences

QTableWidgetItem * itemAt | ( | int | x,
|  | int | y
| ) |  | const `[inline]`

Search for all occurrences

Definition at line 356 of file qtablewidget.h.

    { return itemAt(QPoint(ax, ay)); }

QRect visualItemRect | ( | const QTableWidgetItem * | item | ) | const

Search for all occurrences

const QTableWidgetItem* itemPrototype | ( |  | ) | const

Search for all occurrences

void setItemPrototype | ( | const QTableWidgetItem * | item | ) |

Search for all occurrences

void scrollToItem | ( | const QTableWidgetItem * | item,
|  | QAbstractItemView::ScrollHint | hint = `EnsureVisible`
| ) |  | `[slot]`

Search for all occurrences

void insertRow | ( | int | row | ) | `[slot]`

Search for all occurrences

void insertColumn | ( | int | column | ) | `[slot]`

Search for all occurrences

void removeRow | ( | int | row | ) | `[slot]`

Search for all occurrences

void removeColumn | ( | int | column | ) | `[slot]`

Search for all occurrences

void clear | ( |  | ) | `[slot]`

Search for all occurrences

void clearContents | ( |  | ) | `[slot]`

Search for all occurrences

void itemPressed | ( | QTableWidgetItem * | item | ) | `[signal]`

Search for all occurrences

void itemClicked | ( | QTableWidgetItem * | item | ) | `[signal]`

Search for all occurrences

void itemDoubleClicked | ( | QTableWidgetItem * | item | ) | `[signal]`

Search for all occurrences

void itemActivated | ( | QTableWidgetItem * | item | ) | `[signal]`

Search for all occurrences

void itemEntered | ( | QTableWidgetItem * | item | ) | `[signal]`

Search for all occurrences

void itemChanged | ( | QTableWidgetItem * | item | ) | `[signal]`

Search for all occurrences

void currentItemChanged | ( | QTableWidgetItem * | current,
|  | QTableWidgetItem * | previous
| ) |  | `[signal]`

Search for all occurrences

void itemSelectionChanged | ( |  | ) | `[signal]`

Search for all occurrences

void cellPressed | ( | int | row,
|  | int | column
| ) |  | `[signal]`

Search for all occurrences

void cellClicked | ( | int | row,
|  | int | column
| ) |  | `[signal]`

Search for all occurrences

void cellDoubleClicked | ( | int | row,
|  | int | column
| ) |  | `[signal]`

Search for all occurrences

void cellActivated | ( | int | row,
|  | int | column
| ) |  | `[signal]`

Search for all occurrences

void cellEntered | ( | int | row,
|  | int | column
| ) |  | `[signal]`

Search for all occurrences

void cellChanged | ( | int | row,
|  | int | column
| ) |  | `[signal]`

Search for all occurrences

void currentCellChanged | ( | int | currentRow,
|  | int | currentColumn,
|  | int | previousRow,
|  | int | previousColumn
| ) |  | `[signal]`

Search for all occurrences

bool event | ( | QEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

virtual QStringList mimeTypes | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

virtual QMimeData* mimeData | ( | const QList< QTableWidgetItem * > | items | ) | const `[protected, virtual]`

Search for all occurrences

virtual bool dropMimeData | ( | int | row,
|  | int | column,
|  | const QMimeData * | data,
|  | Qt::DropAction | action
| ) |  | `[protected, virtual]`

Search for all occurrences

virtual Qt::DropActions supportedDropActions | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

QList<QTableWidgetItem*> items | ( | const QMimeData * | data | ) | const `[protected]`

Search for all occurrences

QModelIndex indexFromItem | ( | QTableWidgetItem * | item | ) | const `[protected]`

Search for all occurrences

QTableWidgetItem* itemFromIndex | ( | const QModelIndex & | index | ) | const `[protected]`

Search for all occurrences

void dropEvent | ( | QDropEvent * | event | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

## Friends And Related Function Documentation

friend class QTableModel `[friend]`

Search for all occurrences

Definition at line 226 of file qtablewidget.h.

## Property Documentation

int rowCount `[read, write]`

Search for all occurrences

Definition at line 223 of file qtablewidget.h.

int columnCount `[read, write]`

Search for all occurrences

Definition at line 224 of file qtablewidget.h.

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

- QtGui/qtablewidget.h

QTableWidget QTableWidget QTableWidget QTableWidget QTableWidget QTableWidget QTableWidget QTableWidget QTableWidget QTableWidget
QTableWidget QTableWidget QTableWidget QTableWidget QTableWidget QTableWidget QTableWidget QTableWidget QTableWidget QTableWidget