Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.gui
Class QTableView

    java.lang.Object
      com.trolltech.qt.internal.QSignalEmitterInternal
          com.trolltech.qt.QSignalEmitter
              com.trolltech.qt.QtJambiObject
                  com.trolltech.qt.core.QObject
                      com.trolltech.qt.gui.QWidget
                          com.trolltech.qt.gui.QFrame
                              com.trolltech.qt.gui.QAbstractScrollArea
                                  com.trolltech.qt.gui.QAbstractItemView
                                      com.trolltech.qt.gui.QTableView

All Implemented Interfaces:
  QPaintDeviceInterface, QtJambiInterface

Direct Known Subclasses:
  QTableWidget

    public class QTableView

extends QAbstractItemView

The QTableView class provides a default model/view implementation of a table view. A QTableView implements a table view that displays items from a model. This class is used to provide standard tables that were previously provided by the QTable class, but using the more flexible approach provided by Qt's model/view architecture.

The QTableView class is one of the Model/View Classes and is part of Qt's model/view framework.

QTableView implements the interfaces defined by the `QAbstractItemView` class to allow it to display data provided by models derived from the `QAbstractItemModel` class.

## Navigation

You can navigate the cells in the table by clicking on a cell with the mouse, or by using the arrow keys. Because QTableView enables `tabKeyNavigation` by default, you can also hit Tab and Backtab to move from cell to cell.

## Visual Appearance

The table has a vertical header that can be obtained using the `verticalHeader()` function, and a horizontal header that is available through the `horizontalHeader()` function. The height of each row in the table can be found by using `rowHeight()`; similarly, the width of columns can be found using `columnWidth()`. Since both of these are plain widgets, you can hide either of them using their `hide()` functions.

Rows and columns can be hidden and shown with `hideRow()`, `hideColumn()`, `showRow()`, and `showColumn()`. They can be selected with `selectRow()` and `selectColumn()`. The table will show a grid depending on the `showGrid` property.

The items shown in a table view, like those in the other item views, are rendered and edited using standard `delegates`. However, for some tasks it is sometimes useful to be able to insert widgets in a table instead. Widgets are set for particular indexes with the `setIndexWidget()` function, and later retrieved with `indexWidget()`.

| By default, the cells in a table do not expand to fill the available space. You can make the cells fill the available space by stretching the last header section. Access the relevant header using `horizontalHeader()` or `verticalHeader()` and set the header's `stretchLastSection` property. To distribute the available space according to the space requirement of each column or row, call the view's `resizeColumnsToContents()` or `resizeRowsToContents()` functions.

## Coordinate Systems

For some specialized forms of tables it is useful to be able to convert between row and column indexes and widget coordinates. The `rowAt()` function provides the y-coordinate within the view of the specified row; the row index can be used to obtain a corresponding y-coordinate with `rowViewportPosition()`. The `columnAt()` and `columnViewportPosition()` functions provide the equivalent conversion operations between x-coordinates and column indexes.

## Styles

QTableView is styled appropriately for each platform. The following images show how it looks on three different platforms. Go to the Qt Widget Gallery to see its appearance in other styles.

A Windows XP style table view. | A Macintosh style table view. | A Plastique style table view.

See also:
  `QTableWidget`, View Classes, `QAbstractItemModel`, `QAbstractItemView`, Chart Example, Pixelator Example, and Table Model Example.

Nested Class Summary

Nested classes/interfaces inherited from class com.trolltech.qt.gui.QAbstractItemView
`QAbstractItemView.CursorAction, QAbstractItemView.DragDropMode, QAbstractItemView.DropIndicatorPosition, QAbstractItemView.EditTrigger, QAbstractItemView.EditTriggers, QAbstractItemView.ScrollHint, QAbstractItemView.ScrollMode, QAbstractItemView.SelectionBehavior, QAbstractItemView.SelectionMode, QAbstractItemView.State`

Nested classes/interfaces inherited from class com.trolltech.qt.gui.QFrame
`QFrame.Shadow, QFrame.Shape, QFrame.StyleMask`

Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget
`QWidget.RenderFlag, QWidget.RenderFlags`

Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
`QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9`

Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
`com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal`

