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

TableViewColumn QML Type

Used to define columns in a TableView or in a TreeView.

This type was introduced in Qt 5.1.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

TableViewColumn QML Type

  • Import Statement: import QtQuick.Controls 1.4

  • Since: Qt 5.1

  • Inherits: QtObject

  • Group: TableViewColumn is part of viewitems, Buttons and Controls

Detailed Description

Image non disponible

TableViewColumn represents a column within a TableView or a TreeView. It provides properties to decide how the data in that column is presented.

 
Sélectionnez
TableView {
    TableViewColumn { role: "title"; title: "Title"; width: 100 }
    TableViewColumn { role: "author"; title: "Author"; width: 200 }
    model: libraryModel
}

See Also

See also TableView, TreeView

Property Documentation

 

delegate : Component

The delegate of the column. This can be used to set the itemDelagate of a TableView or TreeView for a specific column.

In the delegate you have access to the following special properties:

  • styleData.selected - if the item is currently selected

  • styleData.value - the value or text for this item

  • styleData.textColor - the default text color for an item

  • styleData.row - the index of the row

  • styleData.column - the index of the column

  • styleData.elideMode - the elide mode of the column

  • styleData.textAlignment - the horizontal text alignment of the column

elideMode : int

The text elide mode of the column. Allowed values are:

  • Text.ElideNone

  • Text.ElideLeft

  • Text.ElideMiddle

  • Text.ElideRight - the default

See Also

See also elide

horizontalAlignment : int

The horizontal text alignment of the column. Allowed values are:

  • Text.AlignLeft - the default

  • Text.AlignRight

  • Text.AlignHCenter

  • Text.AlignJustify

See Also

[since QtQuick.Controls 1.1] movable : bool

Determines if the column should be movable. The default value is true.

A non-movable column may get indirectly moved if adjacent columns are movable.

This property was introduced in QtQuick.Controls 1.1.

[since QtQuick.Controls 1.1] resizable : bool

Determines if the column should be resizable.

This property was introduced in QtQuick.Controls 1.1.

role : string

The model role of the column.

title : string

The title text of the column.

visible : bool

The visible status of the column.

width : int

The current width of the column. The default value depends on platform. If only one column is defined, the width expands to the viewport.

Method Documentation

 

[since QtQuick.Controls 1.2] void resizeToContents()

Resizes the column so that the implicitWidth of the contents on every row will fit.

This method was introduced in QtQuick.Controls 1.2.

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