QPersistentModelIndex Class | Qt Core 5.15.18 (original) (raw)

Member Function Documentation

QPersistentModelIndex::QPersistentModelIndex(QPersistentModelIndex &&other)

Move-constructs a QPersistentModelIndex instance, making it point at the same object that other was pointing to.

This function was introduced in Qt 5.2.

QPersistentModelIndex::QPersistentModelIndex(const QPersistentModelIndex &other)

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

QPersistentModelIndex::QPersistentModelIndex(const QModelIndex &index)

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

QPersistentModelIndex &QPersistentModelIndex::operator=(const QModelIndex &other)

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

QPersistentModelIndex &QPersistentModelIndex::operator=(QPersistentModelIndex &&other)

Move-assigns other to this QPersistentModelIndex instance.

This function was introduced in Qt 5.2.

QPersistentModelIndex &QPersistentModelIndex::operator=(const QPersistentModelIndex &other)

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

int QPersistentModelIndex::column() const

Returns the column this persistent model index refers to.

QVariant QPersistentModelIndex::data(int role = Qt::DisplayRole) const

Returns the data for the given role for the item referred to by the index, or a default-constructed QVariant if this persistent model index is invalid.

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

Qt::ItemFlags QPersistentModelIndex::flags() const

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

This function was introduced in Qt 4.2.

bool QPersistentModelIndex::isValid() const

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

const QAbstractItemModel *QPersistentModelIndex::model() const

Returns the model that the index belongs to.

QModelIndex QPersistentModelIndex::parent() const

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

See also sibling() and model().

int QPersistentModelIndex::row() const

Returns the row this persistent model index refers to.

QModelIndex QPersistentModelIndex::sibling(int row, int column) const

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

See also parent().

void QPersistentModelIndex::swap(QPersistentModelIndex &other)

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

This function was introduced in Qt 5.0.

const QModelIndex &QPersistentModelIndex::operator const QModelIndex &() const

Cast operator that returns a const QModelIndex&.

bool QPersistentModelIndex::operator!=(const QPersistentModelIndex &other) const

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

This function was introduced in Qt 4.2.

bool QPersistentModelIndex::operator!=(const QModelIndex &other) const

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

bool QPersistentModelIndex::operator<(const QPersistentModelIndex &other) const

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

The internal data pointer, row, column, and model values in the persistent model index are used when comparing with another persistent model index.

This function was introduced in Qt 4.1.

bool QPersistentModelIndex::operator==(const QPersistentModelIndex &other) const

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

The internal data pointer, row, column, and model values in the persistent model index are used when comparing with another persistent model index.

bool QPersistentModelIndex::operator==(const QModelIndex &other) const

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

The internal data pointer, row, column, and model values in the persistent model index are used when comparing with another model index.