Struct qt_core::QItemSelectionRange
source · #[repr(C)]pub struct QItemSelectionRange { /* private fields */ }
Expand description
The QItemSelectionRange class manages information about a range of selected items in a model.
C++ class: QItemSelectionRange
.
The QItemSelectionRange class manages information about a range of selected items in a model.
A QItemSelectionRange contains information about a range of selected items in a model. A range of items is a contiguous array of model items, extending to cover a number of adjacent rows and columns with a common parent item; this can be visualized as a two-dimensional block of cells in a table. A selection range has a top(), left() a bottom(), right() and a parent().
The QItemSelectionRange class is one of the Model/View Classes and is part of Qt's model/view framework.
The model items contained in the selection range can be obtained using the indexes() function. Use QItemSelectionModel::selectedIndexes() to get a list of all selected items for a view.
You can determine whether a given model item lies within a particular range by using the contains() function. Ranges can also be compared using the overloaded operators for equality and inequality, and the intersects() function allows you to determine whether two ranges overlap.
Implementations§
source§impl QItemSelectionRange
impl QItemSelectionRange
sourcepub unsafe fn bottom(&self) -> c_int
pub unsafe fn bottom(&self) -> c_int
Returns the row index corresponding to the lowermost selected row in the selection range.
Calls C++ function: int QItemSelectionRange::bottom() const
.
Returns the row index corresponding to the lowermost selected row in the selection range.
sourcepub unsafe fn bottom_right(&self) -> Ref<QPersistentModelIndex>
pub unsafe fn bottom_right(&self) -> Ref<QPersistentModelIndex>
Returns the index for the item located at the bottom-right corner of the selection range.
Calls C++ function: const QPersistentModelIndex& QItemSelectionRange::bottomRight() const
.
sourcepub unsafe fn contains_1a(&self, index: impl CastInto<Ref<QModelIndex>>) -> bool
pub unsafe fn contains_1a(&self, index: impl CastInto<Ref<QModelIndex>>) -> bool
Returns true
if the model item specified by the index lies within the range of selected items; otherwise returns false
.
Calls C++ function: bool QItemSelectionRange::contains(const QModelIndex& index) const
.
Returns true
if the model item specified by the index lies within the range of selected items; otherwise returns false
.
sourcepub unsafe fn contains_3a(
&self,
row: c_int,
column: c_int,
parent_index: impl CastInto<Ref<QModelIndex>>
) -> bool
pub unsafe fn contains_3a( &self, row: c_int, column: c_int, parent_index: impl CastInto<Ref<QModelIndex>> ) -> bool
This is an overloaded function.
Calls C++ function: bool QItemSelectionRange::contains(int row, int column, const QModelIndex& parentIndex) const
.
This is an overloaded function.
Returns true
if the model item specified by (row, column) and with parentIndex as the parent item lies within the range of selected items; otherwise returns false
.
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QItemSelectionRange>>
) -> Ref<QItemSelectionRange>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QItemSelectionRange>> ) -> Ref<QItemSelectionRange>
Copy-assignment operator.
Calls C++ function: QItemSelectionRange& QItemSelectionRange::operator=(const QItemSelectionRange& other)
.
Copy-assignment operator.
sourcepub unsafe fn height(&self) -> c_int
pub unsafe fn height(&self) -> c_int
Returns the number of selected rows in the selection range.
Calls C++ function: int QItemSelectionRange::height() const
.
Returns the number of selected rows in the selection range.
sourcepub unsafe fn indexes(&self) -> CppBox<QListOfQModelIndex>
pub unsafe fn indexes(&self) -> CppBox<QListOfQModelIndex>
Returns the list of model index items stored in the selection.
Calls C++ function: QList<QModelIndex> QItemSelectionRange::indexes() const
.
Returns the list of model index items stored in the selection.
sourcepub unsafe fn intersected(
&self,
other: impl CastInto<Ref<QItemSelectionRange>>
) -> CppBox<QItemSelectionRange>
pub unsafe fn intersected( &self, other: impl CastInto<Ref<QItemSelectionRange>> ) -> CppBox<QItemSelectionRange>
Returns a new selection range containing only the items that are found in both the selection range and the other selection range.
Calls C++ function: QItemSelectionRange QItemSelectionRange::intersected(const QItemSelectionRange& other) const
.
Returns a new selection range containing only the items that are found in both the selection range and the other selection range.
This function was introduced in Qt 4.2.
sourcepub unsafe fn intersects(
&self,
other: impl CastInto<Ref<QItemSelectionRange>>
) -> bool
pub unsafe fn intersects( &self, other: impl CastInto<Ref<QItemSelectionRange>> ) -> bool
Returns true
if this selection range intersects (overlaps with) the other range given; otherwise returns false
.
Calls C++ function: bool QItemSelectionRange::intersects(const QItemSelectionRange& other) const
.
Returns true
if this selection range intersects (overlaps with) the other range given; otherwise returns false
.
sourcepub unsafe fn is_empty(&self) -> bool
pub unsafe fn is_empty(&self) -> bool
Returns true
if the selection range contains no selectable item
Calls C++ function: bool QItemSelectionRange::isEmpty() const
.
Returns true
if the selection range contains no selectable item
This function was introduced in Qt 4.7.
sourcepub unsafe fn is_valid(&self) -> bool
pub unsafe fn is_valid(&self) -> bool
Returns true
if the selection range is valid; otherwise returns false
.
Calls C++ function: bool QItemSelectionRange::isValid() const
.
Returns true
if the selection range is valid; otherwise returns false
.
sourcepub unsafe fn left(&self) -> c_int
pub unsafe fn left(&self) -> c_int
Returns the column index corresponding to the leftmost selected column in the selection range.
Calls C++ function: int QItemSelectionRange::left() const
.
Returns the column index corresponding to the leftmost selected column in the selection range.
sourcepub unsafe fn model(&self) -> QPtr<QAbstractItemModel>
pub unsafe fn model(&self) -> QPtr<QAbstractItemModel>
Returns the model that the items in the selection range belong to.
Calls C++ function: const QAbstractItemModel* QItemSelectionRange::model() const
.
Returns the model that the items in the selection range belong to.
sourcepub unsafe fn new_0a() -> CppBox<QItemSelectionRange>
pub unsafe fn new_0a() -> CppBox<QItemSelectionRange>
Constructs an empty selection range.
Calls C++ function: [constructor] void QItemSelectionRange::QItemSelectionRange()
.
Constructs an empty selection range.
sourcepub unsafe fn new_2a(
top_l: impl CastInto<Ref<QModelIndex>>,
bottom_r: impl CastInto<Ref<QModelIndex>>
) -> CppBox<QItemSelectionRange>
pub unsafe fn new_2a( top_l: impl CastInto<Ref<QModelIndex>>, bottom_r: impl CastInto<Ref<QModelIndex>> ) -> CppBox<QItemSelectionRange>
Constructs a new selection range containing only the index specified by the topLeft and the index bottomRight.
Calls C++ function: [constructor] void QItemSelectionRange::QItemSelectionRange(const QModelIndex& topL, const QModelIndex& bottomR)
.
Constructs a new selection range containing only the index specified by the topLeft and the index bottomRight.
sourcepub unsafe fn new_1a(
index: impl CastInto<Ref<QModelIndex>>
) -> CppBox<QItemSelectionRange>
pub unsafe fn new_1a( index: impl CastInto<Ref<QModelIndex>> ) -> CppBox<QItemSelectionRange>
Constructs a new selection range containing only the model item specified by the model index index.
Calls C++ function: [constructor] void QItemSelectionRange::QItemSelectionRange(const QModelIndex& index)
.
Constructs a new selection range containing only the model item specified by the model index index.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QItemSelectionRange>>
) -> CppBox<QItemSelectionRange>
pub unsafe fn new_copy( other: impl CastInto<Ref<QItemSelectionRange>> ) -> CppBox<QItemSelectionRange>
Copy constructor. Constructs a new selection range with the same contents as the other range given.
Calls C++ function: [constructor] void QItemSelectionRange::QItemSelectionRange(const QItemSelectionRange& other)
.
Copy constructor. Constructs a new selection range with the same contents as the other range given.
sourcepub unsafe fn parent(&self) -> CppBox<QModelIndex>
pub unsafe fn parent(&self) -> CppBox<QModelIndex>
Returns the parent model item index of the items in the selection range.
Calls C++ function: QModelIndex QItemSelectionRange::parent() const
.
Returns the parent model item index of the items in the selection range.
sourcepub unsafe fn right(&self) -> c_int
pub unsafe fn right(&self) -> c_int
Returns the column index corresponding to the rightmost selected column in the selection range.
Calls C++ function: int QItemSelectionRange::right() const
.
Returns the column index corresponding to the rightmost selected column in the selection range.
sourcepub unsafe fn swap(&self, other: impl CastInto<Ref<QItemSelectionRange>>)
pub unsafe fn swap(&self, other: impl CastInto<Ref<QItemSelectionRange>>)
Swaps this selection range's contents with other. This function is very fast and never fails.
Calls C++ function: void QItemSelectionRange::swap(QItemSelectionRange& other)
.
Swaps this selection range’s contents with other. This function is very fast and never fails.
This function was introduced in Qt 5.6.
sourcepub unsafe fn top(&self) -> c_int
pub unsafe fn top(&self) -> c_int
Returns the row index corresponding to the uppermost selected row in the selection range.
Calls C++ function: int QItemSelectionRange::top() const
.
Returns the row index corresponding to the uppermost selected row in the selection range.
sourcepub unsafe fn top_left(&self) -> Ref<QPersistentModelIndex>
pub unsafe fn top_left(&self) -> Ref<QPersistentModelIndex>
Returns the index for the item located at the top-left corner of the selection range.
Calls C++ function: const QPersistentModelIndex& QItemSelectionRange::topLeft() const
.
Returns the index for the item located at the top-left corner of the selection range.
See also top(), left(), and bottomRight().
Trait Implementations§
source§impl CppDeletable for QItemSelectionRange
impl CppDeletable for QItemSelectionRange
source§unsafe fn delete(&self)
unsafe fn delete(&self)
The QItemSelectionRange class manages information about a range of selected items in a model.
Calls C++ function: [destructor] void QItemSelectionRange::~QItemSelectionRange()
.
The QItemSelectionRange class manages information about a range of selected items in a model.
A QItemSelectionRange contains information about a range of selected items in a model. A range of items is a contiguous array of model items, extending to cover a number of adjacent rows and columns with a common parent item; this can be visualized as a two-dimensional block of cells in a table. A selection range has a top(), left() a bottom(), right() and a parent().
The QItemSelectionRange class is one of the Model/View Classes and is part of Qt's model/view framework.
The model items contained in the selection range can be obtained using the indexes() function. Use QItemSelectionModel::selectedIndexes() to get a list of all selected items for a view.
You can determine whether a given model item lies within a particular range by using the contains() function. Ranges can also be compared using the overloaded operators for equality and inequality, and the intersects() function allows you to determine whether two ranges overlap.
source§impl Lt<Ref<QItemSelectionRange>> for QItemSelectionRange
impl Lt<Ref<QItemSelectionRange>> for QItemSelectionRange
source§unsafe fn lt(&self, other: &Ref<QItemSelectionRange>) -> bool
unsafe fn lt(&self, other: &Ref<QItemSelectionRange>) -> bool
Returns true
if the selection range is less than the other range given; otherwise returns false
.
Calls C++ function: bool QItemSelectionRange::operator<(const QItemSelectionRange& other) const
.
Returns true
if the selection range is less than the other range given; otherwise returns false
.
The less than calculation is not directly useful to developers - the way that ranges with different parents compare is not defined. This operator only exists so that the class can be used with QMap.
source§impl PartialEq<Ref<QItemSelectionRange>> for QItemSelectionRange
impl PartialEq<Ref<QItemSelectionRange>> for QItemSelectionRange
source§fn eq(&self, other: &Ref<QItemSelectionRange>) -> bool
fn eq(&self, other: &Ref<QItemSelectionRange>) -> bool
Returns true
if the selection range is exactly the same as the other range given; otherwise returns false
.
Calls C++ function: bool QItemSelectionRange::operator==(const QItemSelectionRange& other) const
.
Returns true
if the selection range is exactly the same as the other range given; otherwise returns false
.