VerticalHeaderView QML Type

Provides a vertical header view to accompany a TableView . 更多...

import 语句: import QtQuick.Controls 2.2
继承: TableView

特性

详细描述

A VerticalHeaderView provides labeling of the rows of a TableView . To add a vertical header to a TableView , bind the syncView property to the TableView :

VerticalHeaderView {
    id: verticalHeader
    syncView: tableView
    anchors.top: tableView.top
}
					

The header displays data from the { syncView }'s model by default, but can also have its own model. If the model is a QAbstractTableModel , then the header will display the model's vertical headerData(); otherwise, the model's data().

特性文档编制

model : QVariant

This property holds the model providing data for the vertical header view.

When model is not explicitly set, it will be synchronized with syncView 's model once syncView 有设置。

If model is a QAbstractTableModel , its vertical headerData() will be accessed.

If model is a QAbstractItemModel other than QAbstractTableModel , model's data() will be accessed.

Otherwise, the behavior is same as setting TableView::model .

另请参阅 TableView , model ,和 QAbstractTableModel .

syncView : TableView

此特性保持 TableView to synchronize with.

Once this property is bound to another TableView , both header and table will synchronize with regard to row heights, row spacing, and flicking vertically.

model is not explicitly set, then the header will use the syncView's model to label the rows.

另请参阅 model and TableView .

textRole : QString

This property holds the model role used to display text in each header cell.

When the model has multiple roles, textRole can be set to determine which role should be displayed.

If model is a QAbstractItemModel then it will default to "display"; otherwise it is empty.

另请参阅 QAbstractItemModel::roleNames() .