Field Summary

Fields inherited from class com.trolltech.qt.gui.QAbstractItemView
`activated, clicked, doubleClicked, entered, pressed, viewportEntered`

Fields inherited from class com.trolltech.qt.gui.QWidget
`customContextMenuRequested`

Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
`currentSender`

Constructor Summary
`QTableView()` Constructs a table view with a `parent` to represent the data.
`QTableView(QWidget parent)` Constructs a table view with a `parent` to represent the data.

Method Summary
`void` | `clearSpans()` Removes all row and column spans in the table view.
`int` | `columnAt(int x)` Returns the column in which the given x-coordinate, `x`, in contents coordinates is located.
`protected void` | `columnCountChanged(int oldCount, int newCount)` This slot is called whenever columns are added or deleted.
`protected void` | `columnMoved(int column, int oldIndex, int newIndex)` This slot is called to change the index of the given `column` in the table view.
`protected void` | `columnResized(int column, int oldWidth, int newWidth)` This slot is called to change the width of the given `column`.
`int` | `columnSpan(int row, int column)` Returns the column span of the table element at (`row`, `column`).
`int` | `columnViewportPosition(int column)` Returns the x-coordinate in contents coordinates of the given `column`.
`int` | `columnWidth(int column)` Returns the width of the given `column`.
`Qt.PenStyle` | `gridStyle()` This property holds the pen style used to draw the grid.
`void` | `hideColumn(int column)` Hide the given `column`.
`void` | `hideRow(int row)` Hide the given `row`.
`QHeaderView` | `horizontalHeader()` Returns the table view's horizontal header.
`boolean` | `isColumnHidden(int column)` Returns true if the given `column` is hidden; otherwise returns false.
`boolean` | `isCornerButtonEnabled()` This property holds whether the button in the top-left corner is enabled.
`boolean` | `isRowHidden(int row)` Returns true if the given `row` is hidden; otherwise returns false.
`boolean` | `isSortingEnabled()` This property holds whether sorting is enabled.
`void` | `resizeColumnsToContents()` Resizes all columns based on the size hints of the delegate used to render each item in the columns.
`void` | `resizeColumnToContents(int column)` Resizes the given `column` based on the size hints of the delegate used to render each item in the column.
`void` | `resizeRowsToContents()` Resizes all rows based on the size hints of the delegate used to render each item in the rows.
`void` | `resizeRowToContents(int row)` Resizes the given `row` based on the size hints of the delegate used to render each item in the row.
`int` | `rowAt(int y)` Returns the row in which the given y-coordinate, `y`, in contents coordinates is located.
`protected void` | `rowCountChanged(int oldCount, int newCount)` This slot is called whenever rows are added or deleted.
`int` | `rowHeight(int row)` Returns the height of the given `row`.
`protected void` | `rowMoved(int row, int oldIndex, int newIndex)` This slot is called to change the index of the given `row` in the table view.
`protected void` | `rowResized(int row, int oldHeight, int newHeight)` This slot is called to change the height of the given `row`.
`int` | `rowSpan(int row, int column)` Returns the row span of the table element at (`row`, `column`).
`int` | `rowViewportPosition(int row)` Returns the y-coordinate in contents coordinates of the given `row`.
`void` | `selectColumn(int column)` Selects the given `column` in the table view if the current `SelectionMode` and `SelectionBehavior` allows columns to be selected.
`void` | `selectRow(int row)` Selects the given `row` in the table view if the current `SelectionMode` and `SelectionBehavior` allows rows to be selected.
`void` | `setColumnHidden(int column, boolean hide)` If `hide` is true the given `column` will be hidden; otherwise it will be shown.
`void` | `setColumnWidth(int column, int width)` Sets the width of the given `column` to be `width`.
`void` | `setCornerButtonEnabled(boolean enable)` This property holds whether the button in the top-left corner is enabled.
`void` | `setGridStyle(Qt.PenStyle style)` This property holds the pen style used to draw the grid.
`void` | `setHorizontalHeader(QHeaderView header)` Sets the widget to use for the horizontal header to `header`.
`void` | `setRowHeight(int row, int height)` Sets the height of the given `row` to be `height`.
`void` | `setRowHidden(int row, boolean hide)` If `hide` is true `row` will be hidden, otherwise it will be shown.
`void` | `setShowGrid(boolean show)` This property holds whether the grid is shown.
`void` | `setSortingEnabled(boolean enable)` This property holds whether sorting is enabled.
`void` | `setSpan(int row, int column, int rowSpan, int columnSpan)` Sets the span of the table element at (`row`, `column`) to the number of rows and columns specified by (`rowSpanCount`, `columnSpanCount`).
`void` | `setVerticalHeader(QHeaderView header)` Sets the widget to use for the vertical header to `header`.
`void` | `setWordWrap(boolean on)` This property holds the item text word-wrapping policy.
`void` | `showColumn(int column)` Show the given `column`.
`boolean` | `showGrid()` This property holds whether the grid is shown.
`void` | `showRow(int row)` Show the given `row`.
`void` | `sortByColumn(int column, Qt.SortOrder order)` Sorts the model by the values in the given `column` in the given `order`.
`QHeaderView` | `verticalHeader()` Returns the table view's vertical header.
`boolean` | `wordWrap()` This property holds the item text word-wrapping policy.

