1 This file is intended to keep notes about general coding stuff, code
2 conventions or how to best interact with certain parts of Qt.
6 Regarding QSortFilterProxyModel:
7 ========================================
8 When subclassing QSortFilterProxyModel avoid the use of the following
9 calls on QModelIndex and use their equivalents of QAbstractItemModel:
11 inline QModelIndex QModelIndex::parent() const
12 inline QModelIndex QModelIndex::sibling(int arow, int acolumn) const
13 inline QModelIndex QModelIndex::child(int arow, int acolumn) const
14 inline QVariant QModelIndex::data(int arole) const
15 inline Qt::ItemFlags QModelIndex::flags() const
17 For Example when reimplementing QSortFilterProxyModel::data(const
18 QModelIndex &idx, int role):
24 QModelIndex source_index = mapToSource(idx);
25 sourceModel()->data(idx, role);