42 #ifndef QABSTRACTITEMMODEL_H
43 #define QABSTRACTITEMMODEL_H
60 friend class QAbstractItemModel;
65 :
r(other.
r),
c(other.
c),
p(other.
p), m(other.m) {}
67 inline int row()
const {
return r; }
71 inline QModelIndex
parent()
const;
73 inline QModelIndex child(
int row,
int column)
const;
75 inline Qt::ItemFlags
flags()
const;
76 inline const QAbstractItemModel *
model()
const {
return m; }
77 inline bool isValid()
const {
return (
r >= 0) && (
c >= 0) && (m != 0); }
79 {
return (other.r ==
r) && (other.p ==
p) && (other.c ==
c) && (other.m == m); }
81 {
return !(*
this == other); }
82 inline bool operator<(
const QModelIndex &other)
const
84 if (
r < other.r)
return true;
86 if (
c < other.c)
return true;
88 if (
p < other.p)
return true;
89 if (
p == other.p)
return m < other.m;
94 inline QModelIndex(
int row,
int column,
void *ptr,
const QAbstractItemModel *
model);
97 const QAbstractItemModel *m;
101 #ifndef QT_NO_DEBUG_STREAM
105 class QPersistentModelIndexData;
125 void *internalPointer()
const;
126 qint64 internalId()
const;
131 Qt::ItemFlags flags()
const;
133 bool isValid()
const;
135 QPersistentModelIndexData *d;
137 #ifndef QT_NO_DEBUG_STREAM
144 {
return qHash(index.d); }
147 #ifndef QT_NO_DEBUG_STREAM
155 class QAbstractItemModelPrivate;
156 template <
class Key,
class T>
class QMap;
163 friend class QPersistentModelIndexData;
164 friend class QAbstractItemViewPrivate;
220 Qt::MatchFlags
flags =
226 #ifdef Q_NO_USING_KEYWORD
238 #if !defined(Q_MOC_RUN) && !defined(qdoc)
253 void modelAboutToBeReset();
256 void rowsAboutToBeMoved(
const QModelIndex &sourceParent,
int sourceStart,
int sourceEnd,
const QModelIndex &destinationParent,
int destinationRow );
259 void columnsAboutToBeMoved(
const QModelIndex &sourceParent,
int sourceStart,
int sourceEnd,
const QModelIndex &destinationParent,
int destinationColumn );
324 {
return QModelIndex(arow, acolumn, adata,
this); }
326 #if defined(Q_CC_MSVC)
327 #pragma warning( push )
328 #pragma warning( disable : 4312 ) // avoid conversion warning on 64-bit
330 {
return QModelIndex(arow, acolumn, reinterpret_cast<void*>(aid),
this); }
331 #if defined(Q_CC_MSVC)
332 #pragma warning( pop )
335 #if defined(Q_CC_MSVC)
336 #pragma warning( push )
337 #pragma warning( disable : 4312 ) // avoid conversion warning on 64-bit
339 {
return QModelIndex(arow, acolumn, reinterpret_cast<void*>(aid),
this); }
340 #if defined(Q_CC_MSVC)
341 #pragma warning( pop )
390 :
r(arow),
c(acolumn),
p(adata), m(amodel) {}
405 {
return m ? m->
flags(*
this) : Qt::ItemFlags(0); }
414 #endif // QABSTRACTITEMMODEL_H
GLdouble GLdouble GLdouble r
void beginRemoveColumns(const QModelIndex &parent, int first, int last)
QModelIndex buddy(const QModelIndex &index) const
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
bool setItemData(const QModelIndex &index, const QMap< int, QVariant > &roles)
Qt::ItemFlags flags(const QModelIndex &index) const
virtual Qt::ItemFlags flags(const QModelIndex &index) const
int columnCount(const QModelIndex &parent=QModelIndex()) const
bool beginMoveRows(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationRow)
Q_CORE_EXPORT QDebug operator<<(QDebug, const QModelIndex &)
bool insertRow(int row, const QModelIndex &parent=QModelIndex())
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
void encodeData(const QModelIndexList &indexes, QDataStream &stream) const
void fetchMore(const QModelIndex &parent)
QStringList mimeTypes() const
QAbstractItemModel(QObject *parent=0)
void headerDataChanged(Qt::Orientation orientation, int first, int last)
QAbstractItemModel * model() const
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
bool insertColumn(int column, const QModelIndex &parent=QModelIndex())
Qt::DropActions supportedDragActions() const
void * internalPointer() const
Qt::ItemFlags flags() const
void layoutAboutToBeChanged()
bool operator<(const QModelIndex &other) const
void changePersistentIndex(const QModelIndex &from, const QModelIndex &to)
QVariant data(int role=Qt::DisplayRole) const
virtual QModelIndex parent(const QModelIndex &child) const =0
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
bool beginMoveColumns(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationColumn)
const QHash< int, QByteArray > & roleNames() const
bool hasChildren(const QModelIndex &parent=QModelIndex()) const
bool operator==(const Attribute &cA, const AttributeInstance< type > &cB)
This operator compares the two attributes and NOT their values.
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
GLenum GLenum GLvoid * row
#define QT_BEGIN_NAMESPACE
GLsizei GLsizei GLenum GLenum const GLvoid * data
QModelIndex sibling(int row, int column, const QModelIndex &idx) const
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const =0
QModelIndex child(int row, int column) const
bool canFetchMore(const QModelIndex &parent) const
bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex())
void beginRemoveRows(const QModelIndex &parent, int first, int last)
bool decodeData(int row, int column, const QModelIndex &parent, QDataStream &stream)
QModelIndexList persistentIndexList() const
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole)
GLuint GLuint GLsizei count
bool removeRow(int row, const QModelIndex &parent=QModelIndex())
uint qHash(const QPersistentModelIndex &index)
QModelIndex sibling(int row, int column) const
bool removeColumn(int column, const QModelIndex &parent=QModelIndex())
bool operator!=(const QByteArray &a1, const QByteArray &a2)
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
QMap< int, QVariant > itemData(const QModelIndex &index) const
QList< QModelIndex > QModelIndexList
const QAbstractItemModel * model() const
QModelIndex createIndex(int row, int column, void *data=0) const
QMimeData * mimeData(const QModelIndexList &indexes) const
GLsizei const GLfloat * value
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder)
GLenum GLenum GLvoid GLvoid * column
bool operator!=(const QPersistentModelIndex &other) const
QModelIndex(const QModelIndex &other)
void changePersistentIndexList(const QModelIndexList &from, const QModelIndexList &to)
void setSupportedDragActions(Qt::DropActions)
qint64 internalId() const
virtual bool hasChildren(const QModelIndex &parent=QModelIndex()) const
QVariant headerData(int section, Qt::Orientation orientation, int role) const
QModelIndex parent() const
bool operator<(const QByteArray &a1, const QByteArray &a2)
void beginInsertColumns(const QModelIndex &parent, int first, int last)
bool operator==(const QModelIndex &other) const
GLenum GLenum GLvoid GLvoid GLvoid * span
bool insertColumns(int column, int count, const QModelIndex &parent=QModelIndex())
bool operator!=(const QModelIndex &other) const
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
void setRoleNames(const QHash< int, QByteArray > &roleNames)
void beginInsertRows(const QModelIndex &parent, int first, int last)
Qt::DropActions supportedDropActions() const
int rowCount(const QModelIndex &parent=QModelIndex()) const
bool hasIndex(int row, int column, const QModelIndex &parent=QModelIndex()) const
QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const
virtual ~QAbstractItemModel()
Q_DECLARE_TYPEINFO(QModelIndex, Q_MOVABLE_TYPE)
Qt::ItemFlags flags(const QModelIndex &index) const
bool removeColumns(int column, int count, const QModelIndex &parent=QModelIndex())