45 #include <QtGui/qabstractitemview.h> 53 #ifndef QT_NO_TABLEVIEW 81 int rowViewportPosition(
int row)
const;
82 int rowAt(
int y)
const;
84 void setRowHeight(
int row,
int height);
85 int rowHeight(
int row)
const;
87 int columnViewportPosition(
int column)
const;
88 int columnAt(
int x)
const;
90 void setColumnWidth(
int column,
int width);
91 int columnWidth(
int column)
const;
93 bool isRowHidden(
int row)
const;
94 void setRowHidden(
int row,
bool hide);
96 bool isColumnHidden(
int column)
const;
97 void setColumnHidden(
int column,
bool hide);
99 void setSortingEnabled(
bool enable);
100 bool isSortingEnabled()
const;
102 bool showGrid()
const;
107 void setWordWrap(
bool on);
108 bool wordWrap()
const;
110 void setCornerButtonEnabled(
bool enable);
111 bool isCornerButtonEnabled()
const;
117 void setSpan(
int row,
int column,
int rowSpan,
int columnSpan);
118 int rowSpan(
int row,
int column)
const;
119 int columnSpan(
int row,
int column)
const;
125 void selectRow(
int row);
126 void selectColumn(
int column);
127 void hideRow(
int row);
128 void hideColumn(
int column);
129 void showRow(
int row);
130 void showColumn(
int column);
131 void resizeRowToContents(
int row);
132 void resizeRowsToContents();
133 void resizeColumnToContents(
int column);
134 void resizeColumnsToContents();
135 void sortByColumn(
int column);
136 void setShowGrid(
bool show);
139 void rowMoved(
int row,
int oldIndex,
int newIndex);
140 void columnMoved(
int column,
int oldIndex,
int newIndex);
141 void rowResized(
int row,
int oldHeight,
int newHeight);
142 void columnResized(
int column,
int oldWidth,
int newWidth);
143 void rowCountChanged(
int oldCount,
int newCount);
144 void columnCountChanged(
int oldCount,
int newCount);
159 void setSelection(
const QRect &rect, QItemSelectionModel::SelectionFlags command);
192 #endif // QT_NO_TABLEVIEW 198 #endif // QTABLEVIEW_H
The QItemSelectionModel class keeps track of a view's selected items.
#define QT_END_NAMESPACE
This macro expands to.
virtual QStyleOptionViewItem viewOptions() const
Returns a QStyleOptionViewItem structure populated with the view's palette, font, state...
virtual void setSelectionModel(QItemSelectionModel *selectionModel)
Sets the current selection model to the given selectionModel.
bool sortingEnabled
whether sorting is enabled
virtual bool isIndexHidden(const QModelIndex &index) const =0
Returns true if the item referred to by the given index is hidden in the view, otherwise returns fals...
virtual QRect visualRect(const QModelIndex &index) const =0
Returns the rectangle on the viewport occupied by the item at index.
bool cornerButtonEnabled
whether the button in the top-left corner is enabled
virtual void setRootIndex(const QModelIndex &index)
Sets the root item to the item at the given index.
void timerEvent(QTimerEvent *event)
This function is called with the given event when a timer event is sent to the widget.
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
virtual void verticalScrollbarAction(int action)
Qt::PenStyle gridStyle
the pen style used to draw the grid.
virtual int sizeHintForColumn(int column) const
Returns the width size hint for the specified column or -1 if there is no model.
virtual void doItemsLayout()
This function is intended to lay out the items in the view.
virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers)=0
Returns a QModelIndex object pointing to the next object in the view, based on the given cursorAction...
virtual int verticalOffset() const =0
Returns the vertical offset of the view.
virtual void setModel(QAbstractItemModel *model)
Sets the model for the view to present.
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual void scrollTo(const QModelIndex &index, ScrollHint hint=EnsureVisible)=0
Scrolls the view if necessary to ensure that the item at index is visible.
virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous)
This slot is called when a new item becomes the current item.
The QRegion class specifies a clip region for a painter.
virtual int horizontalOffset() const =0
Returns the horizontal offset of the view.
The QTableView class provides a default model/view implementation of a table view.
The QAbstractItemModel class provides the abstract interface for item model classes.
virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
This slot is called when the selection is changed.
bool wordWrap
the item text word-wrapping policy
The QAbstractItemView class provides the basic functionality for item view classes.
The QItemSelection class manages information about selected items in a model.
virtual void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command)=0
Applies the selection flags to the items in or touched by the rectangle, rect.
The QTimerEvent class contains parameters that describe a timer event.
virtual QModelIndexList selectedIndexes() const
This convenience function returns a list of all selected and non-hidden item indexes in the view...
The QPoint class defines a point in the plane using integer precision.
The QModelIndex class is used to locate data in a data model.
The QRect class defines a rectangle in the plane using integer precision.
virtual QRegion visualRegionForSelection(const QItemSelection &selection) const =0
Returns the region from the viewport of the items in the given selection.
virtual void updateGeometries()
Updates the geometry of the child widgets of the view.
#define Q_DECLARE_PRIVATE(Class)
CursorAction
This enum describes the different ways to navigate between items,.
The QStyleOptionViewItem class is used to describe the parameters used to draw an item in a view widg...
virtual void horizontalScrollbarAction(int action)
The QPaintEvent class contains event parameters for paint events.
bool showGrid
whether the grid is shown
virtual int sizeHintForRow(int row) const
Returns the height size hint for the specified row or -1 if there is no model.
virtual QModelIndex indexAt(const QPoint &point) const =0
Returns the model index of the item at the viewport coordinates point.