QItemSelectionRange Class

QItemSelectionRangeクラスは、モデル内で選択されたアイテムの範囲に関する情報を管理します。詳細...

ヘッダ #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 は、モデル内で選択された項目の範囲に関する情報を保持します。アイテムの範囲とは、モデル・アイテムの連続した配列であり、共通の親アイテムを持つ隣接する行や列の数をカバーするように拡張されたものです。これは、テーブルのセルの二次元ブロックとして視覚化することができます。選択範囲は、top ()、left ()、bottom ()、right ()、parent ()を持ちます。

QItemSelectionRangeクラスはモデル/ビュー・クラスの1つで、Qtのモデル/ビュー・フレームワークの一部です。

選択範囲に含まれるモデル項目は、indexes ()関数を使用して取得することができます。QItemSelectionModel::selectedIndexes ()を使用して、ビューの選択された項目のリストを取得します。

contains() 関数を使用すると、指定されたモデル項目が特定の範囲内にあるかどうかを判断することができます。また、intersects() 関数を使用すると、2 つの範囲が重なっているかどうかを判断できます。

モデル/ビュー・プログラミングQAbstractItemModelQItemSelectionQItemSelectionModelも参照してください

メンバ関数のドキュメント

[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

選択範囲内の項目の親モデル項目インデックスを返します。

選択範囲内で選択された列の右端に対応する列インデックスを返します。

[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.