The QTreeView 類為樹視圖提供默認模型/視圖實現。 更多...
| 頭: | #include <QTreeView> |
| 繼承: | QAbstractItemView |
| 繼承者: | QHelpContentWidget and QTreeWidget |
|
|
| QTreeView (QWidget * parent = 0) | |
| ~QTreeView () | |
| bool | allColumnsShowFocus () const |
| int | autoExpandDelay () const |
| int | columnAt (int x ) const |
| int | columnViewportPosition (int column ) const |
| int | columnWidth (int column ) const |
| bool | expandsOnDoubleClick () const |
| QHeaderView * | header () const |
| int | indentation () const |
| QModelIndex | indexAbove (const QModelIndex & index ) const |
| QModelIndex | indexBelow (const QModelIndex & index ) const |
| bool | isAnimated () const |
| bool | isColumnHidden (int column ) const |
| bool | isExpanded (const QModelIndex & index ) const |
| bool | isFirstColumnSpanned (int row , const QModelIndex & parent ) const |
| bool | isHeaderHidden () const |
| bool | isRowHidden (int row , const QModelIndex & parent ) const |
| bool | isSortingEnabled () const |
| bool | itemsExpandable () const |
| bool | rootIsDecorated () const |
| void | setAllColumnsShowFocus (bool enable ) |
| void | setAnimated (bool enable ) |
| void | setAutoExpandDelay (int delay ) |
| void | setColumnHidden (int column , bool hide ) |
| void | setColumnWidth (int column , int width ) |
| void | setExpanded (const QModelIndex & index , bool expanded ) |
| void | setExpandsOnDoubleClick (bool enable ) |
| void | setFirstColumnSpanned (int row , const QModelIndex & parent , bool span ) |
| void | setHeader (QHeaderView * header ) |
| void | setHeaderHidden (bool hide ) |
| void | setIndentation (int i ) |
| void | setItemsExpandable (bool enable ) |
| void | setRootIsDecorated (bool show ) |
| void | setRowHidden (int row , const QModelIndex & parent , bool hide ) |
| void | setSortingEnabled (bool enable ) |
| void | setUniformRowHeights (bool uniform ) |
| void | setWordWrap (bool on ) |
| void | sortByColumn (int column , Qt::SortOrder order ) |
| bool | uniformRowHeights () const |
| bool | wordWrap () const |
| virtual void | dataChanged (const QModelIndex & topLeft , const QModelIndex & bottomRight ) |
| virtual QModelIndex | indexAt (const QPoint & point ) const |
| virtual void | keyboardSearch (const QString & search ) |
| virtual void | reset () |
| 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 * selectionModel ) |
| virtual QRect | visualRect (const QModelIndex & index ) const |
| void | collapse (const QModelIndex & index ) |
| void | collapseAll () |
| void | expand (const QModelIndex & index ) |
| void | expandAll () |
| void | expandToDepth (int depth ) |
| void | hideColumn (int column ) |
| void | resizeColumnToContents (int column ) |
| void | showColumn (int column ) |
| void | collapsed (const QModelIndex & index ) |
| void | expanded (const QModelIndex & index ) |
| virtual void | drawBranches (QPainter * painter , const QRect & rect , const QModelIndex & index ) const |
| virtual void | drawRow (QPainter * painter , const QStyleOptionViewItem & option , const QModelIndex & index ) const |
| void | drawTree (QPainter * painter , const QRegion & region ) const |
| int | indexRowSizeHint (const QModelIndex & index ) const |
| int | rowHeight (const QModelIndex & index ) const |
| virtual void | currentChanged (const QModelIndex & current , const QModelIndex & previous ) |
| virtual void | dragMoveEvent (QDragMoveEvent * event ) |
| virtual int | horizontalOffset () const |
| virtual bool | isIndexHidden (const QModelIndex & index ) const |
| virtual void | keyPressEvent (QKeyEvent * event ) |
| virtual void | mouseDoubleClickEvent (QMouseEvent * event ) |
| virtual void | mouseMoveEvent (QMouseEvent * event ) |
| virtual void | mousePressEvent (QMouseEvent * event ) |
| virtual void | mouseReleaseEvent (QMouseEvent * event ) |
| virtual QModelIndex | moveCursor (CursorAction cursorAction , Qt::KeyboardModifiers modifiers ) |
| virtual void | paintEvent (QPaintEvent * event ) |
| virtual void | rowsAboutToBeRemoved (const QModelIndex & parent , int start , int end ) |
| virtual void | rowsInserted (const QModelIndex & parent , int start , int end ) |
| virtual void | scrollContentsBy (int dx , int dy ) |
| virtual QModelIndexList | selectedIndexes () const |
| virtual void | selectionChanged (const QItemSelection & selected , const QItemSelection & deselected ) |
| virtual void | setSelection (const QRect & rect , QItemSelectionModel::SelectionFlags command ) |
| virtual int | sizeHintForColumn (int column ) const |
| virtual void | timerEvent (QTimerEvent * event ) |
| virtual void | updateGeometries () |
| virtual int | verticalOffset () const |
| virtual bool | viewportEvent (QEvent * event ) |
| virtual QRegion | visualRegionForSelection (const QItemSelection & selection ) const |
| void | columnCountChanged (int oldCount , int newCount ) |
| void | columnMoved () |
| void | columnResized (int column , int oldSize , int newSize ) |
| void | rowsRemoved (const QModelIndex & parent , int start , int end ) |
The QTreeView 類為樹視圖提供默認模型/視圖實現。
A
QTreeView
實現來自模型的項的樹錶示。此類用於提供標準分層列錶,先前提供是通過
QListView
類,但使用由 Qt 模型/視圖體係結構提供的方式更靈活。
The QTreeView 類是一種 模型/視圖類 且屬於 Qt 的 模型/視圖框架 .
QTreeView 實現接口的定義通過 QAbstractItemView 類以允許它顯示提供數據,通過模型派生自 QAbstractItemModel 類。
構建樹視圖以顯示來自模型的數據很簡單。在以下範例中,目錄內容的提供通過 QFileSystemModel 並作為樹顯示:
QFileSystemModel *model = new QFileSystemModel;
model->setRootPath(QDir::currentPath());
QTreeView *tree = new QTreeView(splitter);
tree->setModel(model);
模型/視圖體係結構確保樹視圖內容隨模型改變更新。
擁有子級的項可以處於展開 (子級可見) 或摺疊 (隱藏子級) 狀態。當此狀態改變 collapsed () 或 expanded () 信號被發射帶有相關項模型索引。
用於指示層次結構級彆縮進量的控製通過 indentation 特性。
樹視圖 Header (頭部) 的構造是使用
QHeaderView
類且可以被隱藏使用
header()->hide()
。注意,每個 Header (頭部) 的配置是采用其
stretchLastSection
特性被設為 true,確保視圖不浪費為 Header (頭部) 賦值的任何空間。若此值被設為 true,此特性將覆蓋 Header (頭部) 最後區間設置的重置大小模式。
QTreeView 支持使用戶能夠在視圖中導航並與項內容交互的一組鍵綁定:
| Key | 動作 |
|---|---|
| Up | 將光標移至上一行相同列項。若當前項父級沒有更多行可導航,光標將移至父級之前最後同級行相關項。 |
| Down | 將光標移至下一行相同項列。若當前項父級沒有更多行可導航,光標將移至緊隨父級的第一同級行相關項。 |
| Left | 通過摺疊分支,隱藏當前項的子級 (若存在)。 |
| Minus | 如同 LeftArrow。 |
| Right | 通過展開分支,展現當前項的子級 (若存在)。 |
| Plus | 如同 RightArrow。 |
| Asterisk | 展開當前項的所有子級 (若存在)。 |
| PageUp | 上移光標一頁。 |
| PageDown | 下移光標一頁。 |
| Home | 將光標移至模型中第一頂層項第一行同一列項。 |
| End | 將光標移至模型中最後頂層項最後行同一列項。 |
| F2 | 對於可編輯模型,這打開當前項以供編輯。Escape 鍵可以用於取消編輯過程,並恢復顯示數據的任何改變。 |
|
|
|
| A Windows XP style tree view. | A Macintosh style tree view. | A Plastique style tree view. |
給齣正處理數據的有關視圖提示,以提高其性能是可能的,當顯示大量項時。對於打算顯示等高項的視圖,可以接受的一種方式是設置 uniformRowHeights 特性為 true。
另請參閱 QListView , QTreeWidget , 視圖類 , QAbstractItemModel , QAbstractItemView ,和 目錄視圖範例 .
This property holds whether items should show keyboard focus using all columns.
If this property is true all columns will show focus, otherwise only one column will show focus.
默認為 false。
該特性在 Qt 4.2 引入。
訪問函數:
| bool | allColumnsShowFocus () const |
| void | setAllColumnsShowFocus (bool enable ) |
This property holds whether animations are enabled.
If this property is true the treeview will animate expandsion and collasping of branches. If this property is false, the treeview will expand or collapse branches immediately without showing the animation.
默認情況下,此特性為 false。
該特性在 Qt 4.2 引入。
訪問函數:
| bool | isAnimated () const |
| void | setAnimated (bool enable ) |
此特性保持延遲時間,在拖放操作期間打開樹項之前。
此特性保持以毫秒為單位的時間量,在該節點自動打開 (或關閉) 之前用戶必須在節點上等待。若將時間設為小於 0,則不激活。
默認情況下,此特性擁有 -1 值,意味著禁用自動展開。
該特性在 Qt 4.3 引入。
訪問函數:
| int | autoExpandDelay () const |
| void | setAutoExpandDelay (int delay ) |
此特性保持是否可以通過雙擊展開項。
此特性保持用戶是否可以通過雙擊展開和摺疊項。默認值為 true。
該特性在 Qt 4.4 引入。
訪問函數:
| bool | expandsOnDoubleClick () const |
| void | setExpandsOnDoubleClick (bool enable ) |
另請參閱 itemsExpandable .
此特性保持是否展示 Header (頭)。
If this property is true, the header is not shown otherwise it is. The default value is false.
該特性在 Qt 4.4 引入。
訪問函數:
| bool | isHeaderHidden () const |
| void | setHeaderHidden (bool hide ) |
另請參閱 header ().
This property holds indentation of the items in the tree view.
此特性保持樹視圖每級項的縮進度量 (以像素為單位)。對於頂層項,縮進指定從視口邊緣到第一列項的水平距離;對於子級項,從父級項指定其縮進。
By default, this property has a value of 20.
訪問函數:
| int | indentation () const |
| void | setIndentation (int i ) |
此特性保持項是否可以由用戶展開。
此特性保持用戶是否可以交互展開和摺疊項。
默認情況下,此特性為 true。
訪問函數:
| bool | itemsExpandable () const |
| void | setItemsExpandable (bool enable ) |
This property holds whether to show controls for expanding and collapsing top-level items.
通常,采用控件展示具有子級的項的展開和摺疊,允許展示 (或隱藏) 它們的子級。若此特性為 false,頂層項不展示這些控件。這可以用於使單級樹結構,外觀像簡單項列錶。
默認情況下,此特性為 true。
訪問函數:
| bool | rootIsDecorated () const |
| void | setRootIsDecorated (bool show ) |
This property holds whether sorting is enabled.
If this property is true, sorting is enabled for the tree; if the property is false, sorting is not enabled. The default value is false.
注意: 為避免性能問題,推薦啓用排序 after 將項插入樹中。另外,也可以將項插入列錶,在將項插入樹之前。
該特性在 Qt 4.2 引入。
訪問函數:
| bool | isSortingEnabled () const |
| void | setSortingEnabled (bool enable ) |
另請參閱 sortByColumn ().
This property holds whether all items in the treeview have the same height.
此特性纔應該被設為 true,若保證視圖中所有項擁有相同高度。這使視圖能夠做一些優化。
高度是從視圖中第 1 項獲得的。它被更新,當該項中的數據變化時。
默認情況下,此特性為 false。
訪問函數:
| bool | uniformRowHeights () const |
| void | setUniformRowHeights (bool uniform ) |
This property holds the item text word-wrapping policy.
If this property is true then the item text is wrapped where necessary at word-breaks; otherwise it is not wrapped at all. This property is false by default.
注意,即使有啓用換行,也不會展開單元格以擬閤所有文本。將插入省略根據當前 textElideMode .
該特性在 Qt 4.3 引入。
訪問函數:
| bool | wordWrap () const |
| void | setWordWrap (bool on ) |
構造樹視圖采用 parent 來錶示模型數據。使用 setModel () 來設置模型。
另請參閱 QAbstractItemModel .
銷毀樹視圖。
[slot]
void
QTreeView::
collapse
(const
QModelIndex
&
index
)
摺疊的模型項指定通過 index .
另請參閱 collapsed ().
[slot]
void
QTreeView::
collapseAll
()
摺疊所有展開項。
該函數在 Qt 4.2 引入。
另請參閱 expandAll (), expand (), collapse (),和 setExpanded ().
[signal]
void
QTreeView::
collapsed
(const
QModelIndex
&
index
)
此信號發射,當項指定通過 index is collapsed.
返迴樹視圖中的列,其 Header (頭部) 覆蓋 x 給定坐標。
[protected slot]
void
QTreeView::
columnCountChanged
(
int
oldCount
,
int
newCount
)
告知樹視圖,樹視圖中的列數有改變從 oldCount to newCount .
[protected slot]
void
QTreeView::
columnMoved
()
此槽被調用,每當有移動列。
[protected slot]
void
QTreeView::
columnResized
(
int
column
,
int
oldSize
,
int
newSize
)
此函數被調用每當 column 的大小有改變在 Header (頭部)。 oldSize and newSize 給齣先前大小和新的大小 (以像素為單位)。
另請參閱 setColumnWidth ().
返迴水平位置按 column 在視口。
返迴寬度為 column .
另請參閱 resizeColumnToContents () 和 setColumnWidth ().
[virtual protected]
void
QTreeView::
currentChanged
(const
QModelIndex
&
current
, const
QModelIndex
&
previous
)
重實現自 QAbstractItemView::currentChanged ().
[虛擬]
void
QTreeView::
dataChanged
(const
QModelIndex
&
topLeft
, const
QModelIndex
&
bottomRight
)
重實現自 QAbstractItemView::dataChanged ().
[virtual protected]
void
QTreeView::
dragMoveEvent
(
QDragMoveEvent
*
event
)
重實現自 QWidget::dragMoveEvent ().
[virtual protected]
void
QTreeView::
drawBranches
(
QPainter
*
painter
, const
QRect
&
rect
, const
QModelIndex
&
index
) const
繪製同一行樹視圖中的分支如同模型項 index ,使用 painter 給定。分支繪製在矩形內指定通過 rect .
[virtual protected]
void
QTreeView::
drawRow
(
QPainter
*
painter
, const
QStyleOptionViewItem
&
option
, const
QModelIndex
&
index
) const
繪製樹視圖中的行包含模型項 index ,使用 painter 給定。 option control how the item is displayed.
另請參閱 setAlternatingRowColors ().
[protected]
void
QTreeView::
drawTree
(
QPainter
*
painter
, const
QRegion
&
region
) const
繪製樹相交部分為給定 region 使用指定 painter .
該函數在 Qt 4.2 引入。
另請參閱 paintEvent ().
[slot]
void
QTreeView::
expand
(const
QModelIndex
&
index
)
展開模型項指定通過 index .
另請參閱 expanded ().
[slot]
void
QTreeView::
expandAll
()
展開所有可展開項。
Warning: if the model contains a large number of items, this function will take some time to execute.
該函數在 Qt 4.2 引入。
另請參閱 collapseAll (), expand (), collapse (),和 setExpanded ().
[slot]
void
QTreeView::
expandToDepth
(
int
depth
)
展開所有可展開項到給定 depth .
該函數在 Qt 4.3 引入。
另請參閱 expandAll (), collapseAll (), expand (), collapse (),和 setExpanded ().
[signal]
void
QTreeView::
expanded
(const
QModelIndex
&
index
)
此信號發射,當項指定通過 index 被展開。
另請參閱 setExpanded ().
返迴用於樹視圖的 Header (頭部)。
另請參閱 setHeader () 和 QAbstractItemModel::headerData ().
[slot]
void
QTreeView::
hideColumn
(
int
column
)
隱藏 column 給定。
注意: 此函數纔應該被調用在模型已初始化後,因為視圖需要知道列數為隱藏 column .
另請參閱 showColumn () 和 setColumnHidden ().
[virtual protected]
int
QTreeView::
horizontalOffset
() const
重實現自 QAbstractItemView::horizontalOffset ().
返迴樹視圖中項的水平偏移。
注意,樹視圖使用水平 Header (頭部) 區間位置,來確定視圖中列的位置。
另請參閱 verticalOffset ().
返迴的項模型索引高於 index .
[虛擬]
QModelIndex
QTreeView::
indexAt
(const
QPoint
&
point
) const
重實現自 QAbstractItemView::indexAt ().
返迴的項模型索引底於 index .
[protected]
int
QTreeView::
indexRowSizeHint
(const
QModelIndex
&
index
) const
返迴行的大小提示,指示通過 index .
另請參閱 sizeHintForColumn () 和 uniformRowHeights ().
返迴 true 若 column is hidden; otherwise returns false.
另請參閱 hideColumn () 和 isRowHidden ().
Returns true if the model item index 被展開;否則返迴 false。
另請參閱 expand (), expanded (),和 setExpanded ().
Returns true if the item in first column in the given row 的 parent is spanning all the columns; otherwise returns false.
該函數在 Qt 4.3 引入。
另請參閱 setFirstColumnSpanned ().
[virtual protected]
bool
QTreeView::
isIndexHidden
(const
QModelIndex
&
index
) const
重實現自 QAbstractItemView::isIndexHidden ().
Returns true if the item in the given row 的 parent is hidden; otherwise returns false.
另請參閱 setRowHidden () 和 isColumnHidden ().
[virtual protected]
void
QTreeView::
keyPressEvent
(
QKeyEvent
*
event
)
重實現自 QWidget::keyPressEvent ().
[虛擬]
void
QTreeView::
keyboardSearch
(const
QString
&
search
)
重實現自 QAbstractItemView::keyboardSearch ().
[virtual protected]
void
QTreeView::
mouseDoubleClickEvent
(
QMouseEvent
*
event
)
重實現自 QWidget::mouseDoubleClickEvent ().
[virtual protected]
void
QTreeView::
mouseMoveEvent
(
QMouseEvent
*
event
)
重實現自 QWidget::mouseMoveEvent ().
[virtual protected]
void
QTreeView::
mousePressEvent
(
QMouseEvent
*
event
)
重實現自 QWidget::mousePressEvent ().
[virtual protected]
void
QTreeView::
mouseReleaseEvent
(
QMouseEvent
*
event
)
重實現自 QWidget::mouseReleaseEvent ().
[virtual protected]
QModelIndex
QTreeView::
moveCursor
(
CursorAction
cursorAction
,
Qt::KeyboardModifiers
modifiers
)
重實現自 QAbstractItemView::moveCursor ().
按指定方式移動光標,描述通過 cursorAction ,使用信息的提供通過按鈕 modifiers .
[virtual protected]
void
QTreeView::
paintEvent
(
QPaintEvent
*
event
)
重實現自 QWidget::paintEvent ().
[虛擬]
void
QTreeView::
reset
()
重實現自 QAbstractItemView::reset ().
[slot]
void
QTreeView::
resizeColumnToContents
(
int
column
)
重置大小 column 給定到其內容大小。
另請參閱 columnWidth () 和 setColumnWidth ().
[protected]
int
QTreeView::
rowHeight
(const
QModelIndex
&
index
) const
返迴指示行的高度通過給定 index .
該函數在 Qt 4.3 引入。
另請參閱 indexRowSizeHint ().
[virtual protected]
void
QTreeView::
rowsAboutToBeRemoved
(const
QModelIndex
&
parent
,
int
start
,
int
end
)
重實現自 QAbstractItemView::rowsAboutToBeRemoved ().
告知視圖行從 start 行到 end 行 (包括在內) 即將被移除從給定 parent 模型項。
[virtual protected]
void
QTreeView::
rowsInserted
(const
QModelIndex
&
parent
,
int
start
,
int
end
)
重實現自 QAbstractItemView::rowsInserted ().
告知視圖行從 start 行到 end 行 (包括在內) 已插入 parent 模型項。
[protected slot]
void
QTreeView::
rowsRemoved
(const
QModelIndex
&
parent
,
int
start
,
int
end
)
告知視圖行從 start 行到 end 行 (包括在內) 已移除從給定 parent 模型項。
該函數在 Qt 4.1 引入。
[virtual protected]
void
QTreeView::
scrollContentsBy
(
int
dx
,
int
dy
)
重實現自 QAbstractScrollArea::scrollContentsBy ().
捲動樹視圖內容通過 ( dx , dy ).
[虛擬]
void
QTreeView::
scrollTo
(const
QModelIndex
&
index
,
ScrollHint
hint
= EnsureVisible)
重實現自 QAbstractItemView::scrollTo ().
捲動樹視圖的內容,直到給定模型項 index 可見。 hint 參數更準確地指定操作後應定位的項。若模型項的任何父級被摺疊,將展開它們以確保模型項可見。
[虛擬]
void
QTreeView::
selectAll
()
重實現自 QAbstractItemView::selectAll ().
[virtual protected]
QModelIndexList
QTreeView::
selectedIndexes
() const
重實現自 QAbstractItemView::selectedIndexes ().
[virtual protected]
void
QTreeView::
selectionChanged
(const
QItemSelection
&
selected
, const
QItemSelection
&
deselected
)
重實現自 QAbstractItemView::selectionChanged ().
若 hide 為 true column 被隱藏,否則 column 被展示。
另請參閱 isColumnHidden (), hideColumn (),和 setRowHidden ().
設置寬度為給定 column 到 width 指定。
該函數在 Qt 4.2 引入。
另請參閱 columnWidth () 和 resizeColumnToContents ().
設置項引用通過 index 到摺疊 (或展開),從屬值 expanded .
另請參閱 expanded (), expand (),和 isExpanded ().
若 span 為 true,第 1 列中的項在 row 采用給定 parent 被設為跨所有列,否則所有項對於 row 被展示。
該函數在 Qt 4.3 引入。
另請參閱 isFirstColumnSpanned ().
把用於樹視圖的 Header (頭部) 設為給定 header .
視圖擁有所有權通過給定 header 並刪除它,當有設置新的 Header (頭部) 時。
另請參閱 QAbstractItemModel::headerData ().
[虛擬]
void
QTreeView::
setModel
(
QAbstractItemModel
*
model
)
重實現自 QAbstractItemView::setModel ().
[虛擬]
void
QTreeView::
setRootIndex
(const
QModelIndex
&
index
)
重實現自 QAbstractItemView::setRootIndex ().
若 hide 為 true row 采用給定 parent 被隱藏,否則 row 被展示。
另請參閱 isRowHidden () 和 setColumnHidden ().
[virtual protected]
void
QTreeView::
setSelection
(const
QRect
&
rect
,
QItemSelectionModel::SelectionFlags
command
)
重實現自 QAbstractItemView::setSelection ().
應用選定 command 到矩形內項,或觸及的通過矩形 rect .
另請參閱 selectionCommand ().
[虛擬]
void
QTreeView::
setSelectionModel
(
QItemSelectionModel
*
selectionModel
)
重實現自 QAbstractItemView::setSelectionModel ().
[slot]
void
QTreeView::
showColumn
(
int
column
)
展示給定 column 在樹視圖。
另請參閱 hideColumn () 和 setColumnHidden ().
[virtual protected]
int
QTreeView::
sizeHintForColumn
(
int
column
) const
重實現自 QAbstractItemView::sizeHintForColumn ().
返迴大小提示為 column 的寬度或 -1 若沒有模型。
若需要把給定列寬度設為固定值,調用 QHeaderView::resizeSection () 在視圖的 Header (頭部)。
若在子類中重實現此函數,注意,將僅使用返迴值當 resizeColumnToContents () 被調用。在此情況下,若視圖的 Header (頭部) 或項委托要求更大的列寬度,使用此寬度代替。
另請參閱 QWidget::sizeHint and header ().
Sets the model up for sorting by the values in the given column and order .
column 可以是 -1,在這種情況下,不會展示排序指示器,且模型將返迴其自然、未排序次序。注意,所有模型並非都支持這,且在這種情況下甚至可能崩潰。
該函數在 Qt 4.2 引入。
另請參閱 sortingEnabled .
[virtual protected]
void
QTreeView::
timerEvent
(
QTimerEvent
*
event
)
重實現自 QObject::timerEvent ().
[virtual protected]
void
QTreeView::
updateGeometries
()
重實現自 QAbstractItemView::updateGeometries ().
[virtual protected]
int
QTreeView::
verticalOffset
() const
重實現自 QAbstractItemView::verticalOffset ().
返迴樹視圖中項的垂直偏移。
另請參閱 horizontalOffset ().
[virtual protected]
bool
QTreeView::
viewportEvent
(
QEvent
*
event
)
重實現自 QAbstractScrollArea::viewportEvent ().
[虛擬]
QRect
QTreeView::
visualRect
(const
QModelIndex
&
index
) const
重實現自 QAbstractItemView::visualRect ().
返迴項所占據的視口矩形為 index 。若索引不可見或被明確隱藏,返迴矩形無效。
[virtual protected]
QRegion
QTreeView::
visualRegionForSelection
(const
QItemSelection
&
selection
) const
重實現自 QAbstractItemView::visualRegionForSelection ().
返迴矩形從項視口在給定 selection .
從 4.7 起,返迴區域僅包含 (或包括在) 視口相交矩形。