\qmltype TableView \inqmlmodule QtQuick
- Since
- 5.12
\inherits Flickable
Provides a table view of items to display data from a model.
A TableView has a \l model that defines the data to be displayed, and a \l delegate that defines how the data should be displayed.
TableView inherits \l Flickable. This means that while the model can have any number of rows and columns, only a subsection of the table is usually visible inside the viewport. As soon as you flick, new rows and columns enter the viewport, while old ones exit and are removed from the viewport. The rows and columns that move out are reused for building the rows and columns that move into the viewport. As such, the TableView support models of any size without affecting performance.
A TableView displays data from models created from built-in QML types such as ListModel and XmlListModel, which populates the first column only in a TableView. To create models with multiple columns, either use \l TableModel or a C++ model that inherits QAbstractItemModel.
A TableView does not include headers by default. You can add headers using the \l HorizontalHeaderView and \l VerticalHeaderView from Qt Quick Controls.
- Note
- TableView will only \l {isRowLoaded()}{load} as many delegate items as needed to fill up the view. There is no guarantee that items outside the view will be loaded, although TableView will sometimes pre-load items for optimization reasons. Hence, a TableView with zero width or height might not load any delegate items at all.
Definition at line 1570 of file qquicktableview.cpp.