QItemSelectionRange Class
QItemSelectionRange 클래스는 모델에서 선택한 항목의 범위에 대한 정보를 관리합니다. 더 보기...
Header: | #include <QItemSelectionRange> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
qmake: | QT += core |
이 클래스는 동등 비교가 가능합니다.
공용 함수
QItemSelectionRange() | |
QItemSelectionRange(const QModelIndex &index) | |
QItemSelectionRange(const QModelIndex &topLeft, const QModelIndex &bottomRight) | |
int | bottom() const |
const QPersistentModelIndex & | bottomRight() const |
bool | contains(const QModelIndex &index) const |
bool | contains(int row, int column, const QModelIndex &parentIndex) const |
int | height() const |
QModelIndexList | indexes() const |
QItemSelectionRange | intersected(const QItemSelectionRange &other) const |
bool | intersects(const QItemSelectionRange &other) const |
bool | isEmpty() const |
bool | isValid() const |
int | left() const |
const QAbstractItemModel * | model() const |
QModelIndex | parent() const |
int | right() const |
void | swap(QItemSelectionRange &other) |
int | top() const |
const QPersistentModelIndex & | topLeft() const |
int | width() const |
관련 비회원
bool | operator!=(const QItemSelectionRange &lhs, const QItemSelectionRange &rhs) |
bool | operator==(const QItemSelectionRange &lhs, const QItemSelectionRange &rhs) |
상세 설명
QItemSelectionRange는 모델에서 선택된 항목의 범위에 대한 정보를 포함합니다. 항목 범위는 모델 항목의 연속 배열로, 공통 상위 항목이 있는 인접한 여러 행과 열을 포함하도록 확장되며, 테이블의 2차원 셀 블록으로 시각화할 수 있습니다. 선택 범위에는 top(), left(), bottom(), right() 및 parent()가 있습니다.
QItemSelectionRange 클래스는 모델/뷰 클래스 중 하나이며 Qt의 모델/뷰 프레임워크의 일부입니다.
선택 범위에 포함된 모델 항목은 indexes() 함수를 사용하여 얻을 수 있습니다. QItemSelectionModel::selectedIndexes ()를 사용하여 뷰에 대해 선택된 모든 항목의 목록을 가져옵니다.
contains() 함수를 사용하여 특정 모델 항목이 특정 범위 내에 있는지 여부를 확인할 수 있습니다. 범위는 등호 및 부등호 연산자를 사용하여 비교할 수도 있으며 intersects() 함수를 사용하면 두 범위가 겹치는지 여부를 확인할 수 있습니다.
모델/보기 프로그래밍, QAbstractItemModel, QItemSelection, QItemSelectionModel 을참조하세요 .
멤버 함수 문서
[noexcept]
QItemSelectionRange::QItemSelectionRange()
빈 선택 범위를 구성합니다.
[explicit]
QItemSelectionRange::QItemSelectionRange(const QModelIndex &index)
모델 인덱스에 지정된 모델 항목만 포함하는 새 선택 범위를 구성합니다 index.
QItemSelectionRange::QItemSelectionRange(const QModelIndex &topLeft, const QModelIndex &bottomRight)
topLeft 및 bottomRight 인덱스가 지정한 인덱스만 포함하는 새 선택 범위를 구성합니다.
int QItemSelectionRange::bottom() const
선택 범위에서 가장 아래에 선택된 행에 해당하는 행 인덱스를 반환합니다.
const QPersistentModelIndex &QItemSelectionRange::bottomRight() const
선택 범위의 오른쪽 하단에 있는 항목의 색인을 반환합니다.
bottom(), right() 및 topLeft()도 참조하세요 .
bool QItemSelectionRange::contains(const QModelIndex &index) const
index 에서 지정한 모델 항목이 선택한 항목 범위 내에 있으면 true
을 반환하고, 그렇지 않으면 false
을 반환합니다.
bool QItemSelectionRange::contains(int row, int column, const QModelIndex &parentIndex) const
이 함수는 오버로드된 함수입니다.
(row, column)로 지정하고 parentIndex 을 부모 항목으로 하는 모델 항목이 선택한 항목의 범위 내에 있으면 true
을 반환하고, 그렇지 않으면 false
을 반환합니다.
int QItemSelectionRange::height() const
선택 범위에서 선택한 행의 수를 반환합니다.
QModelIndexList QItemSelectionRange::indexes() const
선택 항목에 저장된 모델 인덱스 항목의 목록을 반환합니다.
QItemSelectionRange QItemSelectionRange::intersected(const QItemSelectionRange &other) const
선택 범위와 other 선택 범위 모두에 있는 항목만 포함된 새 선택 범위를 반환합니다.
bool QItemSelectionRange::intersects(const QItemSelectionRange &other) const
이 선택 범위가 주어진 other 범위와 교차(겹침)하면 true
을 반환하고, 그렇지 않으면 false
을 반환합니다.
bool QItemSelectionRange::isEmpty() const
선택 범위에 항목이 없거나 비활성화되었거나 선택할 수 없는 것으로 표시된 항목만 포함된 경우 true
을 반환합니다.
bool QItemSelectionRange::isValid() const
선택 범위가 유효하면 true
을 반환하고, 그렇지 않으면 false
을 반환합니다.
int QItemSelectionRange::left() const
선택 범위에서 가장 왼쪽에 선택된 열에 해당하는 열 인덱스를 반환합니다.
const QAbstractItemModel *QItemSelectionRange::model() const
선택 범위의 항목이 속한 모델을 반환합니다.
QModelIndex QItemSelectionRange::parent() const
선택 범위에 있는 항목의 상위 모델 항목 인덱스를 반환합니다.
int QItemSelectionRange::right() const
선택 범위에서 가장 오른쪽에 선택된 열에 해당하는 열 인덱스를 반환합니다.
[noexcept]
void QItemSelectionRange::swap(QItemSelectionRange &other)
이 선택 범위의 콘텐츠를 other 로 바꿉니다. 이 작업은 매우 빠르며 실패하지 않습니다.
int QItemSelectionRange::top() const
선택 범위에서 가장 위에 선택된 행에 해당하는 행 인덱스를 반환합니다.
const QPersistentModelIndex &QItemSelectionRange::topLeft() const
선택 범위의 왼쪽 상단에 있는 항목의 색인을 반환합니다.
top(), left() 및 bottomRight()도 참조하세요 .
int QItemSelectionRange::width() const
선택 범위에서 선택한 열의 수를 반환합니다.
관련 비회원
[noexcept]
bool operator!=(const QItemSelectionRange &lhs, const QItemSelectionRange &rhs)
lhs 선택 범위가 지정된 rhs 범위와 다르면 true
을 반환하고, 그렇지 않으면 false
을 반환합니다.
[noexcept]
bool operator==(const QItemSelectionRange &lhs, const QItemSelectionRange &rhs)
lhs 선택 범위가 주어진 rhs 범위와 정확히 같으면 true
을 반환하고, 그렇지 않으면 false
을 반환합니다.
© 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.