QColumnViewclass provides a model/view implementation of a column view. 更多 …
def
columnWidths
()
def
initializeColumn
(column)
def
previewWidget
()
def
resizeGripsVisible
()
def
setColumnWidths
(list)
def
setPreviewWidget
(widget)
def
setResizeGripsVisible
(visible)
def
createColumn
(rootIndex)
def
updatePreviewWidget
(index)
QColumnViewdisplays a model in a number of QListViews, one for each hierarchy in the tree. This is sometimes referred to as a cascading list.
QColumnViewclass is one of the 模型/视图类 and is part of Qt’s 模型/视图框架 .
QColumnViewimplements the interfaces defined by theQAbstractItemView类以允许它显示提供数据,通过模型派生自QAbstractItemModel类。![]()
另请参阅
QColumnView
(
[
parent=None
]
)
¶
- param parent
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.
另请参阅
PySide2.QtWidgets.QColumnView.
createColumn
(
rootIndex
)
¶
rootIndex
–
QModelIndex
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()
.
另请参阅
PySide2.QtWidgets.QColumnView.
previewWidget
(
)
¶
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