QColumnView Class Reference

[ QtGui module]

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

继承 QAbstractItemView .

方法

Qt Signals


详细描述

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

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 模型/视图类 且属于 Qt 的 模型/视图框架 .

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


方法文档编制

QColumnView.__init__ ( self , QWidget   parent  = None)

parent argument, if not None, causes self to be owned by Qt instead of PyQt.

Constructs a column view with a parent to represent a model's data. Use setModel () 来设置模型。

另请参阅 QAbstractItemModel .

list-of-int QColumnView.columnWidths ( self )

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

另请参阅 setColumnWidths ().

QAbstractItemView QColumnView.createColumn ( self , QModelIndex   rootIndex )

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.

另请参阅 setPreviewWidget ().

QColumnView.currentChanged ( self , QModelIndex   current , QModelIndex   上一 )

This method is also a Qt slot with the C++ signature void currentChanged(const QModelIndex&,const QModelIndex&) .

重实现自 QAbstractItemView.currentChanged ().

int QColumnView.horizontalOffset ( self )

重实现自 QAbstractItemView.horizontalOffset ().

QModelIndex QColumnView.indexAt ( self , QPoint   point )

重实现自 QAbstractItemView.indexAt ().

QColumnView.initializeColumn ( self , QAbstractItemView   column )

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

该函数在 Qt 4.4 引入。

另请参阅 createColumn ().

bool QColumnView.isIndexHidden ( self , QModelIndex   index )

重实现自 QAbstractItemView.isIndexHidden ().

QModelIndex QColumnView.moveCursor ( self , QAbstractItemView.CursorAction   cursorAction , Qt.KeyboardModifiers   modifiers )

重实现自 QAbstractItemView.moveCursor ().

Move left should go to the parent index Move right should go to the child index or down if there is no child

QWidget QColumnView.previewWidget ( self )

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

另请参阅 setPreviewWidget () 和 updatePreviewWidget ().

QColumnView.resizeEvent ( self , QResizeEvent   event )

重实现自 QWidget.resizeEvent ().

bool QColumnView.resizeGripsVisible ( self )

QColumnView.rowsInserted ( self , QModelIndex   parent , int  start , int  end )

重实现自 QAbstractItemView.rowsInserted ().

QColumnView.scrollContentsBy ( self , int  dx , int  dy )

重实现自 QAbstractScrollArea.scrollContentsBy ().

QColumnView.scrollTo ( self , QModelIndex   index , QAbstractItemView.ScrollHint   hint  = QAbstractItemView.EnsureVisible)

重实现自 QAbstractItemView.scrollTo ().

QColumnView.selectAll ( self )

重实现自 QAbstractItemView.selectAll ().

QColumnView.setColumnWidths ( self , list-of-int  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.

另请参阅 columnWidths () 和 createColumn ().

QColumnView.setModel ( self , QAbstractItemModel   model )

重实现自 QAbstractItemView.setModel ().

QColumnView.setPreviewWidget ( self , QWidget   widget )

widget argument has it's ownership transferred to Qt.

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 被设置。

另请参阅 previewWidget () 和 updatePreviewWidget ().

QColumnView.setResizeGripsVisible ( self , bool  visible )

QColumnView.setRootIndex ( self , QModelIndex   index )

重实现自 QAbstractItemView.setRootIndex ().

QColumnView.setSelection ( self , QRect   rect , QItemSelectionModel.SelectionFlags   command )

重实现自 QAbstractItemView.setSelection ().

QColumnView.setSelectionModel ( self , QItemSelectionModel   selectionModel )

重实现自 QAbstractItemView.setSelectionModel ().

QSize QColumnView.sizeHint ( self )

重实现自 QWidget.sizeHint ().

int QColumnView.verticalOffset ( self )

重实现自 QAbstractItemView.verticalOffset ().

QRect QColumnView.visualRect ( self , QModelIndex   index )

重实现自 QAbstractItemView.visualRect ().

QRegion QColumnView.visualRegionForSelection ( self , QItemSelection   selection )

重实现自 QAbstractItemView.visualRegionForSelection ().


Qt Signal Documentation

void updatePreviewWidget (const QModelIndex&)

This is the default overload of this signal.

This signal is emitted when the preview widget should be updated to provide rich information about index

另请参阅 previewWidget ().