6#include <private/qabstractitemmodel_p.h>
13#if QT_CONFIG(regularexpression)
37 if (
it != indexes.
cend()) {
56 p->removePersistentIndexData(
data);
355 if (
index.isValid()) {
448 if (
other.isValid()) {
482 return !
other.isValid();
496 return other.isValid();
666#ifndef QT_NO_DEBUG_STREAM
670 dbg.nospace() <<
"QModelIndex(" << idx.
row() <<
',' << idx.
column()
711 return qEmptyModel();
748 return *qDefaultRoleNames();
758 switch (
left.userType()) {
761 case QMetaType::UInt:
763 case QMetaType::LongLong:
764 return left.toLongLong() <
right.toLongLong();
765 case QMetaType::ULongLong:
766 return left.toULongLong() <
right.toULongLong();
767 case QMetaType::Float:
769 case QMetaType::Double:
770 return left.toDouble() <
right.toDouble();
771 case QMetaType::QChar:
773 case QMetaType::QDate:
775 case QMetaType::QTime:
777 case QMetaType::QDateTime:
778 return left.toDateTime() <
right.toDateTime();
779 case QMetaType::QString:
782 return left.toString().localeAwareCompare(
right.toString()) < 0;
784 return left.toString().compare(
right.toString(), cs) < 0;
792 switch (
value.userType()) {
793 case QMetaType::Bool:
795 case QMetaType::UInt:
796 case QMetaType::LongLong:
797 case QMetaType::ULongLong:
798 case QMetaType::QChar:
799 case QMetaType::Short:
800 case QMetaType::UShort:
801 case QMetaType::UChar:
802 case QMetaType::ULong:
803 case QMetaType::Long:
805 case QMetaType::Double:
806 case QMetaType::Float:
824 return v1.toLongLong() <
v2.toLongLong();
826 return v1.toReal() <
v2.toReal();
828 return v1.toString().localeAwareCompare(
v2.toString()) < 0;
834 if (
data->index.isValid()) {
836 Q_ASSERT_X(removed == 1,
"QPersistentModelIndex::~QPersistentModelIndex",
837 "persistent model indexes corrupted");
863 if (first < q->rowCount(
parent)) {
879 for (
auto *
data : persistent_moved) {
883 if (
data->index.isValid()) {
886 qWarning() <<
"QAbstractItemModel::endInsertRows: Invalid index (" << old.
row() +
count <<
',' << old.
column() <<
") in model" << q_func();
897 const bool sameParent = (srcParent == destinationParent);
898 const bool movingUp = (srcFirst > destinationChild);
903 const bool isSourceIndex = (
parent == srcParent);
904 const bool isDestinationIndex = (
parent == destinationParent);
908 childPosition =
index.row();
910 childPosition =
index.column();
912 if (!
index.isValid() || !(isSourceIndex || isDestinationIndex ) )
915 if (!sameParent && isDestinationIndex) {
916 if (childPosition >= destinationChild)
921 if (sameParent && movingUp && childPosition < destinationChild)
924 if (sameParent && !movingUp && childPosition < srcFirst )
927 if (!sameParent && childPosition < srcFirst)
930 if (sameParent && (childPosition > srcLast) && (childPosition >= destinationChild ))
933 if ((childPosition <= srcLast) && (childPosition >= srcFirst)) {
954 for (
auto *
data : indexes) {
965 if (
data->index.isValid()) {
968 qWarning() <<
"QAbstractItemModel::endMoveRows: Invalid index (" <<
row <<
"," <<
column <<
") in model" << q_func();
979 const bool sameParent = (sourceParent == destinationParent);
980 const bool movingUp = (sourceFirst > destinationChild);
982 const int explicit_change = (!sameParent || movingUp) ? destinationChild - sourceFirst : destinationChild - sourceLast - 1 ;
983 const int source_change = (!sameParent || !movingUp) ? -1*(sourceLast - sourceFirst + 1) : sourceLast - sourceFirst + 1 ;
984 const int destination_change = sourceLast - sourceFirst + 1;
999 bool level_changed =
false;
1003 if (current_parent ==
parent) {
1004 if (!level_changed && current.
row() > last)
1006 else if (current.
row() <= last && current.
row() >=
first)
1010 current = current_parent;
1011 level_changed =
true;
1020 int first,
int last)
1024 for (
auto *
data : persistent_moved) {
1028 if (
data->index.isValid()) {
1031 qWarning() <<
"QAbstractItemModel::endRemoveRows: Invalid index (" << old.
row() -
count <<
',' << old.
column() <<
") in model" << q_func();
1035 for (
auto *
data : persistent_invalidated) {
1044 int first,
int last)
1049 if (first < q->columnCount(
parent)) {
1060 int first,
int last)
1064 for (
auto *
data : persistent_moved) {
1068 if (
data->index.isValid()) {
1071 qWarning() <<
"QAbstractItemModel::endInsertColumns: Invalid index (" << old.
row() <<
',' << old.
column() +
count <<
") in model" << q_func();
1077 int first,
int last)
1084 bool level_changed =
false;
1088 if (current_parent ==
parent) {
1089 if (!level_changed && current.
column() > last)
1095 current = current_parent;
1096 level_changed =
true;
1106 int first,
int last)
1110 for (
auto *
data : persistent_moved) {
1114 if (
data->index.isValid()) {
1117 qWarning() <<
"QAbstractItemModel::endRemoveColumns: Invalid index (" << old.
row() <<
',' << old.
column() -
count <<
") in model" << q_func();
1121 for (
auto *
data : persistent_invalidated) {
1717 d_func()->invalidatePersistentIndexes();
2123 if (indexes.
size() <= 0)
2126 if (
types.isEmpty())
2162 for (
int i = 0;
i < modelTypes.size(); ++
i) {
2163 if (
data->hasFormat(modelTypes.at(
i)))
2206 if (
types.isEmpty())
2284bool QAbstractItemModel::insertRows(
int,
int,
const QModelIndex &)
2313bool QAbstractItemModel::insertColumns(
int,
int,
const QModelIndex &)
2334bool QAbstractItemModel::removeRows(
int,
int,
const QModelIndex &)
2355bool QAbstractItemModel::removeColumns(
int,
int,
const QModelIndex &)
2445 if (!
d->indexValid(
index))
2500 Qt::MatchFlags
flags)
const
2507 bool allHits = (hits == -1);
2509#if QT_CONFIG(regularexpression)
2514 int from =
start.row();
2518 for (
int i = 0; (
wrap &&
i < 2) || (!
wrap &&
i < 1); ++
i) {
2519 for (
int r = from; (
r < to) && (allHits ||
result.size() < hits); ++
r) {
2529#if QT_CONFIG(regularexpression)
2531 if (
rx.pattern().isEmpty()) {
2532 if (
value.userType() == QMetaType::QRegularExpression) {
2533 rx =
value.toRegularExpression();
2535 rx.setPattern(
value.toString());
2541 if (
rx.pattern().isEmpty()) {
2555 switch (matchType) {
2556#if QT_CONFIG(regularexpression)
2565 if (
t.startsWith(
text, cs))
2569 if (
t.endsWith(
text, cs))
2573 if (
t.compare(
text, cs) == 0)
2578 if (
t.contains(
text, cs))
2743 for (
const auto &
index : indexes)
2760 while (!
stream.atEnd()) {
2775 int dragRowCount = 0;
2780 for (
int i = 0;
i < rows.
size(); ++
i)
2781 rowsToInsert[rows.
at(
i)] = 1;
2782 for (
int i = 0;
i < rowsToInsert.
size(); ++
i) {
2783 if (rowsToInsert.
at(
i) == 1){
2784 rowsToInsert[
i] = dragRowCount;
2788 for (
int i = 0;
i < rows.
size(); ++
i)
2789 rows[
i] =
top + rowsToInsert.
at(rows.
at(
i));
2791 QBitArray isWrittenTo(dragRowCount * dragColumnCount);
2795 if (colCount == 0) {
2796 insertColumns(colCount, dragColumnCount - colCount,
parent);
2806 for (
int j = 0;
j <
data.size(); ++
j) {
2807 int relativeRow = rows.
at(
j) -
top;
2808 int relativeColumn = columns.
at(
j) -
left;
2809 int destinationRow = relativeRow +
row;
2810 int destinationColumn = relativeColumn +
column;
2811 int flat = (relativeRow * dragColumnCount) + relativeColumn;
2813 if (destinationColumn >= colCount || isWrittenTo.
testBit(flat)) {
2814 destinationColumn =
qBound(
column, destinationColumn, colCount - 1);
2815 destinationRow =
row + dragRowCount;
2816 insertRows(
row + dragRowCount, 1,
parent);
2817 flat = (dragRowCount * dragColumnCount) + relativeColumn;
2818 isWrittenTo.
resize(++dragRowCount * dragColumnCount);
2820 if (!isWrittenTo.
testBit(flat)) {
2821 newIndexes[
j] =
index(destinationRow, destinationColumn,
parent);
2822 isWrittenTo.
setBit(flat);
2826 for(
int k = 0; k < newIndexes.
size(); k++) {
2827 if (newIndexes.
at(k).isValid())
2967 if (destinationParent == srcParent)
2968 return !(destinationStart >=
start && destinationStart <=
end + 1);
2970 QModelIndex destinationAncestor = destinationParent;
2973 if (destinationAncestor == srcParent) {
2979 if (!destinationAncestor.
isValid())
2983 destinationAncestor = destinationAncestor.
parent();
3089 Q_ASSERT(sourceLast >= sourceFirst);
3099 d->changes.push(sourceChange);
3103 d->changes.push(destinationChange);
3131 const int numMoved = removeChange.
last - removeChange.
first + 1;
3308 Q_ASSERT(sourceLast >= sourceFirst);
3318 d->changes.push(sourceChange);
3322 d->changes.push(destinationChange);
3350 const int numMoved = removeChange.
last - removeChange.
first + 1;
3403 d->invalidatePersistentIndexes();
3420 if (
d->persistent.indexes.isEmpty())
3423 const auto it =
d->persistent.indexes.constFind(from);
3424 if (
it !=
d->persistent.indexes.cend()) {
3426 d->persistent.indexes.erase(
it);
3429 d->persistent.insertMultiAtEnd(to,
data);
3448 if (
d->persistent.indexes.isEmpty())
3452 for (
int i = 0;
i < from.
size(); ++
i) {
3453 if (from.
at(
i) == to.
at(
i))
3455 const auto it =
d->persistent.indexes.constFind(from.
at(
i));
3456 if (
it !=
d->persistent.indexes.cend()) {
3458 d->persistent.indexes.erase(
it);
3460 if (
data->index.isValid())
3461 toBeReinserted <<
data;
3465 for (
auto *
data : std::as_const(toBeReinserted))
3466 d->persistent.insertMultiAtEnd(
data->index,
data);
3478 result.reserve(
d->persistent.indexes.size());
3479 for (
auto *
data : std::as_const(
d->persistent.indexes))
3560 if (!
index.isValid()) {
3562 qCWarning(lcCheckIndex) <<
"Index" <<
index <<
"is not valid (expected valid)";
3568 if (
index.model() !=
this) {
3570 <<
"is for model" <<
index.model()
3571 <<
"which is different from this model" <<
this;
3575 if (
index.row() < 0) {
3577 <<
"has negative row" <<
index.row();
3581 if (
index.column() < 0) {
3583 <<
"has negative column" <<
index.column();
3592 <<
"has valid parent" << parentIndex
3593 <<
"(expected an invalid parent)";
3598 const int rc =
rowCount(parentIndex);
3599 if (
index.row() >= rc) {
3601 <<
"has out of range row" <<
index.row()
3602 <<
"rowCount() is" << rc;
3607 if (
index.column() >= cc) {
3609 <<
"has out of range column" <<
index.column()
3610 <<
"columnCount() is" << cc;
3815 if (
index.isValid())
3957 if (
index.isValid())
3972 return parent.isValid() ? 0 : 1;
3997 if (
types.isEmpty())
4013 while (!
stream.atEnd()) {
4024 for (
int i = 0;
i <
data.size(); ++
i) {
4048 if (
types.isEmpty())
4064 while (!
stream.atEnd()) {
4075 for (
int i = 0;
i <
data.size(); ++
i) {
4162#include "moc_qabstractitemmodel.cpp"
void itemsAboutToBeMoved(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation)
void rowsRemoved(const QModelIndex &parent, int first, int last)
static bool variantLessThan(const QVariant &v1, const QVariant &v2)
void columnsInserted(const QModelIndex &parent, int first, int last)
static const QHash< int, QByteArray > & defaultRoleNames()
void invalidatePersistentIndexes()
void removePersistentIndexData(QPersistentModelIndexData *data)
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
void itemsMoved(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation)
static QAbstractItemModel * staticEmptyModel()
virtual void executePendingOperations() const
void movePersistentIndexes(const QList< QPersistentModelIndexData * > &indexes, int change, const QModelIndex &parent, Qt::Orientation orientation)
void columnsRemoved(const QModelIndex &parent, int first, int last)
struct QAbstractItemModelPrivate::Persistent persistent
bool allowMove(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation)
Returns whether a move operation is valid.
~QAbstractItemModelPrivate()
void columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
void invalidatePersistentIndex(const QModelIndex &index)
void rowsInserted(const QModelIndex &parent, int first, int last)
void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last)
static bool isVariantLessThan(const QVariant &left, const QVariant &right, Qt::CaseSensitivity cs=Qt::CaseSensitive, bool isLocaleAware=false)
void columnsAboutToBeInserted(const QModelIndex &parent, int first, int last)
virtual ~QAbstractItemModel()
Destroys the abstract item model.
virtual Qt::DropActions supportedDropActions() const
void rowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow, QPrivateSignal)
Q_INVOKABLE int const QModelIndex & parent
Returns the parent of the model item with the given index.
void endResetModel()
Completes a model reset operation.
void modelAboutToBeReset(QPrivateSignal)
virtual bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
Returns {true} if a model can accept a drop of the data.
bool beginMoveRows(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationRow)
virtual Q_INVOKABLE QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const
Returns a list of indexes for the items in the column of the start index where data stored under the ...
void endMoveColumns()
Ends a column move operation.
void columnsRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after columns have been removed from the model.
void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before rows are inserted into the model.
virtual Q_INVOKABLE QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Returns the data for the given role and section in the header with the specified orientation.
void columnsAboutToBeInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before columns are inserted into the model.
Q_INVOKABLE bool hasIndex(int row, int column, const QModelIndex &parent=QModelIndex()) const
Returns {true} if the model returns a valid QModelIndex for row and column with parent,...
virtual Q_INVOKABLE Qt::ItemFlags flags(const QModelIndex &index) const
Returns the item flags for the given index.
void modelReset(QPrivateSignal)
void endRemoveRows()
Ends a row removal operation.
QModelIndexList persistentIndexList() const
virtual void resetInternalData()
void endMoveRows()
Ends a row move operation.
void beginRemoveColumns(const QModelIndex &parent, int first, int last)
Begins a column removal operation.
Q_INVOKABLE int int const QModelIndex & destinationParent
void changePersistentIndex(const QModelIndex &from, const QModelIndex &to)
Changes the QPersistentModelIndex that is equal to the given from model index to the given to model i...
void changePersistentIndexList(const QModelIndexList &from, const QModelIndexList &to)
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Handles the data supplied by a drag and drop operation that ended with the given action.
virtual Q_INVOKABLE bool hasChildren(const QModelIndex &parent=QModelIndex()) const
Returns {true} if parent has any children; otherwise returns {false}.
virtual Q_INVOKABLE int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
void columnsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn, QPrivateSignal)
virtual Q_INVOKABLE void fetchMore(const QModelIndex &parent)
Fetches any available data for the items with the parent specified by the parent index.
void columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before columns are removed from the model.
virtual bool clearItemData(const QModelIndex &index)
virtual QMimeData * mimeData(const QModelIndexList &indexes) const
Returns an object that contains serialized items of data corresponding to the list of indexes specifi...
Q_INVOKABLE int int const QModelIndex int destinationChild
virtual QModelIndex buddy(const QModelIndex &index) const
Returns a model index for the buddy of the item represented by index.
bool checkIndex(const QModelIndex &index, CheckIndexOptions options=CheckIndexOption::NoOption) const
virtual Q_INVOKABLE bool canFetchMore(const QModelIndex &parent) const
Returns {true} if there is more data available for parent; otherwise returns {false}.
virtual void revert()
Lets the model know that it should discard cached information.
virtual Q_INVOKABLE bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Sets the role data for the item at index to value.
virtual Q_INVOKABLE QModelIndex sibling(int row, int column, const QModelIndex &idx) const
Returns the sibling at row and column for the item at index, or an invalid QModelIndex if there is no...
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before rows are removed from the model.
bool beginMoveColumns(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationColumn)
Begins a column move operation.
virtual QHash< int, QByteArray > roleNames() const
void beginInsertColumns(const QModelIndex &parent, int first, int last)
Begins a column insertion operation.
void endInsertRows()
Ends a row insertion operation.
void beginResetModel()
Begins a model reset operation.
void encodeData(const QModelIndexList &indexes, QDataStream &stream) const
virtual QMap< int, QVariant > itemData(const QModelIndex &index) const
Returns a map with values for all predefined roles in the model for the item at the given index.
virtual bool setItemData(const QModelIndex &index, const QMap< int, QVariant > &roles)
Sets the role data for the item at index to the associated value in roles, for every Qt::ItemDataRole...
virtual Qt::DropActions supportedDragActions() const
Returns the actions supported by the data in this model.
void endRemoveColumns()
Ends a column removal operation.
void rowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow, QPrivateSignal)
virtual Q_INVOKABLE int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
void rowsInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after rows have been inserted into the model.
virtual QStringList mimeTypes() const
Returns the list of allowed MIME types.
void columnsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn, QPrivateSignal)
bool decodeData(int row, int column, const QModelIndex &parent, QDataStream &stream)
QAbstractItemModel(QObject *parent=nullptr)
Constructs an abstract item model with the given parent.
QModelIndex createIndex(int row, int column, const void *data=nullptr) const
Creates a model index for the given row and column with the internal pointer ptr.
void endInsertColumns()
Ends a column insertion operation.
void columnsInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after columns have been inserted into the model.
virtual QSize span(const QModelIndex &index) const
Returns the row and column span of the item represented by index.
virtual void multiData(const QModelIndex &index, QModelRoleDataSpan roleDataSpan) const
void beginRemoveRows(const QModelIndex &parent, int first, int last)
Begins a row removal operation.
void beginInsertRows(const QModelIndex &parent, int first, int last)
Begins a row insertion operation.
void rowsRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after rows have been removed from the model.
virtual bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole)
Sets the data for the given role and section in the header with the specified orientation to the valu...
virtual bool submit()
Lets the model know that it should submit cached information to permanent storage.
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
\reimp
Qt::ItemFlags flags(const QModelIndex &index) const override
\reimp
QModelIndex index(int row, int column=0, const QModelIndex &parent=QModelIndex()) const override
Returns the index of the data in row and column with parent.
QModelIndex sibling(int row, int column, const QModelIndex &idx) const override
\reimp
~QAbstractListModel()
Destroys the abstract list model.
QObject * parent() const
Returns a pointer to the parent object.
int columnCount(const QModelIndex &parent) const override
QAbstractListModel(QObject *parent=nullptr)
Constructs an abstract list model with the given parent.
bool hasChildren(const QModelIndex &parent) const override
Returns {true} if parent has any children; otherwise returns {false}.
bool hasChildren(const QModelIndex &parent) const override
Returns {true} if parent has any children; otherwise returns {false}.
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
\reimp
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Returns the index of the data in row and column with parent.
QAbstractTableModel(QObject *parent=nullptr)
Constructs an abstract table model for the given parent.
QModelIndex sibling(int row, int column, const QModelIndex &idx) const override
\reimp
QObject * parent() const
Returns a pointer to the parent object.
~QAbstractTableModel()
Destroys the abstract table model.
Qt::ItemFlags flags(const QModelIndex &index) const override
\reimp
bool testBit(qsizetype i) const
Returns true if the bit at index position i is 1; otherwise returns false.
void resize(qsizetype size)
Resizes the bit array to size bits.
void setBit(qsizetype i)
Sets the bit at index position i to 1.
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
\inmodule QtCore\reentrant
int columnCount(const QModelIndex &) const override
Returns the number of columns for the children of the given parent.
QEmptyItemModel(QObject *parent=nullptr)
bool hasChildren(const QModelIndex &) const override
Returns {true} if parent has any children; otherwise returns {false}.
QModelIndex index(int, int, const QModelIndex &) const override
Returns the index of the item in the model specified by the given row, column and parent index.
int rowCount(const QModelIndex &) const override
Returns the number of rows under the given parent.
QVariant data(const QModelIndex &, int) const override
Returns the data stored under the given role for the item referred to by the index.
QModelIndex parent(const QModelIndex &) const override
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
void remove(qsizetype i, qsizetype n=1)
void reserve(qsizetype size)
void append(parameter_type t)
iterator insert(const Key &key, const T &value)
QVariant data(int role=Qt::DisplayRole) const
Returns the data for the given role for the item referred to by the index.
constexpr int row() const noexcept
Returns the row this model index refers to.
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
constexpr const QAbstractItemModel * model() const noexcept
Returns a pointer to the model containing the item that this index refers to.
Qt::ItemFlags flags() const
constexpr int column() const noexcept
Returns the column this model index refers to.
void * internalPointer() const noexcept
Returns a {void} {*} pointer used by the model to associate the index with the internal data structur...
constexpr bool isValid() const noexcept
Returns {true} if this model index is valid; otherwise returns {false}.
void multiData(QModelRoleDataSpan roleDataSpan) const
QModelIndex sibling(int row, int column) const
Returns the sibling at row and column.
const void * constInternalPointer() const noexcept
Returns a {const void} {*} pointer used by the model to associate the index with the internal data st...
constexpr quintptr internalId() const noexcept
Returns a {quintptr} used by the model to associate the index with the internal data structure.
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
const_iterator cend() const noexcept
qsizetype remove(const Key &key)
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
iterator erase(const_iterator it)
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
const_iterator constFind(const Key &key) const noexcept
QObject * parent() const
Returns a pointer to the parent object.
static void destroy(QPersistentModelIndexData *data)
static QPersistentModelIndexData * create(const QModelIndex &index)
quintptr internalId() const
bool operator!=(const QPersistentModelIndex &other) const
const QAbstractItemModel * model() const
Returns the model that the index belongs to.
bool isValid() const
Returns {true} if this persistent model index is valid; otherwise returns {false}.
Qt::ItemFlags flags() const
bool operator<(const QPersistentModelIndex &other) const
QVariant data(int role=Qt::DisplayRole) const
Returns the data for the given role for the item referred to by the index.
void * internalPointer() const
bool operator==(const QPersistentModelIndex &other) const
Returns {true} if this persistent model index is equal to the other persistent model index; otherwise...
QModelIndex sibling(int row, int column) const
Returns the sibling at row and column or an invalid QModelIndex if there is no sibling at this positi...
QPersistentModelIndex & operator=(const QPersistentModelIndex &other)
Sets the persistent model index to refer to the same item in a model as the other persistent model in...
QModelIndex parent() const
Returns the parent QModelIndex for this persistent index, or an invalid QModelIndex if it has no pare...
const void * constInternalPointer() const
int column() const
Returns the column this persistent model index refers to.
void multiData(QModelRoleDataSpan roleDataSpan) const
Populates the given roleDataSpan for the item referred to by the index.
int row() const
Returns the row this persistent model index refers to.
\inmodule QtCore \reentrant
static QString wildcardToRegularExpression(const QString &str, WildcardConversionOptions options=DefaultWildcardConversion)
@ NonPathWildcardConversion
T pop()
Removes the top item from the stack and returns it.
void push(const T &t)
Adds element t to the top of the stack.
\macro QT_RESTRICTED_CAST_FROM_ASCII
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
bool isValid() const
Returns true if the storage type of this variant is not QMetaType::UnknownType; otherwise returns fal...
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static uint typeOfVariant(const QVariant &value)
QDebug operator<<(QDebug dbg, const QModelIndex &idx)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qBound(const T &min, const T &val, const T &max)
constexpr const T & qMax(const T &a, const T &b)
GLint GLfloat GLfloat GLfloat v2
GLsizei const GLfloat * v
[13]
GLsizei GLenum GLenum * types
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei GLsizei GLenum format
GLenum GLenum GLsizei void GLsizei void * column
GLenum GLenum GLsizei void * row
GLfixed GLfixed GLint GLint order
#define Q_ASSERT_X(cond, x, msg)
static QT_BEGIN_NAMESPACE QAsn1Element wrap(quint8 type, const QAsn1Element &child)
#define QStringLiteral(str)
static int toInt(const QChar &qc, int R)
QSqlQueryModel * model
[16]
void insertMultiAtEnd(const QModelIndex &key, QPersistentModelIndexData *data)
QMultiHash< QModelIndex, QPersistentModelIndexData * > indexes
QStack< QList< QPersistentModelIndexData * > > moved
QStack< QList< QPersistentModelIndexData * > > invalidated
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent