QItemSelectionRange Class
QItemSelectionRange クラスは、モデル内で選択された項目の範囲に関する情報を管理します。詳細...
| ヘッダー: | #include <QItemSelectionRange> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
QItemSelectionRange の比較
| カテゴリ | 比較可能な型 |
|---|---|
| 等価性 | QItemSelectionRange |
パブリック関数
| 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() 関数を使用すると、2 つの範囲が重複しているかどうかを判断できます。
「モデル/ビュープログラミング」、「QAbstractItemModel 」、「QItemSelection 」、および「QItemSelectionModel 」も参照してください 。
メンバ関数のドキュメント
[noexcept default] 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 を返します。
© 2026 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.