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

- Class List
- Class Hierarchy
- Class Members

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

# QTableView Class Reference

Search for all occurrences

## Detailed Description

Definition at line 58 of file qtableview.h.

`#include <qtableview.h>`

Inheritance diagram for QTableView:
[legend]

List of all members.

## Public Slots
void | selectRow (int row)
void | selectColumn (int column)
void | hideRow (int row)
void | hideColumn (int column)
void | showRow (int row)
void | showColumn (int column)
void | resizeRowToContents (int row)
void | resizeRowsToContents ()
void | resizeColumnToContents (int column)
void | resizeColumnsToContents ()
void | sortByColumn (int column)
void | setShowGrid (bool show)
## Public Member Functions
| QTableView (QWidget *parent=0)
| ~QTableView ()
void | setModel (QAbstractItemModel *model)
void | setRootIndex (const QModelIndex &index)
void | setSelectionModel (QItemSelectionModel *selectionModel)
QHeaderView * | horizontalHeader () const
QHeaderView * | verticalHeader () const
void | setHorizontalHeader (QHeaderView *header)
void | setVerticalHeader (QHeaderView *header)
int | rowViewportPosition (int row) const
int | rowAt (int y) const
void | setRowHeight (int row, int height)
int | rowHeight (int row) const
int | columnViewportPosition (int column) const
int | columnAt (int x) const
void | setColumnWidth (int column, int width)
int | columnWidth (int column) const
bool | isRowHidden (int row) const
void | setRowHidden (int row, bool hide)
bool | isColumnHidden (int column) const
void | setColumnHidden (int column, bool hide)
void | setSortingEnabled (bool enable)
bool | isSortingEnabled () const
bool | showGrid () const
Qt::PenStyle | gridStyle () const
void | setGridStyle (Qt::PenStyle style)
void | setWordWrap (bool on)
bool | wordWrap () const
void | setCornerButtonEnabled (bool enable)
bool | isCornerButtonEnabled () const
QRect | visualRect (const QModelIndex &index) const
void | scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible)
QModelIndex | indexAt (const QPoint &p) const
void | setSpan (int row, int column, int rowSpan, int columnSpan)
int | rowSpan (int row, int column) const
int | columnSpan (int row, int column) const
void | clearSpans ()
void | sortByColumn (int column, Qt::SortOrder order)
## Protected Slots
void | rowMoved (int row, int oldIndex, int newIndex)
void | columnMoved (int column, int oldIndex, int newIndex)
void | rowResized (int row, int oldHeight, int newHeight)
void | columnResized (int column, int oldWidth, int newWidth)
void | rowCountChanged (int oldCount, int newCount)
void | columnCountChanged (int oldCount, int newCount)
## Protected Member Functions
| QTableView (QTableViewPrivate &, QWidget *parent)
void | scrollContentsBy (int dx, int dy)
QStyleOptionViewItem | viewOptions () const
void | paintEvent (QPaintEvent *e)
void | timerEvent (QTimerEvent *event)
int | horizontalOffset () const
int | verticalOffset () const
QModelIndex | moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers)
void | setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command)
QRegion | visualRegionForSelection (const QItemSelection &selection) const
QModelIndexList | selectedIndexes () const
void | updateGeometries ()
int | sizeHintForRow (int row) const
int | sizeHintForColumn (int column) const
void | verticalScrollbarAction (int action)
void | horizontalScrollbarAction (int action)
bool | isIndexHidden (const QModelIndex &index) const
void | selectionChanged (const QItemSelection &selected, const QItemSelection &deselected)
void | currentChanged (const QModelIndex &current, const QModelIndex &previous)
## Properties
bool | showGrid
Qt::PenStyle | gridStyle
bool | sortingEnabled
bool | wordWrap
bool | cornerButtonEnabled
## Friends
class | QAccessibleItemView

## Constructor & Destructor Documentation

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

~QTableView | ( |  | ) |

QTableView | ( | QTableViewPrivate & | ,
|  | QWidget * | parent
| ) |  | `[protected]`

## Member Function Documentation

