[][src]Struct qt_core::QItemSelectionRange

#[repr(C)]pub struct QItemSelectionRange { /* fields omitted */ }

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.

Methods

impl QItemSelectionRange[src]

pub unsafe fn bottom(&self) -> c_int[src]

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.

pub unsafe fn bottom_right(&self) -> Ref<QPersistentModelIndex>[src]

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

pub unsafe fn contains_1a(&self, index: impl CastInto<Ref<QModelIndex>>) -> bool[src]

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.

pub unsafe fn contains_3a(
    &self,
    row: c_int,
    column: c_int,
    parent_index: impl CastInto<Ref<QModelIndex>>
) -> bool
[src]

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.

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QItemSelectionRange>>
) -> Ref<QItemSelectionRange>
[src]

Copy-assignment operator.

Calls C++ function: QItemSelectionRange& QItemSelectionRange::operator=(const QItemSelectionRange& other).

C++ documentation:

Copy-assignment operator.

pub unsafe fn height(&self) -> c_int[src]

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.

pub unsafe fn indexes(&self) -> CppBox<QListOfQModelIndex>[src]

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.

pub unsafe fn intersected(
    &self,
    other: impl CastInto<Ref<QItemSelectionRange>>
) -> CppBox<QItemSelectionRange>
[src]

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.

pub unsafe fn intersects(
    &self,
    other: impl CastInto<Ref<QItemSelectionRange>>
) -> bool
[src]

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.

pub unsafe fn is_empty(&self) -> bool[src]

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.

pub unsafe fn is_valid(&self) -> bool[src]

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.

pub unsafe fn left(&self) -> c_int[src]

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.

pub unsafe fn model(&self) -> QPtr<QAbstractItemModel>[src]

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.

pub unsafe fn new_0a() -> CppBox<QItemSelectionRange>[src]

Constructs an empty selection range.

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

C++ documentation:

Constructs an empty selection range.

pub unsafe fn new_2a(
    top_l: impl CastInto<Ref<QModelIndex>>,
    bottom_r: impl CastInto<Ref<QModelIndex>>
) -> CppBox<QItemSelectionRange>
[src]

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.

pub unsafe fn new_1a(
    index: impl CastInto<Ref<QModelIndex>>
) -> CppBox<QItemSelectionRange>
[src]

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.

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QItemSelectionRange>>
) -> CppBox<QItemSelectionRange>
[src]

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.

pub unsafe fn parent(&self) -> CppBox<QModelIndex>[src]

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.

pub unsafe fn right(&self) -> c_int[src]

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.

pub unsafe fn swap(&self, other: impl CastInto<Ref<QItemSelectionRange>>)[src]

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.

pub unsafe fn top(&self) -> c_int[src]

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.

pub unsafe fn top_left(&self) -> Ref<QPersistentModelIndex>[src]

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

pub unsafe fn width(&self) -> c_int[src]

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

impl CppDeletable for QItemSelectionRange[src]

unsafe fn delete(&self)[src]

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.

impl Lt<Ref<QItemSelectionRange>> for QItemSelectionRange[src]

unsafe fn lt(&self, other: &Ref<QItemSelectionRange>) -> bool[src]

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.

impl PartialEq<Ref<QItemSelectionRange>> for QItemSelectionRange[src]

fn eq(&self, other: &Ref<QItemSelectionRange>) -> bool[src]

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.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.