6#include <private/qabstractitemmodel_p.h>
13#if QT_CONFIG(regularexpression)
37 QMultiHash<QModelIndex, QPersistentModelIndexData *> &indexes =
model->d_func()->persistent.indexes;
38 const auto it = indexes.constFind(
index);
39 if (
it != indexes.cend()) {
58 p->removePersistentIndexData(
data);
357 if (
index.isValid()) {
405 return d->index <
other.d->index;
407 return std::less<>{}(
d,
other.d);
450 if (
other.isValid()) {
484 return !
other.isValid();
498 return other.isValid();
668#ifndef QT_NO_DEBUG_STREAM
672 dbg.nospace() <<
"QModelIndex(" << idx.
row() <<
',' << idx.
column()
714 return qEmptyModel();
751 return *qDefaultRoleNames();
761 switch (
left.userType()) {
764 case QMetaType::UInt:
766 case QMetaType::LongLong:
767 return left.toLongLong() <
right.toLongLong();
768 case QMetaType::ULongLong:
769 return left.toULongLong() <
right.toULongLong();
770 case QMetaType::Float:
772 case QMetaType::Double:
773 return left.toDouble() <
right.toDouble();
774 case QMetaType::QChar:
776 case QMetaType::QDate:
778 case QMetaType::QTime:
780 case QMetaType::QDateTime:
781 return left.toDateTime() <
right.toDateTime();
782 case QMetaType::QString:
785 return left.toString().localeAwareCompare(
right.toString()) < 0;
787 return left.toString().compare(
right.toString(), cs) < 0;
795 switch (
value.userType()) {
796 case QMetaType::Bool:
798 case QMetaType::UInt:
799 case QMetaType::LongLong:
800 case QMetaType::ULongLong:
801 case QMetaType::QChar:
802 case QMetaType::Short:
803 case QMetaType::UShort:
804 case QMetaType::UChar:
805 case QMetaType::ULong:
806 case QMetaType::Long:
808 case QMetaType::Double:
809 case QMetaType::Float:
827 return v1.toLongLong() <
v2.toLongLong();
829 return v1.toReal() <
v2.toReal();
831 return v1.toString().localeAwareCompare(
v2.toString()) < 0;
837 if (
data->index.isValid()) {
839 Q_ASSERT_X(removed == 1,
"QPersistentModelIndex::~QPersistentModelIndex",
840 "persistent model indexes corrupted");
852 for (
int i =
persistent.invalidated.size() - 1;
i >= 0; --
i) {
865 QList<QPersistentModelIndexData *> persistent_moved;
866 if (first < q->rowCount(
parent)) {
870 persistent_moved.append(
data);
880 const QList<QPersistentModelIndexData *> persistent_moved =
persistent.moved.pop();
882 for (
auto *
data : persistent_moved) {
886 if (
data->index.isValid()) {
889 qWarning() <<
"QAbstractItemModel::endInsertRows: Invalid index (" << old.
row() +
count <<
',' << old.
column() <<
") in model" << q_func();
896 QList<QPersistentModelIndexData *> persistent_moved_explicitly;
897 QList<QPersistentModelIndexData *> persistent_moved_in_source;
898 QList<QPersistentModelIndexData *> persistent_moved_in_destination;
900 const bool sameParent = (srcParent == destinationParent);
901 const bool movingUp = (srcFirst > destinationChild);
906 const bool isSourceIndex = (
parent == srcParent);
907 const bool isDestinationIndex = (
parent == destinationParent);
911 childPosition =
index.row();
913 childPosition =
index.column();
915 if (!
index.isValid() || !(isSourceIndex || isDestinationIndex ) )
918 if (!sameParent && isDestinationIndex) {
919 if (childPosition >= destinationChild)
920 persistent_moved_in_destination.append(
data);
924 if (sameParent && movingUp && childPosition < destinationChild)
927 if (sameParent && !movingUp && childPosition < srcFirst )
930 if (!sameParent && childPosition < srcFirst)
933 if (sameParent && (childPosition > srcLast) && (childPosition >= destinationChild ))
936 if ((childPosition <= srcLast) && (childPosition >= srcFirst)) {
937 persistent_moved_explicitly.append(
data);
939 persistent_moved_in_source.append(
data);
942 persistent.moved.push(persistent_moved_explicitly);
943 persistent.moved.push(persistent_moved_in_source);
944 persistent.moved.push(persistent_moved_in_destination);
957 for (
auto *
data : indexes) {
968 if (
data->index.isValid()) {
971 qWarning() <<
"QAbstractItemModel::endMoveRows: Invalid index (" <<
row <<
"," <<
column <<
") in model" << q_func();
978 const QList<QPersistentModelIndexData *> moved_in_destination =
persistent.moved.pop();
979 const QList<QPersistentModelIndexData *> moved_in_source =
persistent.moved.pop();
980 const QList<QPersistentModelIndexData *> moved_explicitly =
persistent.moved.pop();
982 const bool sameParent = (sourceParent == destinationParent);
983 const bool movingUp = (sourceFirst > destinationChild);
985 const int explicit_change = (!sameParent || movingUp) ? destinationChild - sourceFirst : destinationChild - sourceLast - 1 ;
986 const int source_change = (!sameParent || !movingUp) ? -1*(sourceLast - sourceFirst + 1) : sourceLast - sourceFirst + 1 ;
987 const int destination_change = sourceLast - sourceFirst + 1;
997 QList<QPersistentModelIndexData *> persistent_moved;
998 QList<QPersistentModelIndexData *> persistent_invalidated;
1002 bool level_changed =
false;
1006 if (current_parent ==
parent) {
1007 if (!level_changed && current.
row() > last)
1008 persistent_moved.append(
data);
1009 else if (current.
row() <= last && current.
row() >=
first)
1010 persistent_invalidated.append(
data);
1013 current = current_parent;
1014 level_changed =
true;
1019 persistent.invalidated.push(persistent_invalidated);
1023 int first,
int last)
1025 const QList<QPersistentModelIndexData *> persistent_moved =
persistent.moved.pop();
1027 for (
auto *
data : persistent_moved) {
1031 if (
data->index.isValid()) {
1034 qWarning() <<
"QAbstractItemModel::endRemoveRows: Invalid index (" << old.
row() -
count <<
',' << old.
column() <<
") in model" << q_func();
1037 const QList<QPersistentModelIndexData *> persistent_invalidated =
persistent.invalidated.pop();
1038 for (
auto *
data : persistent_invalidated) {
1047 int first,
int last)
1051 QList<QPersistentModelIndexData *> persistent_moved;
1052 if (first < q->columnCount(
parent)) {
1056 persistent_moved.append(
data);
1063 int first,
int last)
1065 const QList<QPersistentModelIndexData *> persistent_moved =
persistent.moved.pop();
1067 for (
auto *
data : persistent_moved) {
1071 if (
data->index.isValid()) {
1074 qWarning() <<
"QAbstractItemModel::endInsertColumns: Invalid index (" << old.
row() <<
',' << old.
column() +
count <<
") in model" << q_func();
1080 int first,
int last)
1082 QList<QPersistentModelIndexData *> persistent_moved;
1083 QList<QPersistentModelIndexData *> persistent_invalidated;
1087 bool level_changed =
false;
1091 if (current_parent ==
parent) {
1092 if (!level_changed && current.
column() > last)
1093 persistent_moved.append(
data);
1095 persistent_invalidated.append(
data);
1098 current = current_parent;
1099 level_changed =
true;
1104 persistent.invalidated.push(persistent_invalidated);
1109 int first,
int last)
1111 const QList<QPersistentModelIndexData *> persistent_moved =
persistent.moved.pop();
1113 for (
auto *
data : persistent_moved) {
1117 if (
data->index.isValid()) {
1120 qWarning() <<
"QAbstractItemModel::endRemoveColumns: Invalid index (" << old.
row() <<
',' << old.
column() -
count <<
") in model" << q_func();
1123 const QList<QPersistentModelIndexData *> persistent_invalidated =
persistent.invalidated.pop();
1124 for (
auto *
data : persistent_invalidated) {
1722 d_func()->invalidatePersistentIndexes();
2015 QMap<int, QVariant> roles;
2019 roles.insert(
i, variantData);
2090 for (
auto it = roles.begin(), e = roles.end();
it != e; ++
it) {
2134 if (indexes.
size() <= 0)
2137 if (
types.isEmpty())
2173 for (
int i = 0;
i < modelTypes.size(); ++
i) {
2174 if (
data->hasFormat(modelTypes.at(
i)))
2217 if (
types.isEmpty())
2295bool QAbstractItemModel::insertRows(
int,
int,
const QModelIndex &)
2324bool QAbstractItemModel::insertColumns(
int,
int,
const QModelIndex &)
2345bool QAbstractItemModel::removeRows(
int,
int,
const QModelIndex &)
2366bool QAbstractItemModel::removeColumns(
int,
int,
const QModelIndex &)
2456 if (!
d->indexValid(
index))
2511 Qt::MatchFlags
flags)
const
2518 bool allHits = (hits == -1);
2520#if QT_CONFIG(regularexpression)
2525 int from =
start.row();
2529 for (
int i = 0; (
wrap &&
i < 2) || (!
wrap &&
i < 1); ++
i) {
2530 for (
int r = from; (
r < to) && (allHits ||
result.size() < hits); ++
r) {
2540#if QT_CONFIG(regularexpression)
2542 if (
rx.pattern().isEmpty()) {
2543 if (
value.userType() == QMetaType::QRegularExpression) {
2544 rx =
value.toRegularExpression();
2546 rx.setPattern(
value.toString());
2552 if (
rx.pattern().isEmpty()) {
2566 switch (matchType) {
2567#if QT_CONFIG(regularexpression)
2576 if (
t.startsWith(
text, cs))
2580 if (
t.endsWith(
text, cs))
2584 if (
t.compare(
text, cs) == 0)
2589 if (
t.contains(
text, cs))
2754 for (
const auto &
index : indexes)
2768 QList<int> rows, columns;
2769 QList<QMap<int, QVariant>>
data;
2771 while (!
stream.atEnd()) {
2773 QMap<int, QVariant>
v;
2786 int dragRowCount = 0;
2790 QList<int> rowsToInsert(
bottom + 1);
2791 for (
int i = 0;
i < rows.size(); ++
i)
2792 rowsToInsert[rows.at(
i)] = 1;
2793 for (
int i = 0;
i < rowsToInsert.size(); ++
i) {
2794 if (rowsToInsert.at(
i) == 1){
2795 rowsToInsert[
i] = dragRowCount;
2799 for (
int i = 0;
i < rows.size(); ++
i)
2800 rows[
i] =
top + rowsToInsert.at(rows.at(
i));
2802 QBitArray isWrittenTo(dragRowCount * dragColumnCount);
2806 if (colCount == 0) {
2807 insertColumns(colCount, dragColumnCount - colCount,
parent);
2815 QList<QPersistentModelIndex> newIndexes(
data.size());
2817 for (
int j = 0;
j <
data.size(); ++
j) {
2818 int relativeRow = rows.at(
j) -
top;
2819 int relativeColumn = columns.at(
j) -
left;
2820 int destinationRow = relativeRow +
row;
2821 int destinationColumn = relativeColumn +
column;
2822 int flat = (relativeRow * dragColumnCount) + relativeColumn;
2824 if (destinationColumn >= colCount || isWrittenTo.testBit(flat)) {
2825 destinationColumn =
qBound(
column, destinationColumn, colCount - 1);
2826 destinationRow =
row + dragRowCount;
2827 insertRows(
row + dragRowCount, 1,
parent);
2828 flat = (dragRowCount * dragColumnCount) + relativeColumn;
2829 isWrittenTo.resize(++dragRowCount * dragColumnCount);
2831 if (!isWrittenTo.testBit(flat)) {
2832 newIndexes[
j] =
index(destinationRow, destinationColumn,
parent);
2833 isWrittenTo.setBit(flat);
2837 for(
int k = 0; k < newIndexes.size(); k++) {
2838 if (newIndexes.at(k).isValid())
2978 if (destinationParent == srcParent)
2979 return !(destinationStart >=
start && destinationStart <=
end + 1);
2981 QModelIndex destinationAncestor = destinationParent;
2982 int pos = (
Qt::Vertical == orientation) ? destinationAncestor.
row() : destinationAncestor.column();
2984 if (destinationAncestor == srcParent) {
2990 if (!destinationAncestor.isValid())
2993 pos = (
Qt::Vertical == orientation) ? destinationAncestor.row() : destinationAncestor.column();
2994 destinationAncestor = destinationAncestor.parent();
3100 Q_ASSERT(sourceLast >= sourceFirst);
3110 d->changes.push(sourceChange);
3114 d->changes.push(destinationChange);
3142 const int numMoved = removeChange.last - removeChange.first + 1;
3143 if (insertChange.needsAdjust)
3144 adjustedDestination =
createIndex(adjustedDestination.row() - numMoved, adjustedDestination.column(), adjustedDestination.internalPointer());
3146 if (removeChange.needsAdjust)
3147 adjustedSource =
createIndex(adjustedSource.row() + numMoved, adjustedSource.column(), adjustedSource.internalPointer());
3149 d->itemsMoved(adjustedSource, removeChange.first, removeChange.last, adjustedDestination, insertChange.first,
Qt::Vertical);
3151 emit rowsMoved(adjustedSource, removeChange.first, removeChange.last, adjustedDestination, insertChange.first, QPrivateSignal());
3319 Q_ASSERT(sourceLast >= sourceFirst);
3329 d->changes.push(sourceChange);
3333 d->changes.push(destinationChange);
3361 const int numMoved = removeChange.last - removeChange.first + 1;
3362 if (insertChange.needsAdjust)
3363 adjustedDestination =
createIndex(adjustedDestination.row(), adjustedDestination.column() - numMoved, adjustedDestination.internalPointer());
3365 if (removeChange.needsAdjust)
3366 adjustedSource =
createIndex(adjustedSource.row(), adjustedSource.column() + numMoved, adjustedSource.internalPointer());
3368 d->itemsMoved(adjustedSource, removeChange.first, removeChange.last, adjustedDestination, insertChange.first,
Qt::Horizontal);
3369 emit columnsMoved(adjustedSource, removeChange.first, removeChange.last, adjustedDestination, insertChange.first, QPrivateSignal());
3414 d->invalidatePersistentIndexes();
3431 if (
d->persistent.indexes.isEmpty())
3435 if (
it !=
d->persistent.indexes.
cend()) {
3440 d->persistent.insertMultiAtEnd(to,
data);
3459 if (
d->persistent.indexes.isEmpty())
3461 QList<QPersistentModelIndexData *> toBeReinserted;
3462 toBeReinserted.reserve(to.
size());
3463 for (
int i = 0;
i < from.
size(); ++
i) {
3464 if (from.
at(
i) == to.
at(
i))
3467 if (
it !=
d->persistent.indexes.
cend()) {
3471 if (
data->index.isValid())
3472 toBeReinserted <<
data;
3476 for (
auto *
data : std::as_const(toBeReinserted))
3477 d->persistent.insertMultiAtEnd(
data->index,
data);
3490 for (
auto *
data : std::as_const(
d->persistent.indexes))
3571 if (!
index.isValid()) {
3573 qCWarning(lcCheckIndex) <<
"Index" <<
index <<
"is not valid (expected valid)";
3579 if (
index.model() !=
this) {
3581 <<
"is for model" <<
index.model()
3582 <<
"which is different from this model" <<
this;
3586 if (
index.row() < 0) {
3588 <<
"has negative row" <<
index.row();
3592 if (
index.column() < 0) {
3594 <<
"has negative column" <<
index.column();
3603 <<
"has valid parent" << parentIndex
3604 <<
"(expected an invalid parent)";
3609 const int rc =
rowCount(parentIndex);
3610 if (
index.row() >= rc) {
3612 <<
"has out of range row" <<
index.row()
3613 <<
"rowCount() is" << rc;
3618 if (
index.column() >= cc) {
3620 <<
"has out of range column" <<
index.column()
3621 <<
"columnCount() is" << cc;
3825 if (
index.isValid())
3967 if (
index.isValid())
3982 return parent.isValid() ? 0 : 1;
4007 if (
types.isEmpty())
4020 QList<int> rows, columns;
4021 QList<QMap<int, QVariant>>
data;
4023 while (!
stream.atEnd()) {
4025 QMap<int, QVariant>
v;
4034 for (
int i = 0;
i <
data.size(); ++
i) {
4058 if (
types.isEmpty())
4071 QList<int> rows, columns;
4072 QList<QMap<int, QVariant>>
data;
4074 while (!
stream.atEnd()) {
4076 QMap<int, QVariant>
v;
4085 for (
int i = 0;
i <
data.size(); ++
i) {
4172#include "moc_qabstractitemmodel.cpp"
4173#include "qabstractitemmodel.moc"
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
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 reserve(qsizetype size)
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.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
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 noexcept
Returns {true} if this persistent model index is equal to the other persistent model index; otherwise...
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
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 noexcept
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...
bool operator<(const QPersistentModelIndex &other) const noexcept
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
const_iterator cend() const noexcept
iterator erase(const_iterator i)
const_iterator constFind(const T &value) const
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
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)
QT_BEGIN_NAMESPACE constexpr void qSwap(T &value1, T &value2) noexcept(std::is_nothrow_swappable_v< T >)
static int toInt(const QChar &qc, int R)
QSqlQueryModel * model
[16]
void insertMultiAtEnd(const QModelIndex &key, QPersistentModelIndexData *data)
QMultiHash< QModelIndex, QPersistentModelIndexData * > indexes