CopperSpice API  1.7.2
QTableView Class Reference

The QTableView class provides a default model/view implementation of a table view. More...

Inheritance diagram for QTableView:
QAbstractItemView QAbstractScrollArea QFrame QWidget QObject QPaintDevice QTableWidget

Public Slots

void hideColumn (int column)
 
void hideRow (int row)
 
void resizeColumnsToContents ()
 
void resizeColumnToContents (int column)
 
void resizeRowsToContents ()
 
void resizeRowToContents (int row)
 
void selectColumn (int column)
 
void selectRow (int row)
 
void setShowGrid (bool show)
 
void showColumn (int column)
 
void showRow (int row)
 
void sortByColumn (int column)
 
- Public Slots inherited from QAbstractItemView
void clearSelection ()
 
void edit (const QModelIndex &index)
 
virtual void reset ()
 
void scrollToBottom ()
 
void scrollToTop ()
 
virtual void selectAll ()
 
void setCurrentIndex (const QModelIndex &index)
 
virtual void setRootIndex (const QModelIndex &index)
 
void update (const QModelIndex &index)
 
- Public Slots inherited from QWidget
bool close ()
 
void hide ()
 
void lower ()
 
void raise ()
 
void repaint ()
 
void setDisabled (bool disable)
 
void setEnabled (bool enable)
 
void setFocus ()
 
void setHidden (bool hidden)
 
void setStyleSheet (const QString &styleSheet)
 
virtual void setVisible (bool visible)
 
void setWindowModified (bool modified)
 
void setWindowTitle (const QString &title)
 
void show ()
 
void showFullScreen ()
 
void showMaximized ()
 
void showMinimized ()
 
void showNormal ()
 
void update ()
 
- Public Slots inherited from QObject
void deleteLater ()
 

Public Methods

 QTableView (QWidget *parent=nullptr)
 
 ~QTableView ()
 
void clearSpans ()
 
int columnAt (int x) const
 
int columnSpan (int row, int column) const
 
int columnViewportPosition (int column) const
 
int columnWidth (int column) const
 
Qt::PenStyle gridStyle () const
 
QHeaderViewhorizontalHeader () const
 
QModelIndex indexAt (const QPoint &pos) const override
 
bool isColumnHidden (int column) const
 
bool isCornerButtonEnabled () const
 
bool isRowHidden (int row) const
 
bool isSortingEnabled () const
 
int rowAt (int y) const
 
int rowHeight (int row) const
 
int rowSpan (int row, int column) const
 
int rowViewportPosition (int row) const
 
void scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible) override
 
void setColumnHidden (int column, bool hide)
 
void setColumnWidth (int column, int width)
 
void setCornerButtonEnabled (bool enable)
 
void setGridStyle (Qt::PenStyle style)
 
void setHorizontalHeader (QHeaderView *header)
 
void setModel (QAbstractItemModel *model) override
 
void setRootIndex (const QModelIndex &index) override
 
void setRowHeight (int row, int height)
 
void setRowHidden (int row, bool hide)
 
void setSelectionModel (QItemSelectionModel *selectionModel) override
 
void setSortingEnabled (bool enable)
 
void setSpan (int row, int column, int rowSpanCount, int columnSpanCount)
 
void setVerticalHeader (QHeaderView *header)
 
void setWordWrap (bool on)
 
bool showGrid () const
 
void sortByColumn (int column, Qt::SortOrder order)
 
QHeaderViewverticalHeader () const
 
QRect visualRect (const QModelIndex &index) const override
 
bool wordWrap () const
 
- Public Methods inherited from QAbstractItemView
 QAbstractItemView (QWidget *parent=nullptr)
 
 ~QAbstractItemView ()
 
bool alternatingRowColors () const
 
int autoScrollMargin () const
 
void closePersistentEditor (const QModelIndex &index)
 
QModelIndex currentIndex () const
 
Qt::DropAction defaultDropAction () const
 
DragDropMode dragDropMode () const
 
bool dragDropOverwriteMode () const
 
bool dragEnabled () const
 
EditTriggers editTriggers () const
 
bool hasAutoScroll () const
 
ScrollMode horizontalScrollMode () const
 
QSize iconSize () const
 
QWidgetindexWidget (const QModelIndex &index) const
 
QVariant inputMethodQuery (Qt::InputMethodQuery query) const override
 
QAbstractItemDelegateitemDelegate () const
 
QAbstractItemDelegateitemDelegate (const QModelIndex &index) const
 
QAbstractItemDelegateitemDelegateForColumn (int column) const
 
QAbstractItemDelegateitemDelegateForRow (int row) const
 
virtual void keyboardSearch (const QString &search)
 
QAbstractItemModelmodel () const
 
void openPersistentEditor (const QModelIndex &index)
 
QModelIndex rootIndex () const
 
QAbstractItemView::SelectionBehavior selectionBehavior () const
 
QAbstractItemView::SelectionMode selectionMode () const
 
QItemSelectionModelselectionModel () const
 
void setAlternatingRowColors (bool enable)
 
void setAutoScroll (bool enable)
 
void setAutoScrollMargin (int margin)
 
void setDefaultDropAction (Qt::DropAction dropAction)
 
void setDragDropMode (DragDropMode behavior)
 
void setDragDropOverwriteMode (bool overwrite)
 
void setDragEnabled (bool enable)
 
void setDropIndicatorShown (bool enable)
 
void setEditTriggers (EditTriggers triggers)
 
void setHorizontalScrollMode (ScrollMode mode)
 
void setIconSize (const QSize &size)
 
void setIndexWidget (const QModelIndex &index, QWidget *widget)
 
void setItemDelegate (QAbstractItemDelegate *delegate)
 
void setItemDelegateForColumn (int column, QAbstractItemDelegate *delegate)
 
void setItemDelegateForRow (int row, QAbstractItemDelegate *delegate)
 
void setSelectionBehavior (QAbstractItemView::SelectionBehavior behavior)
 
void setSelectionMode (QAbstractItemView::SelectionMode mode)
 
void setTabKeyNavigation (bool enable)
 
void setTextElideMode (Qt::TextElideMode mode)
 
void setVerticalScrollMode (ScrollMode mode)
 
bool showDropIndicator () const
 
QSize sizeHintForIndex (const QModelIndex &index) const
 
bool tabKeyNavigation () const
 
Qt::TextElideMode textElideMode () const
 
ScrollMode verticalScrollMode () const
 
- Public Methods inherited from QAbstractScrollArea
 QAbstractScrollArea (QWidget *parent=nullptr)
 
 ~QAbstractScrollArea ()
 
void addScrollBarWidget (QWidget *widget, Qt::Alignment alignment)
 
QWidgetcornerWidget () const
 
QScrollBarhorizontalScrollBar () const
 
Qt::ScrollBarPolicy horizontalScrollBarPolicy () const
 
QSize maximumViewportSize () const
 
QSize minimumSizeHint () const override
 
QWidgetList scrollBarWidgets (Qt::Alignment alignment)
 
void setCornerWidget (QWidget *widget)
 
void setHorizontalScrollBar (QScrollBar *scrollBar)
 
void setHorizontalScrollBarPolicy (Qt::ScrollBarPolicy)
 
void setSizeAdjustPolicy (SizeAdjustPolicy policy)
 
virtual void setupViewport (QWidget *viewport)
 
void setVerticalScrollBar (QScrollBar *scrollBar)
 
void setVerticalScrollBarPolicy (Qt::ScrollBarPolicy)
 
void setViewport (QWidget *widget)
 
SizeAdjustPolicy sizeAdjustPolicy () const
 
QSize sizeHint () const override
 
QScrollBarverticalScrollBar () const
 
Qt::ScrollBarPolicy verticalScrollBarPolicy () const
 
QWidgetviewport () const
 
- Public Methods inherited from QFrame
 QFrame (QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::EmptyFlag)
 
 ~QFrame ()
 
QRect frameRect () const
 
Shadow frameShadow () const
 
Shape frameShape () const
 
int frameStyle () const
 
int frameWidth () const
 
int lineWidth () const
 
int midLineWidth () const
 
void setFrameRect (const QRect &)
 
void setFrameShadow (Shadow)
 
void setFrameShape (Shape)
 
void setFrameStyle (int style)
 
void setLineWidth (int)
 
void setMidLineWidth (int)
 
QSize sizeHint () const override
 
- Public Methods inherited from QWidget
 QWidget (QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::EmptyFlag)
 
 ~QWidget ()
 
bool acceptDrops () const
 
QString accessibleDescription () const
 
QString accessibleName () const
 
QList< QAction * > actions () const
 
void activateWindow ()
 
void addAction (QAction *action)
 
void addActions (const QList< QAction * > &actions)
 
void adjustSize ()
 
bool autoFillBackground () const
 
QPalette::ColorRole backgroundRole () const
 
QBackingStorebackingStore () const
 
QSize baseSize () const
 
QWidget * childAt (const QPoint &position) const
 
QWidget * childAt (int x, int y) const
 
QRect childrenRect () const
 
QRegion childrenRegion () const
 
void clearFocus ()
 
void clearMask ()
 
QMargins contentsMargins () const
 
QRect contentsRect () const
 
Qt::ContextMenuPolicy contextMenuPolicy () const
 
QCursor cursor () const
 
WId effectiveWinId () const
 
void ensurePolished () const
 
Qt::FocusPolicy focusPolicy () const
 
QWidget * focusProxy () const
 
QWidget * focusWidget () const
 
const QFontfont () const
 
QFontInfo fontInfo () const
 
QFontMetrics fontMetrics () const
 
QPalette::ColorRole foregroundRole () const
 
QRect frameGeometry () const
 
QSize frameSize () const
 
const QRectgeometry () const
 
void getContentsMargins (int *left, int *top, int *right, int *bottom) const
 
QPixmap grab (const QRect &rectangle=QRect (QPoint (0, 0), QSize (-1,-1)))
 
void grabGesture (Qt::GestureType gestureType, Qt::GestureFlags flags=Qt::GestureFlags ())
 
void grabKeyboard ()
 
void grabMouse ()
 
void grabMouse (const QCursor &cursor)
 
int grabShortcut (const QKeySequence &key, Qt::ShortcutContext context=Qt::WindowShortcut)
 
QGraphicsEffectgraphicsEffect () const
 
QGraphicsProxyWidgetgraphicsProxyWidget () const
 
bool hasEditFocus () const
 
bool hasFocus () const
 
virtual bool hasHeightForWidth () const
 
bool hasMouseTracking () const
 
int height () const
 
virtual int heightForWidth (int width) const
 
Qt::InputMethodHints inputMethodHints () const
 
void insertAction (QAction *before, QAction *action)
 
void insertActions (QAction *before, QList< QAction * > actions)
 
bool isActiveWindow () const
 
bool isAncestorOf (const QWidget *child) const
 
bool isEnabled () const
 
bool isEnabledTo (const QWidget *parent) const
 
bool isEnabledToTLW () const
 
bool isFullScreen () const
 
bool isHidden () const
 
bool isMaximized () const
 
bool isMinimized () const
 
bool isModal () const
 
bool isTopLevel () const
 
bool isVisible () const
 
bool isVisibleTo (const QWidget *parent) const
 
bool isWindow () const
 
bool isWindowModified () const
 
QLayoutlayout () const
 
Qt::LayoutDirection layoutDirection () const
 
QLocale locale () const
 
QPoint mapFrom (const QWidget *parent, const QPoint &pos) const
 
QPoint mapFromGlobal (const QPoint &pos) const
 
QPoint mapFromParent (const QPoint &pos) const
 
QPoint mapTo (const QWidget *parent, const QPoint &pos) const
 
QPoint mapToGlobal (const QPoint &pos) const
 
QPoint mapToParent (const QPoint &pos) const
 
QRegion mask () const
 
int maximumHeight () const
 
QSize maximumSize () const
 
int maximumWidth () const
 
int minimumHeight () const
 
QSize minimumSize () const
 
int minimumWidth () const
 
void move (const QPoint &point)
 
void move (int x, int y)
 
QWidget * nativeParentWidget () const
 
QWidget * nextInFocusChain () const
 
QRect normalGeometry () const
 
void overrideWindowFlags (Qt::WindowFlags flags)
 
QPaintEnginepaintEngine () const override
 
const QPalettepalette () const
 
QWidget * parentWidget () const
 
QPoint pos () const
 
QWidget * previousInFocusChain () const
 
QRect rect () const
 
void releaseKeyboard ()
 
void releaseMouse ()
 
void releaseShortcut (int id)
 
void removeAction (QAction *action)
 
void render (QPaintDevice *target, const QPoint &targetOffset=QPoint (), const QRegion &sourceRegion=QRegion (), RenderFlags renderFlags=RenderFlags (DrawWindowBackground|DrawChildren))
 
void render (QPainter *painter, const QPoint &targetOffset=QPoint (), const QRegion &sourceRegion=QRegion (), RenderFlags renderFlags=RenderFlags (DrawWindowBackground|DrawChildren))
 
void repaint (const QRect &rect)
 
void repaint (const QRegion &region)
 
void repaint (int x, int y, int w, int h)
 
void resize (const QSize &size)
 
void resize (int w, int h)
 
bool restoreGeometry (const QByteArray &geometry)
 
QByteArray saveGeometry () const
 
void scroll (int dx, int dy)
 
void scroll (int dx, int dy, const QRect &rect)
 
void setAcceptDrops (bool on)
 
void setAccessibleDescription (const QString &description)
 
void setAccessibleName (const QString &name)
 
void setAttribute (Qt::WidgetAttribute attribute, bool enable=true)
 
void setAutoFillBackground (bool enable)
 
void setBackgroundRole (QPalette::ColorRole role)
 
void setBaseSize (const QSize &size)
 
void setBaseSize (int basew, int baseh)
 
void setContentsMargins (const QMargins &margins)
 
void setContentsMargins (int left, int top, int right, int bottom)
 
void setContextMenuPolicy (Qt::ContextMenuPolicy policy)
 
void setCursor (const QCursor &cursor)
 
void setEditFocus (bool enable)
 
void setFixedHeight (int h)
 
void setFixedSize (const QSize &size)
 
void setFixedSize (int w, int h)
 
void setFixedWidth (int w)
 
void setFocus (Qt::FocusReason reason)
 
void setFocusPolicy (Qt::FocusPolicy policy)
 
void setFocusProxy (QWidget *widget)
 
void setFont (const QFont &font)
 
void setForegroundRole (QPalette::ColorRole role)
 
void setGeometry (const QRect &rect)
 
void setGeometry (int x, int y, int w, int h)
 
void setGraphicsEffect (QGraphicsEffect *effect)
 
void setInputMethodHints (Qt::InputMethodHints hints)
 
void setLayout (QLayout *layout)
 
void setLayoutDirection (Qt::LayoutDirection direction)
 
void setLocale (const QLocale &locale)
 
void setMask (const QBitmap &bitmap)
 
void setMask (const QRegion &region)
 
void setMaximumHeight (int maxh)
 
void setMaximumSize (const QSize &size)
 
void setMaximumSize (int maxw, int maxh)
 
void setMaximumWidth (int maxw)
 
void setMinimumHeight (int minh)
 
void setMinimumSize (const QSize &size)
 
void setMinimumSize (int minw, int minh)
 
void setMinimumWidth (int minw)
 
void setMouseTracking (bool enable)
 
void setPalette (const QPalette &palette)
 
void setParent (QWidget *parent)
 
void setParent (QWidget *parent, Qt::WindowFlags flags)
 
void setShortcutAutoRepeat (int id, bool enable=true)
 
void setShortcutEnabled (int id, bool enable=true)
 
void setSizeIncrement (const QSize &size)
 
void setSizeIncrement (int w, int h)
 
void setSizePolicy (QSizePolicy policy)
 
void setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)
 
void setStatusTip (const QString &data)
 
void setStyle (QStyle *style)
 
void setToolTip (const QString &data)
 
void setToolTipDuration (int msec)
 
void setUpdatesEnabled (bool enable)
 
void setWhatsThis (const QString &str)
 
void setWindowFilePath (const QString &filePath)
 
void setWindowFlags (Qt::WindowFlags flags)
 
void setWindowIcon (const QIcon &icon)
 
void setWindowModality (Qt::WindowModality windowModality)
 
void setWindowOpacity (qreal level)
 
void setWindowRole (const QString &role)
 
void setWindowState (Qt::WindowStates windowState)
 
QSize size () const
 
QSize sizeIncrement () const
 
QSizePolicy sizePolicy () const
 
void stackUnder (QWidget *widget)
 
QString statusTip () const
 
QStylestyle () const
 
QString styleSheet () const
 
bool testAttribute (Qt::WidgetAttribute attribute) const
 
QString toolTip () const
 
int toolTipDuration () const
 
QWidget * topLevelWidget () const
 
bool underMouse () const
 
void ungrabGesture (Qt::GestureType gestureType)
 
void unsetCursor ()
 
void unsetLayoutDirection ()
 
void unsetLocale ()
 
void update (const QRect &rect)
 
void update (const QRegion &region)
 
void update (int x, int y, int w, int h)
 
void updateGeometry ()
 
bool updatesEnabled () const
 
QRegion visibleRegion () const
 
QString whatsThis () const
 
int width () const
 
QWidget * window () const
 
QString windowFilePath () const
 
Qt::WindowFlags windowFlags () const
 
QWindowwindowHandle () const
 
QIcon windowIcon () const
 
Qt::WindowModality windowModality () const
 
qreal windowOpacity () const
 
QString windowRole () const
 
Qt::WindowStates windowState () const
 
QString windowTitle () const
 
Qt::WindowType windowType () const
 
WId winId () const
 
int x () const
 
int y () const
 
- Public Methods inherited from QObject
 QObject (QObject *parent=nullptr)
 
 ~QObject ()
 
bool blockSignals (bool block)
 
const QList< QObject * > & children () const
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QStringdynamicPropertyNames () const
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
template<typename T >
findChild (const QString &childName=QString ()) const
 
template<class T >
QList< T > findChildren (const QRegularExpression &regExp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<class T >
QList< T > findChildren (const QString &objName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
bool inherits (const QString &className) const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const
 
bool isWindowType () const
 
void killTimer (int id)
 
const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const
 
QObject * parent () const
 
template<class T = QVariant>
property (const QString &name) const
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const QString &name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
QThreadthread () const
 
- Public Methods inherited from QPaintDevice
virtual ~QPaintDevice ()
 
int colorCount () const
 
int depth () const
 
int devicePixelRatio () const
 
qreal devicePixelRatioF () const
 
int height () const
 
int heightMM () const
 
int logicalDpiX () const
 
int logicalDpiY () const
 
bool paintingActive () const
 
int physicalDpiX () const
 
int physicalDpiY () const
 
int width () const
 
int widthMM () const
 

Protected Slots

void columnCountChanged (int oldCount, int newCount)
 
void columnMoved (int column, int oldIndex, int newIndex)
 
void columnResized (int column, int oldWidth, int newWidth)
 
void rowCountChanged (int oldCount, int newCount)
 
void rowMoved (int row, int oldIndex, int newIndex)
 
void rowResized (int row, int oldHeight, int newHeight)
 
- Protected Slots inherited from QAbstractItemView
virtual void closeEditor (QWidget *editor, QAbstractItemDelegate::EndEditHint hint)
 
virtual void commitData (QWidget *editor)
 
virtual void currentChanged (const QModelIndex &current, const QModelIndex &previous)
 
virtual void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles=QVector< int >())
 
virtual void editorDestroyed (QObject *editor)
 
virtual void rowsAboutToBeRemoved (const QModelIndex &parent, int start, int end)
 
virtual void rowsInserted (const QModelIndex &parent, int start, int end)
 
virtual void selectionChanged (const QItemSelection &selected, const QItemSelection &deselected)
 
virtual void updateGeometries ()
 
- Protected Slots inherited from QWidget
void updateMicroFocus ()
 

Protected Methods

void currentChanged (const QModelIndex &current, const QModelIndex &previous) override
 
int horizontalOffset () const override
 
bool isIndexHidden (const QModelIndex &index) const override
 
QModelIndex moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override
 
void paintEvent (QPaintEvent *event) override
 
void scrollContentsBy (int dx, int dy) override
 
QModelIndexList selectedIndexes () const override
 
void selectionChanged (const QItemSelection &selected, const QItemSelection &deselected) override
 
void setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags flags) override
 
int sizeHintForColumn (int column) const override
 
int sizeHintForRow (int row) const override
 
void timerEvent (QTimerEvent *event) override
 
void updateGeometries () override
 
int verticalOffset () const override
 
QStyleOptionViewItem viewOptions () const override
 
QSize viewportSizeHint () const override
 
QRegion visualRegionForSelection (const QItemSelection &selection) const override
 
- Protected Methods inherited from QAbstractItemView
QPoint dirtyRegionOffset () const
 
void dragEnterEvent (QDragEnterEvent *event) override
 
void dragLeaveEvent (QDragLeaveEvent *event) override
 
void dragMoveEvent (QDragMoveEvent *event) override
 
void dropEvent (QDropEvent *event) override
 
DropIndicatorPosition dropIndicatorPosition () const
 
virtual bool edit (const QModelIndex &index, EditTrigger trigger, QEvent *event)
 
bool event (QEvent *event) override
 
void executeDelayedItemsLayout ()
 
void focusInEvent (QFocusEvent *event) override
 
bool focusNextPrevChild (bool next) override
 
void focusOutEvent (QFocusEvent *event) override
 
int horizontalStepsPerItem () const
 
void inputMethodEvent (QInputMethodEvent *event) override
 
void keyPressEvent (QKeyEvent *event) override
 
void mouseDoubleClickEvent (QMouseEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void resizeEvent (QResizeEvent *event) override
 
void scheduleDelayedItemsLayout ()
 
void scrollDirtyRegion (int dx, int dy)
 
virtual QItemSelectionModel::SelectionFlags selectionCommand (const QModelIndex &index, const QEvent *event=nullptr) const
 
void setDirtyRegion (const QRegion &region)
 
void setHorizontalStepsPerItem (int steps)
 
void setState (State state)
 
void setVerticalStepsPerItem (int steps)
 
virtual void startDrag (Qt::DropActions supportedActions)
 
State state () const
 
void timerEvent (QTimerEvent *event) override
 
int verticalStepsPerItem () const
 
bool viewportEvent (QEvent *event) override
 
- Protected Methods inherited from QAbstractScrollArea
void contextMenuEvent (QContextMenuEvent *event) override
 
void dragEnterEvent (QDragEnterEvent *event) override
 
void dragLeaveEvent (QDragLeaveEvent *event) override
 
void dragMoveEvent (QDragMoveEvent *event) override
 
void dropEvent (QDropEvent *event) override
 
bool event (QEvent *event) override
 
void keyPressEvent (QKeyEvent *event) override
 
void mouseDoubleClickEvent (QMouseEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void paintEvent (QPaintEvent *event) override
 
void resizeEvent (QResizeEvent *event) override
 
void setViewportMargins (const QMargins &margins)
 
void setViewportMargins (int left, int top, int right, int bottom)
 
QMargins viewportMargins () const
 
void wheelEvent (QWheelEvent *event) override
 
- Protected Methods inherited from QFrame
void changeEvent (QEvent *event) override
 
void drawFrame (QPainter *)
 
bool event (QEvent *event) override
 
void initStyleOption (QStyleOptionFrame *option) const
 
void paintEvent (QPaintEvent *event) override
 
- Protected Methods inherited from QWidget
virtual void actionEvent (QActionEvent *event)
 
virtual void closeEvent (QCloseEvent *event)
 
void create (WId window=0, bool initializeWindow=true, bool destroyOldWindow=true)
 
void destroy (bool destroyWindow=true, bool destroySubWindows=true)
 
virtual void enterEvent (QEvent *event)
 
bool event (QEvent *event) override
 
bool focusNextChild ()
 
bool focusPreviousChild ()
 
virtual void hideEvent (QHideEvent *event)
 
void initPainter (QPainter *painter) const override
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
virtual void leaveEvent (QEvent *event)
 
int metric (PaintDeviceMetric metric) const override
 
virtual void moveEvent (QMoveEvent *event)
 
virtual bool nativeEvent (const QByteArray &eventType, void *message, long *result)
 
virtual void showEvent (QShowEvent *event)
 
virtual void tabletEvent (QTabletEvent *event)
 
- Protected Methods inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signalMethod) const
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signalMethod) const
 
bool isSignalConnected (const QMetaMethod &signalMethod) const
 
