Used to define columns in a TableView or in a TreeView. More...
Import Statement: | import QtQuick.Controls 1.4 |
Since: | Qt 5.1 |
Inherits: |
TableViewColumn represents a column within a TableView or a TreeView. It provides properties to decide how the data in that column is presented.
TableView { TableViewColumn { role: "title"; title: "Title"; width: 100 } TableViewColumn { role: "author"; title: "Author"; width: 200 } model: libraryModel }
See also TableView and TreeView.
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:
elideMode : int
The text elide mode of the column. Allowed values are:
See also elide.
horizontalAlignment : int
The horizontal text alignment of the column. Allowed values are:
See also horizontalAlignment.
movable : bool
Determines if the column should be movable. The default value is true
.
Note: A non-movable column may get indirectly moved if adjacent columns are movable.
This property was introduced in 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.
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.
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-5.15/qml-qtquick-controls-tableviewcolumn.html