#include <kis_categorized_list_model.h>
template<class TModel>
class KisSortedCategorizedListModel< TModel >
Definition at line 199 of file kis_categorized_list_model.h.
◆ Entry_Type
◆ KisSortedCategorizedListModel()
◆ entryAt()
◆ indexOf()
We don't use the source model's indexOf(), because the items might be duplicated and we need to return the topmost one in the sorted order.
Definition at line 210 of file kis_categorized_list_model.h.
210 {
218
219 for (int i = 0; i < rowCount(); i++) {
220 QModelIndex index = this->index(i, 0);
221
222 if (
entryAt(e, index) && e == entry) {
223 return index;
224 }
225 }
226
227 return QModelIndex();
228 }
bool entryAt(Entry_Type &entry, QModelIndex index) const
TModel::Entry_Type Entry_Type
◆ initializeModel()
◆ lessThanPriority()
template<class TModel >
| bool KisSortedCategorizedListModel< TModel >::lessThanPriority |
( |
const QModelIndex & | left, |
|
|
const QModelIndex & | right, |
|
|
const QString & | priorityCategory ) const |
|
inlineprotected |
Definition at line 242 of file kis_categorized_list_model.h.
244 {
245
246 QString leftKey = sourceModel()->data(left, sortRole()).toString();
247 QString rightKey = sourceModel()->data(right, sortRole()).toString();
248
249 bool leftIsSpecial = leftKey.startsWith(priorityCategory);
250 bool rightIsSpecial = rightKey.startsWith(priorityCategory);
251
252 return leftIsSpecial != rightIsSpecial ?
253 leftIsSpecial : leftKey < rightKey;
254 }
◆ m_model
The documentation for this class was generated from the following file: