42 #ifndef QABSTRACTITEMMODEL_P_H 43 #define QABSTRACTITEMMODEL_P_H 57 #include "private/qobject_p.h" 58 #include "QtCore/qstack.h" 59 #include "QtCore/qset.h" 60 #include "QtCore/qhash.h" 84 void rowsAboutToBeInserted(
const QModelIndex &parent,
int first,
int last);
85 void rowsInserted(
const QModelIndex &parent,
int first,
int last);
86 void rowsAboutToBeRemoved(
const QModelIndex &parent,
int first,
int last);
87 void rowsRemoved(
const QModelIndex &parent,
int first,
int last);
88 void columnsAboutToBeInserted(
const QModelIndex &parent,
int first,
int last);
89 void columnsInserted(
const QModelIndex &parent,
int first,
int last);
90 void columnsAboutToBeRemoved(
const QModelIndex &parent,
int first,
int last);
91 void columnsRemoved(
const QModelIndex &parent,
int first,
int last);
100 return q_func()->createIndex(row, column, data);
104 return q_func()->createIndex(row, column,
id);
108 return (index.
row() >= 0) && (index.
column() >= 0) && (index.
model() == q_func());
116 persistent.indexes.clear();
126 if(it != persistent.indexes.end()) {
128 persistent.indexes.erase(it);
136 Change(
const Change &
c) : parent(c.parent), first(c.first), last(c.last), needsAdjust(c.needsAdjust) {}
156 bool isValid() {
return first >= 0 && last >= 0; }
176 #endif // QABSTRACTITEMMODEL_P_H The QVariant class acts like a union for the most common Qt data types.
void invalidatePersistentIndex(const QModelIndex &index)
#define QT_END_NAMESPACE
This macro expands to.
static void destroy(QPersistentModelIndexData *data)
The QAtomicInt class provides platform-independent atomic operations on integers. ...
#define it(className, varName)
QStack< QVector< QPersistentModelIndexData * > > invalidated
QHash< QModelIndex, QPersistentModelIndexData * > indexes
The QStack class is a template class that provides a stack.
The QHash class is a template class that provides a hash-table-based dictionary.
bool indexValid(const QModelIndex &index) const
The QVector class is a template class that provides a dynamic array.
static QPersistentModelIndexData * create(const QModelIndex &index)
#define QT_BEGIN_NAMESPACE
This macro expands to.
const QAbstractItemModel * model
int row() const
Returns the row this model index refers to.
const QAbstractItemModel * model() const
Returns a pointer to the model containing the item that this index refers to.
QModelIndex createIndex(int row, int column, int id) const
QPersistentModelIndexData()
static const char * data(const QByteArray &arr)
QStack< QVector< QPersistentModelIndexData * > > moved
Change(const QModelIndex &p, int f, int l)
The QAbstractItemModel class provides the abstract interface for item model classes.
void invalidatePersistentIndexes()
#define Q_DECLARE_PUBLIC(Class)
QAbstractItemModelPrivate()
QPersistentModelIndexData(const QModelIndex &idx)
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
The QModelIndex class is used to locate data in a data model.
Qt::DropActions supportedDragActions
QHash< int, QByteArray > roleNames
int column() const
Returns the column this model index refers to.
QModelIndex createIndex(int row, int column, void *data=0) const