inline QModelIndex() : r(-1), c(-1), p(0), m(0) {}
To copy to clipboard, switch view to plain text mode
This is the default constructor for a QModelIndex creating an invalid index. The implementation initializes internal members r, c, p and m to the values shown in () above.
: r(other.r), c(other.c), p(other.p), m(other.m) {}
inline QModelIndex(const QModelIndex &other)
: r(other.r), c(other.c), p(other.p), m(other.m) {}
To copy to clipboard, switch view to plain text mode
This is the copy constructor creating a new QModelIndex as a copy of the existing QModelIndex other. The new index gets initialized with the internal state of the other object.
In
{
return hasIndex
(row, column, parent
) ? createIndex
(row, column,
0) : QModelIndex();
}
QModelIndex QAbstractTableModel::index(int row, int column, const QModelIndex &parent) const
{
return hasIndex(row, column, parent) ? createIndex(row, column, 0) : QModelIndex();
}
To copy to clipboard, switch view to plain text mode
method
createIndex(int, int, int)
createIndex(int, int, int)
To copy to clipboard, switch view to plain text mode
gets called with 3rd parameter set to 0. In the implementation of this method you will find a reinterpret_cast of the 3rd parameter to void pointer. From my understanding you need the 3rd parameter to create tree like structures (or even more sophisticated data structures). For plain tables I've never needed the 3rd createIndex() parameter.
Best regards
ars
Bookmarks