ItemSelectionModel QML 类型

实例化 QItemSelectionModel 以用于结合 QAbstractItemModel 及支持它的任何视图。 更多...

import 语句: import QtQml.Models 2.2
Since: Qt 5.5
实例化: QItemSelectionModel

特性

信号

方法

详细描述

另请参阅 QItemSelectionModel and Models and Views in Qt Quick .

特性文档编制

[read-only] currentIndex : QModelIndex

使用 setCurrentIndex() to set its value.

另请参阅 setCurrentIndex() and currentChanged() .

[read-only] hasSelection : bool

It will trigger property binding updates every time selectionChanged() is emitted, even though its value hasn't changed.

另请参阅 selection(), selectedIndexes , select() ,和 selectionChanged() .

model : QAbstractItemModel

This property's value must match the view's model.

[read-only] selectedIndexes : QModelIndexList

Contains the list of all the indexes in the selection model.

[read-only] selection : 对象

Holds the selection ranges stored in the selection model.


信号文档编制

currentChanged ( QModelIndex current , QModelIndex previous )

此信号被发射每当当前项改变。 previous model item index is replaced by the current index as the selection's current item.

Note that this signal will not be emitted when the item model is reset.

另请参阅 currentIndex(), setCurrentIndex() ,和 selectionChanged() .

selectionChanged ( QItemSelection selected , QItemSelection deselected )

This signal is emitted whenever the selection changes. The change in the selection is represented as an item selection of deselected items and an item selection of selected 项。

Note the that the current index changes independently from the selection. Also note that this signal will not be emitted when the item model is reset.

另请参阅 select() and currentChanged() .


方法文档编制

void clear ()

清零选定模型。发射 selectionChanged() and currentChanged() .

void clearCurrentIndex ()

清零当前索引。发射 currentChanged() .

void clearSelection ()

Clears the selection in the selection model. Emits selectionChanged() .

bool columnIntersectsSelection ( int column , QModelIndex parent )

返回 true 若有选中任何项在 column 采用给定 parent .

bool isColumnSelected ( int column , QModelIndex parent )

返回 true if all items are selected in the column 采用给定 parent .

Note that this function is usually faster than calling isSelected() on all items in the same column, and that unselectable items are ignored.

bool isRowSelected ( int row , QModelIndex parent )

返回 true if all items are selected in the row 采用给定 parent .

Note that this function is usually faster than calling isSelected() on all items in the same row, and that unselectable items are ignored.

bool isSelected ( QModelIndex index )

返回 true 若给定模型项 index 被选中。

void reset ()

Clears the selection model. Does not emit any signals.

bool rowIntersectsSelection ( int row , QModelIndex parent )

返回 true 若有选中任何项在 row 采用给定 parent .

void select ( QItemSelection selection , SelectionFlags 命令 )

void select ( QModelIndex index , SelectionFlags 命令 )

QModelIndexList selectedColumns ( int row )

返回的索引在给定 row 对于选中所有行的列而言。

另请参阅 selectedRows() .

QModelIndexList selectedRows ( int column )

返回的索引在给定 column 对于选中所有列的行而言。

另请参阅 selectedColumns() .

void setCurrentIndex ( QModelIndex index , SelectionFlags 命令 )

版权所有  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1