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

C++ documentation:

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

source

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.

C++ documentation:

Returns the row index corresponding to the lowermost selected row in the selection range.

source

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.

C++ documentation:

Returns the index for the item located at the bottom-right corner of the selection range.

See also bottom(), right(), and topLeft().

source

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.

C++ documentation:

Returns true if the model item specified by the index lies within the range of selected items; otherwise returns false.

source

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.

C++ documentation:

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.

source

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

C++ documentation:

Copy-assignment operator.

source

pub unsafe fn height(&self) -> c_int

Returns the number of selected rows in the selection range.

Calls C++ function: int QItemSelectionRange::height() const.

C++ documentation:

Returns the number of selected rows in the selection range.

source

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.

C++ documentation:

Returns the list of model index items stored in the selection.

source

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.

C++ documentation:

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.

source

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.

C++ documentation:

Returns true if this selection range intersects (overlaps with) the other range given; otherwise returns false.

source

pub unsafe fn is_empty(&self) -> bool

Returns true if the selection range contains no selectable item

Calls C++ function: bool QItemSelectionRange::isEmpty() const.

C++ documentation:

Returns true if the selection range contains no selectable item

This function was introduced in Qt 4.7.

source

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.

C++ documentation:

Returns true if the selection range is valid; otherwise returns false.

source

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.

C++ documentation:

Returns the column index corresponding to the leftmost selected column in the selection range.

source

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.

C++ documentation:

Returns the model that the items in the selection range belong to.

source

pub unsafe fn new_0a() -> CppBox<QItemSelectionRange>

Constructs an empty selection range.

Calls C++ function: [constructor] void QItemSelectionRange::QItemSelectionRange().

C++ documentation:

Constructs an empty selection range.

source

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

C++ documentation:

Constructs a new selection range containing only the index specified by the topLeft and the index bottomRight.

source

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

C++ documentation:

Constructs a new selection range containing only the model item specified by the model index index.

source

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

C++ documentation:

Copy constructor. Constructs a new selection range with the same contents as the other range given.

source

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.

C++ documentation:

Returns the parent model item index of the items in the selection range.

source

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.

C++ documentation:

Returns the column index corresponding to the rightmost selected column in the selection range.

source

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

C++ documentation:

Swaps this selection range’s contents with other. This function is very fast and never fails.

This function was introduced in Qt 5.6.

source

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.

C++ documentation:

Returns the row index corresponding to the uppermost selected row in the selection range.

source

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.

C++ documentation:

Returns the index for the item located at the top-left corner of the selection range.

See also top(), left(), and bottomRight().

source

pub unsafe fn width(&self) -> c_int

Returns the number of selected columns in the selection range.

Calls C++ function: int QItemSelectionRange::width() const.

C++ documentation:

Returns the number of selected columns in the selection range.

Trait Implementations§

source§

impl CppDeletable for QItemSelectionRange

source§

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().

C++ documentation:

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

source§

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.

C++ documentation:

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

source§

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.

C++ documentation:

Returns true if the selection range is exactly the same as the other range given; otherwise returns false.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.