core: Fix SQLite realname/avatarurl handling
[quassel.git] / dev-notes / code_policy.txt
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.
3
4
5
6 Regarding QSortFilterProxyModel:
7 ========================================
8 When subclassing QSortFilterProxyModel avoid the use of the following
9 calls on QModelIndex and use their equivalents of QAbstractItemModel:
10
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
16
17 For Example when reimplementing QSortFilterProxyModel::data(const
18 QModelIndex &idx, int role):
19
20 Avoid:
21  idx.data(role); 
22
23 Instead:
24  QModelIndex source_index = mapToSource(idx);
25  sourceModel()->data(idx, role);
26