QColumnView

The QColumnView class provides a model/view implementation of a column view. More

Inheritance diagram of PySide2.QtWidgets.QColumnView

Synopsis

Functions

Virtual functions

Signals

Detailed Description

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.

The QColumnView class is one of the Model/View Classes and is part of Qt’s model/view framework .

QColumnView implements the interfaces defined by the QAbstractItemView class to allow it to display data provided by models derived from the QAbstractItemModel class.

../../_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()
Return type

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

PySide2.QtWidgets.QColumnView.createColumn(rootIndex)
Parameters

rootIndexQModelIndex

Return type

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)
Parameters

columnQAbstractItemView

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() .

See also

createColumn()

PySide2.QtWidgets.QColumnView.previewWidget()
Return type

QWidget

Returns the preview widget, or 0 if there is none.

PySide2.QtWidgets.QColumnView.resizeGripsVisible()
Return type

bool

PySide2.QtWidgets.QColumnView.setColumnWidths(list)
Parameters

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)
Parameters

widgetQWidget

Sets the preview widget .

The 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)
Parameters

visiblebool

PySide2.QtWidgets.QColumnView.updatePreviewWidget(index)
Parameters

indexQModelIndex