[][src]Struct qt_core::QPersistentModelIndex

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

The QPersistentModelIndex class is used to locate data in a data model.

C++ class: QPersistentModelIndex.

C++ documentation:

The QPersistentModelIndex class is used to locate data in a data model.

A QPersistentModelIndex is a model index that can be stored by an application, and later used to access information in a model. Unlike the QModelIndex class, it is safe to store a QPersistentModelIndex since the model will ensure that references to items will continue to be valid as long as they can be accessed by the model.

It is good practice to check that persistent model indexes are valid before using them.

Methods

impl QPersistentModelIndex[src]

pub unsafe fn child(&self, row: c_int, column: c_int) -> CppBox<QModelIndex>[src]

Use QAbstractItemModel::index() instead.

Calls C++ function: QModelIndex QPersistentModelIndex::child(int row, int column) const.

C++ documentation:

Use QAbstractItemModel::index() instead.

Returns the child of the model index that is stored in the given row and column.

See also parent() and sibling().

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

Returns the column this persistent model index refers to.

Calls C++ function: int QPersistentModelIndex::column() const.

C++ documentation:

Returns the column this persistent model index refers to.

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

Sets the persistent model index to refer to the same item in a model as the other persistent model index.

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

C++ documentation:

Sets the persistent model index to refer to the same item in a model as the other persistent model index.

pub unsafe fn copy_from_q_model_index(
    &self,
    other: impl CastInto<Ref<QModelIndex>>
) -> Ref<QPersistentModelIndex>
[src]

Sets the persistent model index to refer to the same item in a model as the other model index.

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

C++ documentation:

Sets the persistent model index to refer to the same item in a model as the other model index.

pub unsafe fn data_1a(&self, role: c_int) -> CppBox<QVariant>[src]

Returns the data for the given role for the item referred to by the index.

Calls C++ function: QVariant QPersistentModelIndex::data(int role = …) const.

C++ documentation:

Returns the data for the given role for the item referred to by the index.

See also Qt::ItemDataRole and QAbstractItemModel::setData().

pub unsafe fn data_0a(&self) -> CppBox<QVariant>[src]

Returns the data for the given role for the item referred to by the index.

Calls C++ function: QVariant QPersistentModelIndex::data() const.

C++ documentation:

Returns the data for the given role for the item referred to by the index.

See also Qt::ItemDataRole and QAbstractItemModel::setData().

pub unsafe fn flags(&self) -> QFlags<ItemFlag>[src]

Returns the flags for the item referred to by the index.

Calls C++ function: QFlags<Qt::ItemFlag> QPersistentModelIndex::flags() const.

C++ documentation:

Returns the flags for the item referred to by the index.

This function was introduced in Qt 4.2.

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

Returns true if this persistent model index is valid; otherwise returns false.

Calls C++ function: bool QPersistentModelIndex::isValid() const.

C++ documentation:

Returns true if this persistent model index is valid; otherwise returns false.

A valid index belongs to a model, and has non-negative row and column numbers.

See also model(), row(), and column().

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

Returns the model that the index belongs to.

Calls C++ function: const QAbstractItemModel* QPersistentModelIndex::model() const.

C++ documentation:

Returns the model that the index belongs to.

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

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

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

Creates a new QPersistentModelIndex that is a copy of the model index.

Calls C++ function: [constructor] void QPersistentModelIndex::QPersistentModelIndex(const QModelIndex& index).

C++ documentation:

Creates a new QPersistentModelIndex that is a copy of the model index.

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

Creates a new QPersistentModelIndex that is a copy of the other persistent model index.

Calls C++ function: [constructor] void QPersistentModelIndex::QPersistentModelIndex(const QPersistentModelIndex& other).

C++ documentation:

Creates a new QPersistentModelIndex that is a copy of the other persistent model index.

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

Returns the parent QModelIndex for this persistent index, or an invalid QModelIndex if it has no parent.

Calls C++ function: QModelIndex QPersistentModelIndex::parent() const.

C++ documentation:

Returns the parent QModelIndex for this persistent index, or an invalid QModelIndex if it has no parent.

See also sibling() and model().

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

Returns the row this persistent model index refers to.

Calls C++ function: int QPersistentModelIndex::row() const.

C++ documentation:

Returns the row this persistent model index refers to.

pub unsafe fn sibling(&self, row: c_int, column: c_int) -> CppBox<QModelIndex>[src]

Returns the sibling at row and column or an invalid QModelIndex if there is no sibling at this position.

Calls C++ function: QModelIndex QPersistentModelIndex::sibling(int row, int column) const.

C++ documentation:

Returns the sibling at row and column or an invalid QModelIndex if there is no sibling at this position.

See also parent().

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

Swaps this persistent modelindex with other. This function is very fast and never fails.

Calls C++ function: void QPersistentModelIndex::swap(QPersistentModelIndex& other).

C++ documentation:

Swaps this persistent modelindex with other. This function is very fast and never fails.

This function was introduced in Qt 5.0.

pub unsafe fn to_q_model_index(&self) -> Ref<QModelIndex>[src]

Calls C++ function: const QModelIndex& QPersistentModelIndex::operator const QModelIndex&() const.

Trait Implementations

impl CppDeletable for QPersistentModelIndex[src]

unsafe fn delete(&self)[src]

Calls C++ function: [destructor] void QPersistentModelIndex::~QPersistentModelIndex().

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

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

Returns true if this persistent model index is smaller than the other persistent model index; otherwise returns false.

Calls C++ function: bool QPersistentModelIndex::operator<(const QPersistentModelIndex& other) const.

C++ documentation:

Returns true if this persistent model index is smaller than the other persistent model index; otherwise returns false.

All values in the persistent model index are used when comparing with another persistent model index.

This function was introduced in Qt 4.1.

impl PartialEq<Ref<QModelIndex>> for QPersistentModelIndex[src]

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

Returns true if this persistent model index refers to the same location as the other model index; otherwise returns false.

Calls C++ function: bool QPersistentModelIndex::operator==(const QModelIndex& other) const.

C++ documentation:

Returns true if this persistent model index refers to the same location as the other model index; otherwise returns false.

All values in the persistent model index are used when comparing with another model index.

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

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

Returns true if this persistent model index is equal to the other persistent model index; otherwise returns false.

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

C++ documentation:

Returns true if this persistent model index is equal to the other persistent model index; otherwise returns false.

All values in the persistent model index are used when comparing with another persistent model index.

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.