int receivers (const QString &signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Protected Methods inherited from QPaintDevice
 QPaintDevice ()
 

Properties

 cornerButtonEnabled
 
 gridStyle
 
 showGrid
 
 sortingEnabled
 
 wordWrap
 
- Properties inherited from QAbstractItemView
 alternatingRowColors
 
 autoScroll
 
 autoScrollMargin
 
 defaultDropAction
 
 dragDropMode
 
 dragDropOverwriteMode
 
 dragEnabled
 
 editTriggers
 
 horizontalScrollMode
 
 iconSize
 
 selectionBehavior
 
 selectionMode
 
 showDropIndicator
 
 tabKeyNavigation
 
 textElideMode
 
 verticalScrollMode
 
- Properties inherited from QAbstractScrollArea
 horizontalScrollBarPolicy
 
 verticalScrollBarPolicy
 
- Properties inherited from QFrame
 frameRect
 
 frameShadow
 
 frameShape
 
 frameWidth
 
 lineWidth
 
 midLineWidth
 
- Properties inherited from QWidget
 acceptDrops
 
 accessibleDescription
 
 accessibleName
 
 autoFillBackground
 
 baseSize
 
 childrenRect
 
 childrenRegion
 
 contextMenuPolicy
 
 cursor
 
 enabled
 
 focus
 
 focusPolicy
 
 font
 
 frameGeometry
 
 frameSize
 
 fullScreen
 
 geometry
 
 height
 
 inputMethodHints
 
 isActiveWindow
 
 layoutDirection
 
 locale
 
 maximized
 
 maximumHeight
 
 maximumSize
 
 maximumWidth
 
 minimized
 
 minimumHeight
 
 minimumSize
 
 minimumSizeHint
 
 minimumWidth
 
 modal
 
 mouseTracking
 
 normalGeometry
 
 palette
 
 pos
 
 rect
 
 size
 
 sizeHint
 
 sizeIncrement
 
 sizePolicy
 
 statusTip
 
 styleSheet
 
 toolTip
 
 updatesEnabled
 
 visible
 
 whatsThis
 
 width
 
 windowFilePath
 
 windowFlags
 
 windowIcon
 
 windowIconText
 
 windowModality
 
 windowModified
 
 windowOpacity
 
 windowTitle
 
 x
 
 y
 
- Properties inherited from QObject
 objectName
 

Additional Inherited Members

- Public Types inherited from QAbstractItemView
enum  DragDropMode
 
enum  ScrollHint
 
enum  ScrollMode
 
enum  SelectionBehavior
 
enum  SelectionMode
 
- Public Types inherited from QFrame
enum  Shadow
 
enum  Shape
 
enum  StyleMask
 
- Public Types inherited from QWidget
enum  RenderFlag
 
- Public Types inherited from QPaintDevice
enum  PaintDeviceMetric
 
- Public Signals inherited from QAbstractItemView
void activated (const QModelIndex &index)
 
void clicked (const QModelIndex &index)
 
void doubleClicked (const QModelIndex &index)
 
void entered (const QModelIndex &index)
 
void iconSizeChanged (const QSize &size)
 
void pressed (const QModelIndex &index)
 
void viewportEntered ()
 
- Public Signals inherited from QWidget
void customContextMenuRequested (const QPoint &pos)
 
void windowIconChanged (const QIcon &icon)
 
void windowIconTextChanged (const QString &iconText)
 
void windowTitleChanged (const QString &title)
 
- Public Signals inherited from QObject
void destroyed (QObject *obj=nullptr)
 
void objectNameChanged (const QString &objectName)
 
- Static Public Methods inherited from QWidget
static QWidget * createWindowContainer (QWindow *window, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::EmptyFlag)
 
static QWidget * find (WId id)
 
static QWidget * keyboardGrabber ()
 
static QWidget * mouseGrabber ()
 
static void setTabOrder (QWidget *firstWidget, QWidget *secondWidget)
 
- Static Public Methods inherited from QObject
static bool connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ())
 
static bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...))
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod)
 
static QMetaObjectstaticMetaObject ()
 
static QString tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >())
 
- Protected Types inherited from QAbstractItemView
enum  CursorAction
 
enum  DropIndicatorPosition
 
enum  State
 

Detailed Description

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 the CopperSpice model/view architecture.

The QTableView class is one of the Model/View Classes and is part of the CopperSpice Model/View Programming.

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. Refer to the Widget Gallery to see the appearance in other styles.

Windows XP style table view Mac OS X style table view Fusion style table view
See also
QTableWidget, View Classes, QAbstractItemModel, QAbstractItemView

Constructor & Destructor Documentation

QTableView::QTableView ( QWidget parent = nullptr)
explicit

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

See also
QAbstractItemModel
QTableView::~QTableView ( )

Destroys the table view.

Method Documentation

void QTableView::clearSpans ( )

Removes all row and column spans in the table view.

See also
setSpan()
int QTableView::columnAt ( int  x) const

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

Note
This method returns -1 if the given coordinate is not valid (has no column).
See also
rowAt()
void QTableView::columnCountChanged ( int  oldCount,
int  newCount 
)
protectedslot

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.

void QTableView::columnMoved ( int  column,
int  oldIndex,
int  newIndex 
)
protectedslot

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()
void QTableView::columnResized ( int  column,
int  oldWidth,
int  newWidth 
)
protectedslot

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()
int QTableView::columnSpan ( int  row,
int  column 
) const

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

See also
setSpan(), rowSpan()
int QTableView::columnViewportPosition ( int  column) const

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

int QTableView::columnWidth ( int  column) const

Returns the width of the given column.

See also
setColumnWidth(), resizeColumnToContents(), rowHeight()
void QTableView::currentChanged ( const QModelIndex current,
const QModelIndex previous 
)
overrideprotected
Qt::PenStyle QTableView::gridStyle ( ) const

Property documentation pending.

void QTableView::hideColumn ( int  column)
slot

Hide the given column.

See also
showColumn(), hideRow()
void QTableView::hideRow ( int  row)
slot

Hide the given row.

See also
showRow(), hideColumn()
QHeaderView * QTableView::horizontalHeader ( ) const

Returns the table view's horizontal header.

See also
setHorizontalHeader(), verticalHeader(), QAbstractItemModel::headerData()
int QTableView::horizontalOffset ( ) const
overrideprotectedvirtual

Reimplemented from QAbstractItemView::horizontalOffset().

