mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-24 10:52:53 +00:00

the version imported is based on upstream 9c5fd60 with its bundled copies of miniz (alternative to zlib), oxygen icons and other non-relevant cruft removed. KDE integreation hardcoded having in mind it will improve (icons handling, browser integration, etc.) rebranding is not done yet and credits to the original authors and contributors are and will be left mostly intact with the exception of adding new.
26 lines
843 B
Text
26 lines
843 B
Text
This file is intended to keep notes about general coding stuff, code
|
|
conventions or how to best interact with certain parts of Qt.
|
|
|
|
|
|
|
|
Regarding QSortFilterProxyModel:
|
|
========================================
|
|
When subclassing QSortFilterProxyModel avoid the use of the following
|
|
calls on QModelIndex and use their equivalents of QAbstractItemModel:
|
|
|
|
inline QModelIndex QModelIndex::parent() const
|
|
inline QModelIndex QModelIndex::sibling(int arow, int acolumn) const
|
|
inline QModelIndex QModelIndex::child(int arow, int acolumn) const
|
|
inline QVariant QModelIndex::data(int arole) const
|
|
inline Qt::ItemFlags QModelIndex::flags() const
|
|
|
|
For Example when reimplementing QSortFilterProxyModel::data(const
|
|
QModelIndex &idx, int role):
|
|
|
|
Avoid:
|
|
idx.data(role);
|
|
|
|
Instead:
|
|
QModelIndex source_index = mapToSource(idx);
|
|
sourceModel()->data(idx, role);
|
|
|