void setModel | ( | QAbstractItemModel * | model | ) | `[virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void setRootIndex | ( | const QModelIndex & | index | ) | `[virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void setSelectionModel | ( | QItemSelectionModel * | selectionModel | ) | `[virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

QHeaderView* horizontalHeader | ( |  | ) | const

Search for all occurrences

QHeaderView* verticalHeader | ( |  | ) | const

Search for all occurrences

void setHorizontalHeader | ( | QHeaderView * | header | ) |

Search for all occurrences

void setVerticalHeader | ( | QHeaderView * | header | ) |

Search for all occurrences

int rowViewportPosition | ( | int | row | ) | const

Search for all occurrences

int rowAt | ( | int | y | ) | const

Search for all occurrences

void setRowHeight | ( | int | row,
|  | int | height
| ) |  |

Search for all occurrences

int rowHeight | ( | int | row | ) | const

Search for all occurrences

int columnViewportPosition | ( | int | column | ) | const

Search for all occurrences

int columnAt | ( | int | x | ) | const

Search for all occurrences

void setColumnWidth | ( | int | column,
|  | int | width
| ) |  |

Search for all occurrences

int columnWidth | ( | int | column | ) | const

Search for all occurrences

bool isRowHidden | ( | int | row | ) | const

Search for all occurrences

void setRowHidden | ( | int | row,
|  | bool | hide
| ) |  |

Search for all occurrences

bool isColumnHidden | ( | int | column | ) | const

Search for all occurrences

void setColumnHidden | ( | int | column,
|  | bool | hide
| ) |  |

Search for all occurrences

void setSortingEnabled | ( | bool | enable | ) |

Search for all occurrences

Reimplemented in QTableWidget.

bool isSortingEnabled | ( |  | ) | const

Search for all occurrences

Reimplemented in QTableWidget.

bool showGrid | ( |  | ) | const

Search for all occurrences

Qt::PenStyle gridStyle | ( |  | ) | const

Search for all occurrences

void setGridStyle | ( | Qt::PenStyle | style | ) |

Search for all occurrences

void setWordWrap | ( | bool | on | ) |

Search for all occurrences

bool wordWrap | ( |  | ) | const

Search for all occurrences

void setCornerButtonEnabled | ( | bool | enable | ) |

Search for all occurrences

bool isCornerButtonEnabled | ( |  | ) | const

Search for all occurrences

QRect visualRect | ( | const QModelIndex & | index | ) | const `[virtual]`

Search for all occurrences

Implements QAbstractItemView.

void scrollTo | ( | const QModelIndex & | index,
|  | ScrollHint | hint = `EnsureVisible`
| ) |  | `[virtual]`

Search for all occurrences

Implements QAbstractItemView.

QModelIndex indexAt | ( | const QPoint & | p | ) | const `[virtual]`

Search for all occurrences

Implements QAbstractItemView.

void setSpan | ( | int | row,
|  | int | column,
|  | int | rowSpan,
|  | int | columnSpan
| ) |  |

Search for all occurrences

int rowSpan | ( | int | row,
|  | int | column
| ) |  | const

Search for all occurrences

int columnSpan | ( | int | row,
|  | int | column
| ) |  | const

Search for all occurrences

void clearSpans | ( |  | ) |

Search for all occurrences

void sortByColumn | ( | int | column,
|  | Qt::SortOrder | order
| ) |  |

Search for all occurrences

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

Search for all occurrences

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

Search for all occurrences

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

Search for all occurrences

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

Search for all occurrences

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

Search for all occurrences

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

Search for all occurrences

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

Search for all occurrences

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

Search for all occurrences

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

Search for all occurrences

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

Search for all occurrences

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

Search for all occurrences

void setShowGrid | ( | bool | show | ) | `[slot]`

Search for all occurrences

void rowMoved | ( | int | row,
|  | int | oldIndex,
|  | int | newIndex
| ) |  | `[protected, slot]`

Search for all occurrences

void columnMoved | ( | int | column,
|  | int | oldIndex,
|  | int | newIndex
| ) |  | `[protected, slot]`

Search for all occurrences

void rowResized | ( | int | row,
|  | int | oldHeight,
|  | int | newHeight
| ) |  | `[protected, slot]`

Search for all occurrences

void columnResized | ( | int | column,
|  | int | oldWidth,
|  | int | newWidth
| ) |  | `[protected, slot]`

Search for all occurrences

void rowCountChanged | ( | int | oldCount,
|  | int | newCount
| ) |  | `[protected, slot]`

Search for all occurrences

void columnCountChanged | ( | int | oldCount,
|  | int | newCount
| ) |  | `[protected, slot]`

Search for all occurrences

void scrollContentsBy | ( | int | dx,
|  | int | dy
| ) |  | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

QStyleOptionViewItem viewOptions | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void paintEvent | ( | QPaintEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

void timerEvent | ( | QTimerEvent * | event | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

int horizontalOffset | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

Implements QAbstractItemView.

int verticalOffset | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

Implements QAbstractItemView.

QModelIndex moveCursor | ( | CursorAction | cursorAction,
|  | Qt::KeyboardModifiers | modifiers
| ) |  | `[protected, virtual]`

Search for all occurrences

Implements QAbstractItemView.

void setSelection | ( | const QRect & | rect,
|  | QItemSelectionModel::SelectionFlags | command
| ) |  | `[protected, virtual]`

Search for all occurrences

Implements QAbstractItemView.

QRegion visualRegionForSelection | ( | const QItemSelection & | selection | ) | const `[protected, virtual]`

Search for all occurrences

Implements QAbstractItemView.

QModelIndexList selectedIndexes | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void updateGeometries | ( |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

int sizeHintForRow | ( | int | row | ) | const `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

int sizeHintForColumn | ( | int | column | ) | const `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void verticalScrollbarAction | ( | int | action | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void horizontalScrollbarAction | ( | int | action | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

bool isIndexHidden | ( | const QModelIndex & | index | ) | const `[protected, virtual]`

Search for all occurrences

Implements QAbstractItemView.

void selectionChanged | ( | const QItemSelection & | selected,
|  | const QItemSelection & | deselected
| ) |  | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void currentChanged | ( | const QModelIndex & | current,
|  | const QModelIndex & | previous
| ) |  | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

## Friends And Related Function Documentation

friend class QAccessibleItemView `[friend]`

Search for all occurrences

Definition at line 178 of file qtableview.h.

## Property Documentation

bool showGrid `[read, write]`

Search for all occurrences

Definition at line 61 of file qtableview.h.

Qt::PenStyle gridStyle `[read, write]`

Search for all occurrences

Definition at line 62 of file qtableview.h.

bool sortingEnabled `[read, write]`

Search for all occurrences

Definition at line 63 of file qtableview.h.

bool wordWrap `[read, write]`

Search for all occurrences

Definition at line 64 of file qtableview.h.

bool cornerButtonEnabled `[read, write]`

Search for all occurrences

Definition at line 65 of file qtableview.h.

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

- QtGui/qtableview.h

QTableView QTableView QTableView QTableView QTableView QTableView QTableView QTableView QTableView QTableView
QTableView QTableView QTableView QTableView QTableView QTableView QTableView QTableView QTableView QTableView