Returns the horizontal offset of the items in the table view. Note that the table view uses the horizontal header section positions to determine the positions of columns in the view.

See also
verticalOffset()

Implements QAbstractItemView.

QModelIndex QTableView::indexAt ( const QPoint pos) const
overridevirtual

Reimplemented from QAbstractItemView::indexAt().

Returns the index position of the model item corresponding to the table item at position pos in contents coordinates.

Implements QAbstractItemView.

bool QTableView::isColumnHidden ( int  column) const

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

See also
isRowHidden()
bool QTableView::isCornerButtonEnabled ( ) const

Property documentation pending.

bool QTableView::isIndexHidden ( const QModelIndex index) const
overrideprotectedvirtual

Reimplemented from QAbstractItemView::isIndexHidden().

Implements QAbstractItemView.

bool QTableView::isRowHidden ( int  row) const

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

See also
isColumnHidden()
bool QTableView::isSortingEnabled ( ) const

Property documentation pending.

QModelIndex QTableView::moveCursor ( CursorAction  cursorAction,
Qt::KeyboardModifiers  modifiers 
)
overrideprotectedvirtual

Reimplemented from QAbstractItemView::moveCursor().

Moves the cursor in accordance with the given cursorAction, using the information provided by the modifiers.

See also
QAbstractItemView::CursorAction

Implements QAbstractItemView.

void QTableView::paintEvent ( QPaintEvent event)
overrideprotectedvirtual

Reimplemented from QWidget::paintEvent().

Paints the table on receipt of the given paint event event.

Reimplemented from QWidget.

void QTableView::resizeColumnsToContents ( )
slot

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

void QTableView::resizeColumnToContents ( int  column)
slot

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

Note
Only visible columns will be resized. Reimplement sizeHintForColumn() to resize hidden columns as well.
void QTableView::resizeRowsToContents ( )
slot

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

void QTableView::resizeRowToContents ( int  row)
slot

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

int QTableView::rowAt ( int  y) const

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()
void QTableView::rowCountChanged ( int  oldCount,
int  newCount 
)
protectedslot

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.

int QTableView::rowHeight ( int  row) const

Returns the height of the given row.

See also
setRowHeight(), resizeRowToContents(), columnWidth()
void QTableView::rowMoved ( int  row,
int  oldIndex,
int  newIndex 
)
protectedslot

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()
void QTableView::rowResized ( int  row,
int  oldHeight,
int  newHeight 
)
protectedslot

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()
int QTableView::rowSpan ( int  row,
int  column 
) const

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

See also
setSpan(), columnSpan()
int QTableView::rowViewportPosition ( int  row) const

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

void QTableView::scrollContentsBy ( int  dx,
int  dy 
)
overrideprotectedvirtual

This virtual handler is called when the scroll bars are moved by dx, dy, and consequently the viewport's contents should be scrolled accordingly.

The default implementation simply calls update() on the entire viewport(). Subclasses can reimplement this handler for optimization purposes, or as with QScrollArea to move a contents widget. The parameters dx and dy are there for convenience, so that the class knows how much should be scrolled. You may ignore these values and scroll directly to the position the scroll bars indicate.

Calling this method in order to scroll programmatically is an error, use the scroll bars instead (e.g. by calling QScrollBar::setValue() directly).

Reimplemented from QAbstractScrollArea.

void QTableView::scrollTo ( const QModelIndex index,
ScrollHint  hint = EnsureVisible 
)
overridevirtual

Scrolls the view if necessary to ensure that the item at index is visible. The view will try to position the item according to the given hint.

In the base class this is a pure virtual function.

Implements QAbstractItemView.

void QTableView::selectColumn ( int  column)
slot

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

See also
selectRow()
QModelIndexList QTableView::selectedIndexes ( ) const
overrideprotectedvirtual

Reimplemented from QAbstractItemView::selectedIndexes().

Reimplemented from QAbstractItemView.

void QTableView::selectionChanged ( const QItemSelection selected,
const QItemSelection deselected 
)
overrideprotected
void QTableView::selectRow ( int  row)
slot

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

See also
selectColumn()
void QTableView::setColumnHidden ( int  column,
bool  hide 
)

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

See also
isColumnHidden(), setRowHidden()
void QTableView::setColumnWidth ( int  column,
int  width 
)

Sets the width of the given column to be width.

See also
columnWidth()
void QTableView::setCornerButtonEnabled ( bool  enable)

Property documentation pending.

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

Property documentation pending.

void QTableView::setHorizontalHeader ( QHeaderView header)

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

See also
horizontalHeader(), setVerticalHeader()
void QTableView::setModel ( QAbstractItemModel model)
overridevirtual

Reimplemented from QAbstractItemView::setModel().

Reimplemented from QAbstractItemView.

void QTableView::setRootIndex ( const QModelIndex index)
override

Reimplemented from QAbstractItemView::setRootIndex().

void QTableView::setRowHeight ( int  row,
int  height 
)

Sets the height of the given row to be height.

See also
rowHeight()
void QTableView::setRowHidden ( int  row,
bool  hide 
)

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

See also
isRowHidden(), setColumnHidden()
void QTableView::setSelection ( const QRect rect,
QItemSelectionModel::SelectionFlags  flags 
)
overrideprotectedvirtual

