The QColumnView 类提供列视图的模型/视图实现。 更多...
头: | #include <QColumnView> |
qmake: | QT += widgets |
Since: | Qt 4.3 |
继承: | QAbstractItemView |
QColumnView (QWidget * parent = Q_NULLPTR) | |
~QColumnView () | |
QList<int> | columnWidths () const |
QWidget * | previewWidget () const |
bool | resizeGripsVisible () const |
void | setColumnWidths (const QList<int> & list ) |
void | setPreviewWidget (QWidget * widget ) |
void | setResizeGripsVisible (bool visible ) |
virtual QModelIndex | indexAt (const QPoint & point ) const |
virtual void | scrollTo (const QModelIndex & index , ScrollHint hint = EnsureVisible) |
virtual void | selectAll () |
virtual void | setModel (QAbstractItemModel * model ) |
virtual void | setRootIndex (const QModelIndex & index ) |
virtual void | setSelectionModel (QItemSelectionModel * newSelectionModel ) |
virtual QSize | sizeHint () const |
virtual QRect | visualRect (const QModelIndex & index ) const |
void | updatePreviewWidget (const QModelIndex & index ) |
virtual QAbstractItemView * | createColumn (const QModelIndex & index ) |
void | initializeColumn (QAbstractItemView * column ) const |
virtual void | currentChanged (const QModelIndex & current , const QModelIndex & previous ) |
virtual int | horizontalOffset () const |
virtual bool | isIndexHidden (const QModelIndex & index ) const |
virtual QModelIndex | moveCursor (CursorAction cursorAction , Qt::KeyboardModifiers modifiers ) |
virtual void | resizeEvent (QResizeEvent * event ) |
virtual void | rowsInserted (const QModelIndex & parent , int start , int end ) |
virtual void | scrollContentsBy (int dx , int dy ) |
virtual void | setSelection (const QRect & rect , QItemSelectionModel::SelectionFlags 命令 ) |
virtual int | verticalOffset () const |
virtual QRegion | visualRegionForSelection (const QItemSelection & selection ) const |
The QColumnView 类提供列视图的模型/视图实现。
QColumnView 在很多 QListView 中显示模型,树中的每个层次结构都是 QListView。这有时称为级联列表。
The QColumnView 类是一种 模型/视图类 且属于 Qt 的 模型/视图框架 .
QColumnView 实现接口的定义通过 QAbstractItemView 类以允许它显示提供数据,通过模型派生自 QAbstractItemModel 类。
另请参阅 模型/视图编程 .
This property holds the way to specify if the list views gets resize grips or not
默认情况下,
visible
is set to true
访问函数:
bool | resizeGripsVisible () const |
void | setResizeGripsVisible (bool visible ) |
另请参阅 setRootIndex ().
构造列视图采用 parent 来表示模型数据。使用 setModel () 来设置模型。
另请参阅 QAbstractItemModel .
销毁列视图。
Returns a list of the width of all the columns in this view.
另请参阅 setColumnWidths ().
[virtual protected]
QAbstractItemView
*QColumnView::
createColumn
(const
QModelIndex
&
index
)
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 ().
[virtual protected]
void
QColumnView::
currentChanged
(const
QModelIndex
&
current
, const
QModelIndex
&
previous
)
重实现自 QAbstractItemView::currentChanged ().
[virtual protected]
int
QColumnView::
horizontalOffset
() const
重实现自 QAbstractItemView::horizontalOffset ().
[虚拟]
QModelIndex
QColumnView::
indexAt
(const
QPoint
&
point
) const
重实现自 QAbstractItemView::indexAt ().
[protected]
void
QColumnView::
initializeColumn
(
QAbstractItemView
*
column
) const
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 ().
[virtual protected]
bool
QColumnView::
isIndexHidden
(const
QModelIndex
&
index
) const
重实现自 QAbstractItemView::isIndexHidden ().
[virtual protected]
QModelIndex
QColumnView::
moveCursor
(
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
Returns the preview widget, or 0 if there is none.
另请参阅 setPreviewWidget () 和 updatePreviewWidget ().
[virtual protected]
void
QColumnView::
resizeEvent
(
QResizeEvent
*
event
)
重实现自 QWidget::resizeEvent ().
[virtual protected]
void
QColumnView::
rowsInserted
(const
QModelIndex
&
parent
,
int
start
,
int
end
)
重实现自 QAbstractItemView::rowsInserted ().
[virtual protected]
void
QColumnView::
scrollContentsBy
(
int
dx
,
int
dy
)
重实现自 QAbstractScrollArea::scrollContentsBy ().
[虚拟]
void
QColumnView::
scrollTo
(const
QModelIndex
&
index
,
ScrollHint
hint
= EnsureVisible)
重实现自 QAbstractItemView::scrollTo ().
[虚拟]
void
QColumnView::
selectAll
()
重实现自 QAbstractItemView::selectAll ().
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 ().
[虚拟]
void
QColumnView::
setModel
(
QAbstractItemModel
*
model
)
重实现自 QAbstractItemView::setModel ().
设置预览 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.
另请参阅 previewWidget () 和 updatePreviewWidget ().
[虚拟]
void
QColumnView::
setRootIndex
(const
QModelIndex
&
index
)
重实现自 QAbstractItemView::setRootIndex ().
[virtual protected]
void
QColumnView::
setSelection
(const
QRect
&
rect
,
QItemSelectionModel::SelectionFlags
命令
)
重实现自 QAbstractItemView::setSelection ().
[虚拟]
void
QColumnView::
setSelectionModel
(
QItemSelectionModel
*
newSelectionModel
)
重实现自 QAbstractItemView::setSelectionModel ().
[虚拟]
QSize
QColumnView::
sizeHint
() const
重实现自 QWidget::sizeHint ().
[signal]
void
QColumnView::
updatePreviewWidget
(const
QModelIndex
&
index
)
This signal is emitted when the preview widget should be updated to provide rich information about index
另请参阅 previewWidget ().
[virtual protected]
int
QColumnView::
verticalOffset
() const
重实现自 QAbstractItemView::verticalOffset ().
[虚拟]
QRect
QColumnView::
visualRect
(const
QModelIndex
&
index
) const
重实现自 QAbstractItemView::visualRect ().
[virtual protected]
QRegion
QColumnView::
visualRegionForSelection
(const
QItemSelection
&
selection
) const