- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Friends

# QModelIndex Class Reference

Search for all occurrences

## Detailed Description

Definition at line 58 of file qabstractitemmodel.h.

`#include <qabstractitemmodel.h>`

List of all members.

## Public Member Functions
| QModelIndex ()
| QModelIndex (const QModelIndex &other)
| ~QModelIndex ()
int | row () const
int | column () const
void * | internalPointer () const
qint64 | internalId () const
QModelIndex | parent () const
QModelIndex | sibling (int row, int column) const
QModelIndex | child (int row, int column) const
QVariant | data (int role=Qt::DisplayRole) const
Qt::ItemFlags | flags () const
const QAbstractItemModel * | model () const
bool | isValid () const
bool | operator== (const QModelIndex &other) const
bool | operator!= (const QModelIndex &other) const
bool | operator< (const QModelIndex &other) const
## Friends
class | QAbstractItemModel
class | QProxyModel

## Constructor & Destructor Documentation

QModelIndex | ( |  | ) | `[inline]`

Definition at line 63 of file qabstractitemmodel.h.

    : r(-1), c(-1), p(0), m(0) {}

QModelIndex | ( | const QModelIndex & | other | ) | `[inline]`

Definition at line 64 of file qabstractitemmodel.h.

            : r(other.r), c(other.c), p(other.p), m(other.m) {}

~QModelIndex | ( |  | ) | `[inline]`

Definition at line 66 of file qabstractitemmodel.h.

    { p = 0; m = 0; }

## Member Function Documentation

int row | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 67 of file qabstractitemmodel.h.

    { return r; }

int column | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 68 of file qabstractitemmodel.h.

    { return c; }

void* internalPointer | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 69 of file qabstractitemmodel.h.

    { return p; }

qint64 internalId | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 70 of file qabstractitemmodel.h.

    { return reinterpret_cast<qint64>(p); }

QModelIndex parent | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 388 of file qabstractitemmodel.h.

    { return m ? m->parent(*this) : QModelIndex(); }

QModelIndex sibling | ( | int | row,
|  | int | column
| ) |  | const `[inline]`

Search for all occurrences

Definition at line 391 of file qabstractitemmodel.h.

    { return m ? (r == arow && c == acolumn) ? *this : m->index(arow, acolumn, m->parent(*this)) : QModelIndex(); }

QModelIndex child | ( | int | row,
|  | int | column
| ) |  | const `[inline]`

Search for all occurrences

Definition at line 394 of file qabstractitemmodel.h.

    { return m ? m->index(arow, acolumn, *this) : QModelIndex(); }

QVariant data | ( | int | role = `Qt::DisplayRole` | ) | const `[inline]`

Search for all occurrences

Definition at line 397 of file qabstractitemmodel.h.

    { return m ? m->data(*this, arole) : QVariant(); }

Qt::ItemFlags flags | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 400 of file qabstractitemmodel.h.

    { return m ? m->flags(*this) : Qt::ItemFlags(0); }

const QAbstractItemModel* model | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 76 of file qabstractitemmodel.h.

    { return m; }

bool isValid | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 77 of file qabstractitemmodel.h.

    { return (r >= 0) && (c >= 0) && (m != 0); }

bool operator== | ( | const QModelIndex & | other | ) | const `[inline]`

Definition at line 78 of file qabstractitemmodel.h.

            { return (other.r == r) && (other.p == p) && (other.c == c) && (other.m == m); }

bool operator!= | ( | const QModelIndex & | other | ) | const `[inline]`

Definition at line 80 of file qabstractitemmodel.h.

            { return !(*this == other); }

bool operator< | ( | const QModelIndex & | other | ) | const `[inline]`

Definition at line 82 of file qabstractitemmodel.h.

            {
              if (r < other.r) return true;
              if (r == other.r) {
                  if (c < other.c) return true;
                  if (c == other.c) {
                      if (p < other.p) return true;
                      if (p == other.p) return m < other.m;
                  }
              }
              return false; }

## Friends And Related Function Documentation

friend class QAbstractItemModel `[friend]`

Search for all occurrences

Definition at line 60 of file qabstractitemmodel.h.

friend class QProxyModel `[friend]`

Search for all occurrences

Definition at line 61 of file qabstractitemmodel.h.

The documentation for this class was generated from the following file:

- QtCore/qabstractitemmodel.h

QModelIndex QModelIndex QModelIndex QModelIndex QModelIndex QModelIndex QModelIndex QModelIndex QModelIndex QModelIndex
QModelIndex QModelIndex QModelIndex QModelIndex QModelIndex QModelIndex QModelIndex QModelIndex QModelIndex QModelIndex