内容表

上一话题

QColormap

下一话题

QComboBox

QColumnView

QColumnView class provides a model/view implementation of a column view. 更多

Inheritance diagram of PySide2.QtWidgets.QColumnView

概要

虚函数

信号

详细描述

QColumnView displays a model in a number of QListViews, one for each hierarchy in the tree. This is sometimes referred to as a cascading list.

QColumnView class is one of the 模型/视图类 and is part of Qt’s 模型/视图框架 .

QColumnView implements the interfaces defined by the QAbstractItemView 类以允许它显示提供数据,通过模型派生自 QAbstractItemModel 类。

../../_images/qcolumnview.png
class QColumnView ( [ parent=None ] )
param parent

QWidget

Constructs a column view with a parent to represent a model’s data. Use setModel() to set the model.

PySide2.QtWidgets.QColumnView. columnWidths ( )
返回类型

Returns a list of the width of all the columns in this view.

另请参阅

setColumnWidths()

PySide2.QtWidgets.QColumnView. createColumn ( rootIndex )
参数

rootIndex QModelIndex

返回类型

QAbstractItemView

To use a custom widget for the final column when you select an item overload this function and return a widget. index is the root index that will be assigned to the view.

Return the new view. QColumnView will automatically take ownership of the widget.

PySide2.QtWidgets.QColumnView. initializeColumn ( column )
参数

column QAbstractItemView

Copies the behavior and options of the column view and applies them to the column such as the iconSize() , textElideMode() and alternatingRowColors() . This can be useful when reimplementing createColumn() .

另请参阅

createColumn()

PySide2.QtWidgets.QColumnView. previewWidget ( )
返回类型

QWidget

Returns the preview widget, or None 若没有。

PySide2.QtWidgets.QColumnView. resizeGripsVisible ( )
返回类型

bool

PySide2.QtWidgets.QColumnView. setColumnWidths ( list )
参数

list

Sets the column widths to the values given in the list . Extra values in the list are kept and used when the columns are created.

If list contains too few values, only width of the rest of the columns will not be modified.

PySide2.QtWidgets.QColumnView. setPreviewWidget ( widget )
参数

widget QWidget

Sets the preview widget .

widget becomes a child of the column view, and will be destroyed when the column area is deleted or when a new widget is set.

PySide2.QtWidgets.QColumnView. setResizeGripsVisible ( visible )
参数

visible bool

PySide2.QtWidgets.QColumnView. updatePreviewWidget ( index )
参数

index QModelIndex