Qt 4.8
Classes | Typedefs | Functions
qabstractitemmodel.h File Reference
#include <QtCore/qvariant.h>
#include <QtCore/qobject.h>
#include <QtCore/qhash.h>

Go to the source code of this file.

Classes

class  QAbstractItemModel
 The QAbstractItemModel class provides the abstract interface for item model classes. More...
 
class  QAbstractListModel
 The QAbstractListModel class provides an abstract model that can be subclassed to create one-dimensional list models. More...
 
class  QAbstractTableModel
 The QAbstractTableModel class provides an abstract model that can be subclassed to create table models. More...
 
class  QList< T >
 The QList class is a template class that provides lists. More...
 
class  QMap< Key, T >
 The QMap class is a template class that provides a skip-list-based dictionary. More...
 
class  QModelIndex
 The QModelIndex class is used to locate data in a data model. More...
 
class  QPersistentModelIndex
 The QPersistentModelIndex class is used to locate data in a data model. More...
 

Typedefs

typedef QList< QModelIndexQModelIndexList
 

Functions

Q_CORE_EXPORT QDebug operator<< (QDebug, const QModelIndex &)
 
Q_CORE_EXPORT QDebug operator<< (QDebug, const QPersistentModelIndex &)
 
 Q_DECLARE_TYPEINFO (QModelIndex, Q_MOVABLE_TYPE)
 
 Q_DECLARE_TYPEINFO (QPersistentModelIndex, Q_MOVABLE_TYPE)
 
uint qHash (const QPersistentModelIndex &index)
 
uint qHash (const QModelIndex &index)
 

Typedef Documentation

◆ QModelIndexList

typedef QList<QModelIndex> QModelIndexList
related

Definition at line 151 of file qabstractitemmodel.h.

Function Documentation

◆ operator<<() [1/2]

Q_CORE_EXPORT QDebug operator<< ( QDebug  ,
const QModelIndex  
)

Definition at line 465 of file qabstractitemmodel.cpp.

Referenced by qHash().

466 {
467 #ifndef Q_BROKEN_DEBUG_STREAM
468  dbg.nospace() << "QModelIndex(" << idx.row() << ',' << idx.column()
469  << ',' << idx.internalPointer() << ',' << idx.model() << ')';
470  return dbg.space();
471 #else
472  qWarning("This compiler doesn't support streaming QModelIndex to QDebug");
473  return dbg;
474  Q_UNUSED(idx);
475 #endif
476 }
Q_CORE_EXPORT void qWarning(const char *,...)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ operator<<() [2/2]

Q_CORE_EXPORT QDebug operator<< ( QDebug  ,
const QPersistentModelIndex  
)

Definition at line 478 of file qabstractitemmodel.cpp.

479 {
480  if (idx.d)
481  dbg << idx.d->index;
482  else
483  dbg << QModelIndex();
484  return dbg;
485 }
The QModelIndex class is used to locate data in a data model.

◆ Q_DECLARE_TYPEINFO() [1/2]

Q_DECLARE_TYPEINFO ( QModelIndex  ,
Q_MOVABLE_TYPE   
)

◆ Q_DECLARE_TYPEINFO() [2/2]

Q_DECLARE_TYPEINFO ( QPersistentModelIndex  ,
Q_MOVABLE_TYPE   
)

◆ qHash() [1/2]

uint qHash ( const QPersistentModelIndex index)
inline
Since
4.5

Returns a hash of the QPersistentModelIndex

Definition at line 143 of file qabstractitemmodel.h.

144 { return qHash(index.d); }
QPersistentModelIndexData * d
uint qHash(const QUrl &url)
Definition: qurl.h:285

◆ qHash() [2/2]

uint qHash ( const QModelIndex index)
inline

Definition at line 407 of file qabstractitemmodel.h.

408 { return uint((index.row() << 4) + index.column() + index.internalId()); }
qint64 internalId() const
Returns a qint64 used by the model to associate the index with the internal data structure.
int row() const
Returns the row this model index refers to.
unsigned int uint
Definition: qglobal.h:996
int column() const
Returns the column this model index refers to.