Methods inherited from class com.trolltech.qt.gui.QAbstractItemView
`alternatingRowColors, autoScrollMargin, clearSelection, closeEditor, closePersistentEditor, commitData, currentChanged, currentIndex, dataChanged, dirtyRegionOffset, dragDropMode, dragDropOverwriteMode, dragEnabled, dropIndicatorPosition, edit, edit, editorDestroyed, editTriggers, executeDelayedItemsLayout, hasAutoScroll, horizontalOffset, horizontalScrollMode, iconSize, indexAt, indexWidget, isIndexHidden, itemDelegate, itemDelegate, itemDelegateForColumn, itemDelegateForRow, keyboardSearch, model, moveCursor, openPersistentEditor, reset, rootIndex, rowsAboutToBeRemoved, rowsInserted, scheduleDelayedItemsLayout, scrollDirtyRegion, scrollTo, scrollTo, scrollToBottom, scrollToTop, selectAll, selectedIndexes, selectionBehavior, selectionChanged, selectionCommand, selectionCommand, selectionMode, selectionModel, setAlternatingRowColors, setAutoScroll, setAutoScrollMargin, setCurrentIndex, setDirtyRegion, setDragDropMode, setDragDropOverwriteMode, setDragEnabled, setDropIndicatorShown, setEditTriggers, setEditTriggers, setHorizontalScrollMode, setIconSize, setIndexWidget, setItemDelegate, setItemDelegateForColumn, setItemDelegateForRow, setModel, setRootIndex, setSelection, setSelectionBehavior, setSelectionMode, setSelectionModel, setState, setTabKeyNavigation, setTextElideMode, setVerticalScrollMode, showDropIndicator, sizeHintForColumn, sizeHintForIndex, sizeHintForRow, startDrag, startDrag, state, tabKeyNavigation, textElideMode, update, updateGeometries, verticalOffset, verticalScrollMode, viewOptions, visualRect, visualRegionForSelection`

Methods inherited from class com.trolltech.qt.gui.QAbstractScrollArea
`addScrollBarWidget, addScrollBarWidget, cornerWidget, horizontalScrollBar, horizontalScrollBarPolicy, maximumViewportSize, scrollBarWidgets, scrollBarWidgets, scrollContentsBy, setCornerWidget, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setupViewport, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportMargins, verticalScrollBar, verticalScrollBarPolicy, viewport, viewportEvent`

Methods inherited from class com.trolltech.qt.gui.QFrame
`frameRect, frameShadow, frameShape, frameStyle, frameWidth, lineWidth, midLineWidth, setFrameRect, setFrameShadow, setFrameShape, setFrameStyle, setLineWidth, setMidLineWidth`

