IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

HorizontalHeaderView QML Type

Provides a horizontal header view to accompany a TableView.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

HorizontalHeaderView QML Type

  • Import Statement: import QtQuick.Controls

  • Inherits: TableView

  • Group: HorizontalHeaderView is part of qtquickcontrols2-containers

Detailed Description

A HorizontalHeaderView provides labeling of the columns of a TableView. To add a horizontal header to a TableView, bind the syncView property to the TableView:

 
Sélectionnez
HorizontalHeaderView {
    id: horizontalHeader
    syncView: tableView
    anchors.left: tableView.left
}

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 horizontal headerData(); otherwise, the model's data().

Property Documentation

 

model : QVariant

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

When model is not explicitly set, the header will use the syncView's model once syncView is set.

If model is a QAbstractTableModel, its horizontal 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.

See Also

syncView : TableView

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 horizontally.

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

See Also

See also model, 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.

See Also

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+