Reimplemented from QAbstractItemView::setSelection().

Selects the items within the given rect and in accordance with the specified selection flags.

Implements QAbstractItemView.

void QTableView::setSelectionModel ( QItemSelectionModel selectionModel)
overridevirtual

Reimplemented from QAbstractItemView::setSelectionModel().

Reimplemented from QAbstractItemView.

void QTableView::setShowGrid ( bool  show)
slot

Property documentation pending.

void QTableView::setSortingEnabled ( bool  enable)

If enable is true then this method sorts the table and calls sortByColumn() with the current sort section and order.

void QTableView::setSpan ( int  row,
int  column,
int  rowSpanCount,
int  columnSpanCount 
)

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

See also
rowSpan(), columnSpan()
void QTableView::setVerticalHeader ( QHeaderView header)

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

See also
verticalHeader(), setHorizontalHeader()
void QTableView::setWordWrap ( bool  on)

Property documentation pending.

void QTableView::showColumn ( int  column)
slot

Show the given column.

See also
hideColumn(), showRow()
bool QTableView::showGrid ( ) const

Property documentation pending.

void QTableView::showRow ( int  row)
slot

Show the given row.

See also
hideRow(), showColumn()
int QTableView::sizeHintForColumn ( int  column) const
overrideprotectedvirtual

Reimplemented from QAbstractItemView::sizeHintForColumn().

Returns the size hint for the given column's width or -1 if there is no model.

If you need to set the width of a given column to a fixed value, call QHeaderView::resizeSection() on the table's horizontal header.

If you reimplement this function in a subclass, note that the value you return will be used when resizeColumnToContents() or QHeaderView::resizeSections() is called. If a larger column width is required by either the horizontal header or the item delegate, the larger width will be used instead.

See also
QWidget::sizeHint, horizontalHeader()

Reimplemented from QAbstractItemView.

int QTableView::sizeHintForRow ( int  row) const
overrideprotectedvirtual

Reimplemented from QAbstractItemView::sizeHintForRow().

Returns the size hint for the given row's height or -1 if there is no model.

If you need to set the height of a given row to a fixed value, call QHeaderView::resizeSection() on the table's vertical header.

If you reimplement this function in a subclass, note that the value you return is only used when resizeRowToContents() is called. In that case, if a larger row height is required by either the vertical header or the item delegate, that width will be used instead.

See also
QWidget::sizeHint, verticalHeader()

Reimplemented from QAbstractItemView.

void QTableView::sortByColumn ( int  column)
deprecatedslot
Deprecated:

Sorts the model by the values in the given column.

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

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

See also
sortingEnabled
void QTableView::timerEvent ( QTimerEvent event)
overrideprotected

Reimplemented from QObject::timerEvent().

void QTableView::updateGeometries ( )
overrideprotected
QHeaderView * QTableView::verticalHeader ( ) const

Returns the table view's vertical header.

See also
setVerticalHeader(), horizontalHeader(), QAbstractItemModel::headerData()
int QTableView::verticalOffset ( ) const
overrideprotectedvirtual

Reimplemented from QAbstractItemView::verticalOffset().

Returns the vertical offset of the items in the table view.

Note that the table view uses the vertical header section positions to determine the positions of rows in the view.

See also
horizontalOffset()

Implements QAbstractItemView.

QStyleOptionViewItem QTableView::viewOptions ( ) const
overrideprotectedvirtual

Reimplemented from QAbstractItemView::viewOptions().

Reimplemented from QAbstractItemView.

QSize QTableView::viewportSizeHint ( ) const
overrideprotectedvirtual

Property documentation pending.

Reimplemented from QAbstractItemView.

QRect QTableView::visualRect ( const QModelIndex index) const
overridevirtual

Returns the rectangle on the viewport occupied by the item at index.

If your item is displayed in several areas then visualRect should return the primary area that contains index and not the complete area that index might encompasses, touch or cause drawing.

In the base class this is a pure virtual function.

See also
indexAt(), visualRegionForSelection()

Implements QAbstractItemView.

QRegion QTableView::visualRegionForSelection ( const QItemSelection selection) const
overrideprotectedvirtual

Returns the region from the viewport of the items in the given selection.

In the base class this is a pure virtual function.

See also
visualRect(), selectedIndexes()

Implements QAbstractItemView.

bool QTableView::wordWrap ( ) const

Property documentation pending.

Property Documentation

QTableView::cornerButtonEnabled

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.

PropertiesClass Methods
read isCornerButtonEnabled
write setCornerButtonEnabled
QTableView::gridStyle

This property holds the pen style used to draw the grid.

This property holds the style used when drawing the grid (see showGrid).

PropertiesClass Methods
read gridStyle
write setGridStyle
QTableView::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.

PropertiesClass Methods
read showGrid
write setShowGrid
QTableView::sortingEnabled

This property holds whether sorting is enabled.

If this property is true, sorting is enabled for the table. If this property is false, sorting is not enabled. The default value is false.

Note
. Setting the property to true with setSortingEnabled() immediately triggers a call to sortByColumn() with the current sort section and order.
See also
sortByColumn()
PropertiesClass Methods
read isSortingEnabled
write setSortingEnabled
QTableView::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.

PropertiesClass Methods
read wordWrap
write setWordWrap