Methods inherited from class com.trolltech.qt.gui.QWidget
`acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, changeEvent, childAt, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, contentsRect, contextMenuEvent, contextMenuPolicy, cursor, depth, destroy, destroy, destroy, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, effectiveWinId, ensurePolished, enterEvent, focusInEvent, focusNextChild, focusNextPrevChild, focusOutEvent, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabKeyboard, grabMouse, grabMouse, grabShortcut, grabShortcut, hasFocus, hasMouseTracking, height, heightForWidth, heightMM, hide, hideEvent, inputContext, inputMethodEvent, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isFullScreen, isHidden, isMaximized, isMinimized, isModal, isVisible, isVisibleTo, isWindow, isWindowModified, keyboardGrabber, keyPressEvent, keyReleaseEvent, languageChange, layout, layoutDirection, leaveEvent, locale, logicalDpiX, logicalDpiY, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, move, moveEvent, nativeParentWidget, nextInFocusChain, normalGeometry, numColors, overrideWindowFlags, overrideWindowFlags, overrideWindowState, paintEngine, paintEvent, paintingActive, palette, parentWidget, physicalDpiX, physicalDpiY, pos, raise, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, render, render, render, render, render, render, render, render, repaint, repaint, repaint, repaint, resetInputContext, resize, resize, resizeEvent, restoreGeometry, saveGeometry, scroll, scroll, setAcceptDrops, setAccessibleDescription, setAccessibleName, setAttribute, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setBaseSize, setContentsMargins, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedSize, setFixedWidth, setFocus, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setGeometry, setHidden, setInputContext, setLayout, setLayoutDirection, setLocale, setMask, setMask, setMaximumHeight, setMaximumSize, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setParent, setParent, setShortcutAutoRepeat, setShortcutAutoRepeat, setShortcutEnabled, setShortcutEnabled, setSizeIncrement, setSizeIncrement, setSizePolicy, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFilePath, setWindowFlags, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowState, setWindowTitle, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, toolTip, underMouse, unsetCursor, unsetLayoutDirection, unsetLocale, update, update, update, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, wheelEvent, width, widthMM, window, windowFilePath, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, winId, x, y`

Methods inherited from class com.trolltech.qt.core.QObject
`childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty`

Methods inherited from class com.trolltech.qt.QtJambiObject
`dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr`

Methods inherited from class com.trolltech.qt.QSignalEmitter
`blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread`

Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
`__qt_signalInitialization`

