#[repr(C)]
pub struct QPersistentModelIndex { /* private fields */ }
Expand description

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.

Implementations§

source§

impl QPersistentModelIndex

source

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

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

source

pub unsafe fn column(&self) -> c_int

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.

source

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

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.

source

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

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.

source

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

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

source

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

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

source

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

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.

source

pub unsafe fn is_valid(&self) -> bool

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

source

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

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.

source

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

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

source

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

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.

source

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

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.

source

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

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

source

pub unsafe fn row(&self) -> c_int

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.

source

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

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

source

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

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.

source

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

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

Trait Implementations§

source§

impl CppDeletable for QPersistentModelIndex

source§

unsafe fn delete(&self)

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

source§

impl Lt<Ref<QPersistentModelIndex>> for QPersistentModelIndex

source§

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

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.

source§

impl PartialEq<Ref<QModelIndex>> for QPersistentModelIndex

source§

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

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.

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.
source§

impl PartialEq<Ref<QPersistentModelIndex>> for QPersistentModelIndex

source§

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

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.

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.