//! [detailed-description]
A \1 provides a styled table header.
It can either be used as an independent view or header for a \l TableView.

You can add a header for a TableView by assigning the TableView to the
\l {TableView::syncView}{syncView} property of \1. The header and the table will
then be kept in sync while flicking.

By default, \1 displays \l {QAbstractItemModel::headerData()}{header data}
from the \l {TableView::syncView}{sync view's} \l {TableView::model}{model}.
If you don't wish to use header data from that model, or you don't use a
syncView, you can assign a model explicitly to the \l {TableView::model}{model}
property.

\note In order to show the header data of a QAbstractItemModel, \1
will internally wrap the model's header data in an independent proxy
model. This model shares no model items with the \l {TableView::model}{application model}.
This means that if you call functions such as \l {TableView::index()}{index()}, the model
index you get back will belong to the proxy model and not the application model.

By default, \l textRole is set to \c "display", meaning that data from the
model's \l {Qt::ItemDataRole}{Qt::DisplayRole} will be used. You can set
this to another role name in order to have that data displayed instead.

The application is responsible for placing the header at the
correct location in the scene. You can add as many headers as you
want to a single TableView, which can be useful if you for example want
to place headers on all four sides of the table.

The following snippet shows how you can add a horizontal and vertical header
view to a table view:

\snippet qtquickcontrols-headerview.qml 0

A \1 will have
\l {TableView::resizableColumns}{resizableColumns} set to \c true by default.
//! [detailed-description]

//! [syncView]
This property holds the TableView to synchronize with.

Once this property is bound to another TableView, both header and table
will synchronize with regard to column widths, column spacing, and flicking
\1.

If the \l model is not explicitly set, then the header will use the syncView's
model to label the columns.

\sa model TableView
//! [syncView]

//! [model]
This property holds the model providing data for the \1 header view.

By default, \1 header view displays \l {QAbstractItemModel::headerData()}{header data}
from the \l {TableView::syncView}{sync view's} \l {TableView::model}{model}.
If you don't wish to use header data from that model, or you don't use a
syncView, you can assign a model explicitly to this property. If \a model
is a \l QAbstractTableModel, it's \l {QAbstractItemModel::headerData()}{header data}
will be used. Otherwise, if it's a \l QAbstractItemModel,
\l {QAbstractItemModel::data()}{data} will be used.

In addition to \l {QAbstractItemModel}{QAbstractItemModels}, you can also assign other
kinds of models to this property, such as JavaScript arrays.

\sa TableView {TableView::model} {model} QAbstractTableModel
//! [model]

//! [textRole]
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.

It is the delegate's responsibility to respect the assigned \a textRole
when presenting data from the model. While \l HorizontalHeaderViewDelegate and
\l VerticalHeaderViewDelegate handle this automatically, custom delegates must
implement this behavior explicitly.

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

A warning is given if the model's \l {QAbstractItemModel::}{roleNames()}
doesn't provide the role specified in \l textRole.
The warning can be silenced by setting the \l textRole.

\sa QAbstractItemModel::roleNames()
//! [textRole]

//! [movableColumns]
This property allows the user to move columns in the view. The default value is
\c false.

\note If this property is set, the HorizontalHeaderView allows the user to drag
and drop columns at the required position. When syncView is enabled,
any change will be applied to the corresponding view item.
//! [movableColumns]

//! [movableRows]
This property allows the user to move rows in the view. The default value is \c
false.

\note If this property is set, the VerticalHeaderView allows the user to drag
and drop rows at the required position. When syncView is enabled,
any change will be applied to the corresponding view item.
//! [movableRows]
