ItemSelectionModel QML Type
QAbstractItemModel 및 이를 지원하는 모든 보기와 함께 사용할 QItemSelectionModel 을 인스턴스화합니다. 더 보기...
Import Statement: | import QtQml.Models |
In C++: | QItemSelectionModel |
속성
- currentIndex : QModelIndex
- hasSelection : bool
- model : QAbstractItemModel
- selectedIndexes : QModelIndexList
- selection : object
신호
- currentChanged(QModelIndex current, QModelIndex previous)
- selectionChanged(QItemSelection selected, QItemSelection deselected)
방법
- void clear()
- void clearCurrentIndex()
- void clearSelection()
- bool columnIntersectsSelection(int column, QModelIndex parent)
- bool isColumnSelected(int column, QModelIndex parent)
- bool isRowSelected(int row, QModelIndex parent)
- bool isSelected(QModelIndex index)
- void reset()
- bool rowIntersectsSelection(int row, QModelIndex parent)
- void select(QItemSelection selection, SelectionFlags command)
- void select(QModelIndex index, SelectionFlags command)
- QModelIndexList selectedColumns(int row)
- QModelIndexList selectedRows(int column)
- void setCurrentIndex(QModelIndex index, SelectionFlags command)
자세한 설명
QItemSelectionModel 및 Qt Quick 의 모델 및 뷰도참조하세요 .
속성 문서
currentIndex : QModelIndex |
setCurrentIndex()를 사용하여 값을 설정합니다.
setCurrentIndex() 및 currentChanged()도 참조하세요 .
hasSelection : bool |
값이 변경되지 않았더라도 selectionChanged()가 전송될 때마다 속성 바인딩 업데이트가 트리거됩니다.
selection, selectedIndexes, select() 및 selectionChanged()도 참조 하세요.
model : QAbstractItemModel |
이 속성의 값은 뷰의 모델과 일치해야 합니다.
selectedIndexes : QModelIndexList |
선택 모델의 모든 인덱스 목록을 포함합니다.
selection : object |
선택 모델에 저장된 선택 범위를 보유합니다.
신호 문서
currentChanged(QModelIndex current, QModelIndex previous) |
이 신호는 현재 항목이 변경될 때마다 발생합니다. previous 모델 항목 인덱스는 선택 항목의 현재 항목으로 current 인덱스로 대체됩니다.
항목 모델이 재설정되면 이 신호가 발생하지 않습니다.
참고: 해당 핸들러는 onCurrentChanged
입니다.
currentIndex, setCurrentIndex() 및 selectionChanged()도 참조하세요 .
selectionChanged(QItemSelection selected, QItemSelection deselected) |
이 신호는 선택 항목이 변경될 때마다 발생합니다. 선택 항목의 변경은 deselected 항목의 항목 선택과 selected 항목의 항목 선택으로 표시됩니다.
현재 인덱스는 선택 항목과 독립적으로 변경된다는 점에 유의하세요. 또한 이 신호는 항목 모델이 재설정될 때는 발생하지 않습니다.
참고: 해당 핸들러는 onSelectionChanged
입니다.
select() 및 currentChanged()도 참조하세요 .
메서드 문서
void clear() |
선택 모델을 지웁니다. selectionChanged () 및 currentChanged()를 방출합니다.
void clearCurrentIndex() |
현재 인덱스를 지웁니다. currentChanged ()를 반환합니다.
void clearSelection() |
선택 모델에서 선택을 지웁니다. selectionChanged ()를 출력합니다.
주어진 parent 과 함께 column 에서 선택된 항목이 있는 경우 true
을 반환합니다.
주어진 parent 과 함께 column 에서 모든 항목이 선택된 경우 true
을 반환합니다.
이 함수는 일반적으로 같은 열의 모든 항목에 대해 isSelected()를 호출하는 것보다 빠르며, 선택되지 않은 항목은 무시된다는 점에 유의하세요.
주어진 parent 과 함께 row 에서 모든 항목이 선택된 경우 true
을 반환합니다.
이 함수는 일반적으로 같은 행의 모든 항목에 대해 isSelected()를 호출하는 것보다 빠르며, 선택할 수 없는 항목은 무시된다는 점에 유의하세요.
bool isSelected(QModelIndex index) |
주어진 모델 항목 index 이 선택된 경우 true
을 반환합니다.
void reset() |
선택 모델을 지웁니다. 어떤 신호도 방출하지 않습니다.
지정된 parent 을 사용하여 row 에 선택된 항목이 있는 경우 true
을 반환합니다.
void select(QItemSelection selection, SelectionFlags command) |
지정된 command 을 사용하여 selection 항목을 선택하고 selectionChanged()을 반환합니다.
유효한 command 값은 select(index, command).
void select(QModelIndex index, SelectionFlags command) |
지정된 command 을 사용하여 모델 항목 index 을 선택하고 selectionChanged()를 반환합니다.
command 매개 변수의 유효한 값은 다음과 같습니다:
Constant | 설명 |
---|---|
NoUpdate | 선택이 수행되지 않습니다. |
Clear | 전체 선택이 지워집니다. |
Select | 지정된 모든 인덱스가 선택됩니다. |
Deselect | 지정된 모든 인덱스가 선택 해제됩니다. |
Toggle | 지정된 모든 인덱스가 현재 상태에 따라 선택되거나 선택 해제됩니다. |
Current | 현재 선택 항목이 업데이트됩니다. |
Rows | 모든 인덱스가 스팬 행으로 확장됩니다. |
Columns | 모든 인덱스가 스팬 열로 확장됩니다. |
SelectCurrent | 편의를 위해 선택과 현재를 조합하여 제공합니다. |
ToggleCurrent | 편의를 위해 제공되는 토글과 현재의 조합입니다. |
ClearAndSelect | 편의를 위해 제공되는 지우기와 선택의 조합입니다. |
QModelIndexList selectedColumns(int row) |
모든 행이 선택된 열에 대해 주어진 row 에 있는 인덱스를 반환합니다.
selectedRows()도 참조하세요 .
QModelIndexList selectedRows(int column) |
모든 열이 선택된 행에 대해 주어진 column 의 인덱스를 반환합니다.
selectedColumns()도 참조하세요 .
void setCurrentIndex(QModelIndex index, SelectionFlags command) |
모델 항목 index 을 현재 항목으로 설정하고 currentChanged()을 출력합니다. 현재 항목은 키보드 탐색 및 초점 표시에 사용되며, 선택한 항목과 독립적이지만 선택한 항목도 현재 항목이 될 수 있습니다.
지정된 command 에 따라 index 도 현재 선택 항목의 일부가 될 수 있습니다.
유효한 command 값은 select(index, command).
select()도 참조하세요 .
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.