The QColumnView 類提供列視圖的模型/視圖實現。 更多...
| 頭: | #include <QColumnView> |
| qmake: | QT += widgets |
| Since: | Qt 4.3 |
| 繼承: | QAbstractItemView |
| QColumnView (QWidget * parent = nullptr) | |
| virtual | ~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 override |
| virtual void | scrollTo (const QModelIndex & index , QAbstractItemView::ScrollHint hint = EnsureVisible) override |
| virtual void | selectAll () override |
| virtual void | setModel (QAbstractItemModel * model ) override |
| virtual void | setRootIndex (const QModelIndex & index ) override |
| virtual void | setSelectionModel (QItemSelectionModel * newSelectionModel ) override |
| virtual QSize | sizeHint () const override |
| virtual QRect | visualRect (const QModelIndex & index ) const override |
| void | updatePreviewWidget (const QModelIndex & index ) |
| const QMetaObject | staticMetaObject |
| virtual QAbstractItemView * | createColumn (const QModelIndex & index ) |
| void | initializeColumn (QAbstractItemView * column ) const |
| virtual void | currentChanged (const QModelIndex & current , const QModelIndex & previous ) override |
| virtual int | horizontalOffset () const override |
| virtual bool | isIndexHidden (const QModelIndex & index ) const override |
| virtual QModelIndex | moveCursor (QAbstractItemView::CursorAction cursorAction , Qt::KeyboardModifiers modifiers ) override |
| virtual void | resizeEvent (QResizeEvent * event ) override |
| virtual void | rowsInserted (const QModelIndex & parent , int start , int end ) override |
| virtual void | scrollContentsBy (int dx , int dy ) override |
| virtual void | setSelection (const QRect & rect , QItemSelectionModel::SelectionFlags command ) override |
| virtual int | verticalOffset () const override |
| virtual QRegion | visualRegionForSelection (const QItemSelection & selection ) const override |
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 .
[虛擬]
QColumnView::
~QColumnView
()
銷毀列視圖。
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 ().
[override virtual protected]
void
QColumnView::
currentChanged
(const
QModelIndex
&
current
, const
QModelIndex
&
previous
)
重實現自 QAbstractItemView::currentChanged ().
[override virtual protected]
int
QColumnView::
horizontalOffset
() const
重實現自 QAbstractItemView::horizontalOffset ().
[override virtual]
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 ().
[override virtual protected]
bool
QColumnView::
isIndexHidden
(const
QModelIndex
&
index
) const
重實現自 QAbstractItemView::isIndexHidden ().
[override virtual protected]
QModelIndex
QColumnView::
moveCursor
(
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
Returns the preview widget, or 0 if there is none.
另請參閱 setPreviewWidget () 和 updatePreviewWidget ().
[override virtual protected]
void
QColumnView::
resizeEvent
(
QResizeEvent
*
event
)
重實現自 QAbstractItemView::resizeEvent ().
[override virtual protected]
void
QColumnView::
rowsInserted
(const
QModelIndex
&
parent
,
int
start
,
int
end
)
重實現自 QAbstractItemView::rowsInserted ().
[override virtual protected]
void
QColumnView::
scrollContentsBy
(
int
dx
,
int
dy
)
重實現自 QAbstractScrollArea::scrollContentsBy ().
[override virtual]
void
QColumnView::
scrollTo
(const
QModelIndex
&
index
,
QAbstractItemView::ScrollHint
hint
= EnsureVisible)
重實現自 QAbstractItemView::scrollTo ().
[override virtual]
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 ().
[override virtual]
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 ().
[override virtual]
void
QColumnView::
setRootIndex
(const
QModelIndex
&
index
)
重實現自 QAbstractItemView::setRootIndex ().
[override virtual protected]
void
QColumnView::
setSelection
(const
QRect
&
rect
,
QItemSelectionModel::SelectionFlags
command
)
重實現自 QAbstractItemView::setSelection ().
[override virtual]
void
QColumnView::
setSelectionModel
(
QItemSelectionModel
*
newSelectionModel
)
重實現自 QAbstractItemView::setSelectionModel ().
[override virtual]
QSize
QColumnView::
sizeHint
() const
重實現自 QAbstractScrollArea::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 ().
[override virtual protected]
int
QColumnView::
verticalOffset
() const
重實現自 QAbstractItemView::verticalOffset ().
[override virtual]
QRect
QColumnView::
visualRect
(const
QModelIndex
&
index
) const
重實現自 QAbstractItemView::visualRect ().
[override virtual protected]
QRegion
QColumnView::
visualRegionForSelection
(const
QItemSelection
&
selection
) const