TableViewColumn QML Type
Used to define columns in a TableView or in a TreeView. 更多...
Import Statement: | import QtQuick.Controls 1.4 |
开始支持版本: | Qt 5.1 |
基类: |
属性
- delegate : Component
- elideMode : int
- horizontalAlignment : int
- movable : bool
- resizable : bool
- role : string
- title : string
- visible : bool
- width : int
方法
- void resizeToContents()
详细描述
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 }
属性
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
The text elide mode of the column. Allowed values are:
- Text.ElideNone
- Text.ElideLeft
- Text.ElideMiddle
- Text.ElideRight - the default
参见 elide.
The horizontal text alignment of the column. Allowed values are:
- Text.AlignLeft - the default
- Text.AlignRight
- Text.AlignHCenter
- Text.AlignJustify
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 QML property was introduced in QtQuick.Controls 1.1.
Determines if the column should be resizable.
This QML property was introduced in QtQuick.Controls 1.1.
The current width of the column. The default value depends on platform. If only one column is defined, the width expands to the viewport.
成员
Resizes the column so that the implicitWidth of the contents on every row will fit.
This QML method was introduced in QtQuick.Controls 1.2.