Methods inherited from class java.lang.Object
`clone, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface com.trolltech.qt.QtJambiInterface
`disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership`

Constructor Detail

### QTableView

    public QTableView()

  Constructs a table view with a `parent` to represent the data.

See also:
  `QAbstractItemModel`.

### QTableView

    public QTableView(QWidget parent)

  Constructs a table view with a `parent` to represent the data.

See also:
  `QAbstractItemModel`.

Method Detail

### clearSpans

    public final void clearSpans()

  Removes all row and column spans in the table view.

See also:
  `setSpan()`.

### columnAt

    public final int columnAt(int x)

  Returns the column in which the given x-coordinate, `x`, in contents coordinates is located.

  Note: This function returns -1 if the given coordinate is not valid (has no column).

See also:
  `rowAt()`.

### columnCountChanged

    protected final void columnCountChanged(int oldCount,
                                            int newCount)

  This slot is called whenever columns are added or deleted. The previous number of columns is specified by `oldCount`, and the new number of columns is specified by `newCount`.

### columnMoved

    protected final void columnMoved(int column,
                                     int oldIndex,
                                     int newIndex)

  This slot is called to change the index of the given `column` in the table view. The old index is specified by `oldIndex`, and the new index by `newIndex`.

See also:
  `rowMoved()`.

### columnResized

    protected final void columnResized(int column,
                                       int oldWidth,
                                       int newWidth)

  This slot is called to change the width of the given `column`. The old width is specified by `oldWidth`, and the new width by `newWidth`.

See also:
  `rowResized()`.

### columnSpan

    public final int columnSpan(int row,
                                int column)

  Returns the column span of the table element at (`row`, `column`). The default is 1.

See also:
  `setSpan()`, and `rowSpan()`.

### columnViewportPosition

    public final int columnViewportPosition(int column)

  Returns the x-coordinate in contents coordinates of the given `column`.

### columnWidth

    public final int columnWidth(int column)

  Returns the width of the given `column`.

See also:
  `setColumnWidth()`, `resizeColumnToContents()`, and `rowHeight()`.

### gridStyle

    public final Qt.PenStyle gridStyle()

  This property holds the pen style used to draw the grid. This property holds the style used when drawing the grid (see `showGrid`).

### hideColumn

    public final void hideColumn(int column)

  Hide the given `column`.

See also:
  `showColumn()`, and `hideRow()`.

### hideRow

    public final void hideRow(int row)

  Hide the given `row`.

See also:
  `showRow()`, and `hideColumn()`.

### horizontalHeader

    public final QHeaderView horizontalHeader()

  Returns the table view's horizontal header.

See also:
  `setHorizontalHeader()`, `verticalHeader()`, and `QAbstractItemModel::headerData()`.

### isColumnHidden

    public final boolean isColumnHidden(int column)

  Returns true if the given `column` is hidden; otherwise returns false.

See also:
  `isRowHidden()`.

### isCornerButtonEnabled

    public final boolean isCornerButtonEnabled()

  This property holds whether the button in the top-left corner is enabled. If this property is true then button in the top-left corner of the table view is enabled. Clicking on this button will select all the cells in the table view.

  This property is true by default.

### isRowHidden

    public final boolean isRowHidden(int row)

  Returns true if the given `row` is hidden; otherwise returns false.

See also:
  `isColumnHidden()`.

### isSortingEnabled

    public final boolean isSortingEnabled()

  This property holds whether sorting is enabled. If this property is true, sorting is enabled for the table; if the property is false, sorting is not enabled. The default value is false.

See also:
  `sortByColumn()`.

### resizeColumnToContents

    public final void resizeColumnToContents(int column)

  Resizes the given `column` based on the size hints of the delegate used to render each item in the column.

### resizeColumnsToContents

    public final void resizeColumnsToContents()

  Resizes all columns based on the size hints of the delegate used to render each item in the columns.

### resizeRowToContents

    public final void resizeRowToContents(int row)

  Resizes the given `row` based on the size hints of the delegate used to render each item in the row.

### resizeRowsToContents

    public final void resizeRowsToContents()

  Resizes all rows based on the size hints of the delegate used to render each item in the rows.

### rowAt

    public final int rowAt(int y)

  Returns the row in which the given y-coordinate, `y`, in contents coordinates is located.

  Note: This function returns -1 if the given coordinate is not valid (has no row).

See also:
  `columnAt()`.

### rowCountChanged

    protected final void rowCountChanged(int oldCount,
                                         int newCount)

  This slot is called whenever rows are added or deleted. The previous number of rows is specified by `oldCount`, and the new number of rows is specified by `newCount`.

### rowHeight

    public final int rowHeight(int row)

  Returns the height of the given `row`.

See also:
  `setRowHeight()`, `resizeRowToContents()`, and `columnWidth()`.

### rowMoved

    protected final void rowMoved(int row,
                                  int oldIndex,
                                  int newIndex)

  This slot is called to change the index of the given `row` in the table view. The old index is specified by `oldIndex`, and the new index by `newIndex`.

See also:
  `columnMoved()`.

### rowResized

    protected final void rowResized(int row,
                                    int oldHeight,
                                    int newHeight)

  This slot is called to change the height of the given `row`. The old height is specified by `oldHeight`, and the new height by `newHeight`.

See also:
  `columnResized()`.

### rowSpan

    public final int rowSpan(int row,
                             int column)

  Returns the row span of the table element at (`row`, `column`). The default is 1.

See also:
  `setSpan()`, and `columnSpan()`.

### rowViewportPosition

    public final int rowViewportPosition(int row)

  Returns the y-coordinate in contents coordinates of the given `row`.

### selectColumn

    public final void selectColumn(int column)

  Selects the given `column` in the table view if the current `SelectionMode` and `SelectionBehavior` allows columns to be selected.

See also:
  `selectRow()`.

### selectRow

    public final void selectRow(int row)

  Selects the given `row` in the table view if the current `SelectionMode` and `SelectionBehavior` allows rows to be selected.

See also:
  `selectColumn()`.

### setColumnHidden

    public final void setColumnHidden(int column,
                                      boolean hide)

  If `hide` is true the given `column` will be hidden; otherwise it will be shown.

See also:
  `isColumnHidden()`, and `setRowHidden()`.

### setColumnWidth

    public final void setColumnWidth(int column,
                                     int width)

  Sets the width of the given `column` to be `width`.

See also:
  `columnWidth()`.

### setCornerButtonEnabled

    public final void setCornerButtonEnabled(boolean enable)

  This property holds whether the button in the top-left corner is enabled. If this property is true then button in the top-left corner of the table view is enabled. Clicking on this button will select all the cells in the table view.

  This property is true by default.

### setGridStyle

    public final void setGridStyle(Qt.PenStyle style)

  This property holds the pen style used to draw the grid. This property holds the style used when drawing the grid (see `showGrid`).

### setHorizontalHeader

    public final void setHorizontalHeader(QHeaderView header)

  Sets the widget to use for the horizontal header to `header`.

See also:
  `horizontalHeader()`, and `setVerticalHeader()`.

### setRowHeight

    public final void setRowHeight(int row,
                                   int height)

  Sets the height of the given `row` to be `height`.

See also:
  `rowHeight()`.

### setRowHidden

    public final void setRowHidden(int row,
                                   boolean hide)

  If `hide` is true `row` will be hidden, otherwise it will be shown.

See also:
  `isRowHidden()`, and `setColumnHidden()`.

### setShowGrid

    public final void setShowGrid(boolean show)

  This property holds whether the grid is shown. If this property is true a grid is drawn for the table; if the property is false, no grid is drawn. The default value is true.

### setSortingEnabled

    public final void setSortingEnabled(boolean enable)

  This property holds whether sorting is enabled. If this property is true, sorting is enabled for the table; if the property is false, sorting is not enabled. The default value is false.

See also:
  `sortByColumn()`.

### setSpan

    public final void setSpan(int row,
                              int column,
                              int rowSpan,
                              int columnSpan)

  Sets the span of the table element at (`row`, `column`) to the number of rows and columns specified by (`rowSpanCount`, `columnSpanCount`).

See also:
  `rowSpan()`, and `columnSpan()`.

### setVerticalHeader

    public final void setVerticalHeader(QHeaderView header)

  Sets the widget to use for the vertical header to `header`.

See also:
  `verticalHeader()`, and `setHorizontalHeader()`.

### setWordWrap

    public final void setWordWrap(boolean on)

  This property holds the item text word-wrapping policy. If this property is true then the item text is wrapped where necessary at word-breaks; otherwise it is not wrapped at all. This property is true by default.

  Note that even of wrapping is enabled, the cell will not be expanded to fit all text. Ellipsis will be inserted according to the current `textElideMode`.

### showColumn

    public final void showColumn(int column)

  Show the given `column`.

See also:
  `hideColumn()`, and `showRow()`.

### showGrid

    public final boolean showGrid()

  This property holds whether the grid is shown. If this property is true a grid is drawn for the table; if the property is false, no grid is drawn. The default value is true.

### showRow

    public final void showRow(int row)

  Show the given `row`.

See also:
  `hideRow()`, and `showColumn()`.

### sortByColumn

    public final void sortByColumn(int column,
                                   Qt.SortOrder order)

  Sorts the model by the values in the given `column` in the given `order`.

See also:
  `sortingEnabled`.

### verticalHeader

    public final QHeaderView verticalHeader()

  Returns the table view's vertical header.

See also:
  `setVerticalHeader()`, `horizontalHeader()`, and `QAbstractItemModel::headerData()`.

### wordWrap

    public final boolean wordWrap()

  This property holds the item text word-wrapping policy. If this property is true then the item text is wrapped where necessary at word-breaks; otherwise it is not wrapped at all. This property is true by default.

  Note that even of wrapping is enabled, the cell will not be expanded to fit all text. Ellipsis will be inserted according to the current `textElideMode`.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD