![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qsortfilterproxymodelhelper_p.h>
Classes | |
| struct | Mapping |
Public Types | |
| enum | Direction { Rows = 0x01 , Columns = 0x02 , Both = Rows | Columns } |
| using | IndexMap = QHash<QtPrivate::QModelIndexWrapper, Mapping *> |
Public Member Functions | |
| QSortFilterProxyModelHelper () | |
| virtual | ~QSortFilterProxyModelHelper () |
| IndexMap::const_iterator | index_to_iterator (const QModelIndex &proxy_index) const |
| IndexMap::const_iterator | create_mapping (const QModelIndex &source_parent) const |
| IndexMap::const_iterator | create_mapping_recursive (const QModelIndex &source_parent) const |
| bool | can_create_mapping (const QModelIndex &source_parent) const |
| void | remove_from_mapping (const QModelIndex &source_parent) |
| void | clearSourceIndexMapping () |
| QModelIndex | source_to_proxy (const QModelIndex &source_index) const |
| void | build_source_to_proxy_mapping (QList< int > &proxy_to_source, QList< int > &source_to_proxy, int start=0) const |
| QModelIndex | proxy_to_source (const QModelIndex &proxy_index) const |
| void | updateChildrenMapping (const QModelIndex &source_parent, Mapping *parent_mapping, Direction direction, int start, int end, int delta_item_count, bool remove) |
| void | proxy_item_range (const QList< int > &source_to_proxy, const QList< int > &source_items, int &proxy_low, int &proxy_high) const |
| QModelIndexPairList | store_persistent_indexes () const |
| void | update_persistent_indexes (const QModelIndexPairList &source_indexes) |
| virtual void | filter_changed (Direction dir=Direction::Both, const QModelIndex &source_parent=QModelIndex()) |
| virtual QSet< int > | handle_filter_changed (QList< int > &source_to_proxy, QList< int > &proxy_to_source, const QModelIndex &source_parent, Direction direction) |
| virtual void | insert_source_items (QList< int > &source_to_proxy, QList< int > &proxy_to_source, const QList< int > &source_items, const QModelIndex &source_parent, Direction direction, bool emit_signal=true) |
| virtual void | source_items_inserted (const QModelIndex &source_parent, int start, int end, Direction direction) |
| virtual void | source_items_about_to_be_removed (const QModelIndex &source_parent, int start, int end, Direction direction) |
| virtual void | source_items_removed (const QModelIndex &source_parent, int start, int end, Direction direction) |
| virtual void | remove_source_items (QList< int > &source_to_proxy, QList< int > &proxy_to_source, const QList< int > &source_items, const QModelIndex &source_parent, Direction direction, bool emit_signal=true) |
| virtual void | remove_proxy_interval (QList< int > &source_to_proxy, QList< int > &proxy_to_source, int proxy_start, int proxy_end, const QModelIndex &proxy_parent, Direction direction, bool emit_signal=true) |
| virtual QList< std::pair< int, int > > | proxy_intervals_for_source_items (const QList< int > &source_to_proxy, const QList< int > &source_items) const |
| virtual QList< std::pair< int, QList< int > > > | proxy_intervals_for_source_items_to_add (const QList< int > &, const QList< int > &, const QModelIndex &, Direction) const |
| virtual void | sort () |
Static Public Member Functions | |
| static void | setProperties (QVariant *target, const QQmlSortFilterProxyModel *proxyModel, const QModelIndex &sourceIndex) |
| static QSet< int > | qListToSet (const QList< int > &vector) |
Public Attributes | |
| IndexMap | source_index_mapping |
Protected Member Functions | |
| virtual const QAbstractProxyModel * | proxyModel () const =0 |
| virtual void | beginInsertRows (const QModelIndex &, int, int) |
| virtual void | beginInsertColumns (const QModelIndex &, int, int) |
| virtual void | endInsertRows () |
| virtual void | endInsertColumns () |
| virtual void | beginRemoveRows (const QModelIndex &, int, int) |
| virtual void | beginRemoveColumns (const QModelIndex &, int, int) |
| virtual void | endRemoveRows () |
| virtual void | endRemoveColumns () |
| virtual void | beginResetModel () |
| virtual void | endResetModel () |
| virtual QModelIndex | createIndex (int, int, IndexMap::const_iterator) const |
| virtual void | changePersistentIndexList (const QModelIndexList &, const QModelIndexList &) |
| virtual bool | filterAcceptsRowInternal (int, const QModelIndex &) const |
| virtual bool | filterAcceptsRow (int, const QModelIndex &) const |
| virtual bool | filterAcceptsColumnInternal (int, const QModelIndex &) const |
| virtual bool | filterAcceptsColumn (int, const QModelIndex &) const |
| virtual void | sort_source_rows (QList< int > &, const QModelIndex &) const |
| virtual bool | lessThan (const QModelIndex &, const QModelIndex &) const |
Friends | |
| class | QQmlSortFilterProxyModelGreaterThan |
| class | QQmlSortFilterProxyModelLessThan |
Definition at line 32 of file qsortfilterproxymodelhelper_p.h.
Definition at line 60 of file qsortfilterproxymodelhelper_p.h.
| Enumerator | |
|---|---|
| Rows | |
| Columns | |
| Both | |
Definition at line 45 of file qsortfilterproxymodelhelper_p.h.
| QSortFilterProxyModelHelper::QSortFilterProxyModelHelper | ( | ) |
Definition at line 13 of file qsortfilterproxymodelhelper.cpp.
|
virtual |
Definition at line 18 of file qsortfilterproxymodelhelper.cpp.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 129 of file qsortfilterproxymodelhelper_p.h.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 128 of file qsortfilterproxymodelhelper_p.h.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 133 of file qsortfilterproxymodelhelper_p.h.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 132 of file qsortfilterproxymodelhelper_p.h.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 136 of file qsortfilterproxymodelhelper_p.h.
| void QSortFilterProxyModelHelper::build_source_to_proxy_mapping | ( | QList< int > & | proxy_to_source, |
| QList< int > & | source_to_proxy, | ||
| int | start = 0 ) const |
Definition at line 235 of file qsortfilterproxymodelhelper.cpp.
| bool QSortFilterProxyModelHelper::can_create_mapping | ( | const QModelIndex & | source_parent | ) | const |
Definition at line 245 of file qsortfilterproxymodelhelper.cpp.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 140 of file qsortfilterproxymodelhelper_p.h.
| void QSortFilterProxyModelHelper::clearSourceIndexMapping | ( | ) |
Definition at line 65 of file qsortfilterproxymodelhelper.cpp.
| IndexMap::const_iterator QSortFilterProxyModelHelper::create_mapping | ( | const QModelIndex & | source_parent | ) | const |
Definition at line 71 of file qsortfilterproxymodelhelper.cpp.
| QSortFilterProxyModelHelper::IndexMap::const_iterator QSortFilterProxyModelHelper::create_mapping_recursive | ( | const QModelIndex & | source_parent | ) | const |
Definition at line 118 of file qsortfilterproxymodelhelper.cpp.
|
inlineprotectedvirtual |
Definition at line 139 of file qsortfilterproxymodelhelper_p.h.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 131 of file qsortfilterproxymodelhelper_p.h.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 130 of file qsortfilterproxymodelhelper_p.h.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 135 of file qsortfilterproxymodelhelper_p.h.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 134 of file qsortfilterproxymodelhelper_p.h.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 137 of file qsortfilterproxymodelhelper_p.h.
|
virtual |
Definition at line 702 of file qsortfilterproxymodelhelper.cpp.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 144 of file qsortfilterproxymodelhelper_p.h.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 143 of file qsortfilterproxymodelhelper_p.h.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 142 of file qsortfilterproxymodelhelper_p.h.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 141 of file qsortfilterproxymodelhelper_p.h.
|
virtual |
Definition at line 661 of file qsortfilterproxymodelhelper.cpp.
|
inline |
Definition at line 65 of file qsortfilterproxymodelhelper_p.h.
|
virtual |
Given source-to-proxy mapping source_to_proxy and proxy-to-source mapping proxy_to_source, inserts the given source_items into this proxy model. The source items are inserted in intervals (based on some sorted order), so that the proper rows/columnsInserted(start, end) signals will be generated.
Definition at line 591 of file qsortfilterproxymodelhelper.cpp.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 146 of file qsortfilterproxymodelhelper_p.h.
|
virtual |
Given source-to-proxy mapping source_to_proxy and the set of source items source_items (which are part of that mapping), determines the corresponding proxy item intervals that should be removed from the proxy model.
The result is a vector of pairs, where each pair represents a (start, end) tuple, sorted in ascending order.
Definition at line 330 of file qsortfilterproxymodelhelper.cpp.
|
inlinevirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 120 of file qsortfilterproxymodelhelper_p.h.
| void QSortFilterProxyModelHelper::proxy_item_range | ( | const QList< int > & | source_to_proxy, |
| const QList< int > & | source_items, | ||
| int & | proxy_low, | ||
| int & | proxy_high ) const |
Definition at line 273 of file qsortfilterproxymodelhelper.cpp.
| QModelIndex QSortFilterProxyModelHelper::proxy_to_source | ( | const QModelIndex & | proxy_index | ) | const |
Definition at line 216 of file qsortfilterproxymodelhelper.cpp.
|
protectedpure virtual |
Implemented in QQmlSortFilterProxyModelPrivate.
Definition at line 63 of file qsortfilterproxymodelhelper_p.h.
| void QSortFilterProxyModelHelper::remove_from_mapping | ( | const QModelIndex & | source_parent | ) |
Definition at line 264 of file qsortfilterproxymodelhelper.cpp.
|
virtual |
Given source-to-proxy mapping source_to_proxy and proxy-to-source mapping proxy_to_source, removes items from proxy_start to proxy_end (inclusive) from this proxy model.
Definition at line 373 of file qsortfilterproxymodelhelper.cpp.
|
virtual |
Given source-to-proxy mapping src_to_proxy and proxy-to-source mapping proxy_to_source, removes source_items from this proxy model. The corresponding proxy items are removed in intervals, so that the proper rows/columnsRemoved(start, end) signals will be generated.
Definition at line 639 of file qsortfilterproxymodelhelper.cpp.
|
static |
Definition at line 38 of file qsortfilterproxymodelhelper.cpp.
|
virtual |
Sorts the existing mappings.
Definition at line 745 of file qsortfilterproxymodelhelper.cpp.
|
inlineprotectedvirtual |
Reimplemented in QQmlSortFilterProxyModelPrivate.
Definition at line 145 of file qsortfilterproxymodelhelper_p.h.
|
virtual |
Handles source model items removal (columnsAboutToBeRemoved(), rowsAboutToBeRemoved()).
Definition at line 505 of file qsortfilterproxymodelhelper.cpp.
|
virtual |
Handles source model items insertion (columnsInserted(), rowsInserted()). Determines 1) which of the inserted items to also insert into proxy model (filtering), 2) where to insert the items into the proxy model (sorting), then inserts those items. The items are inserted into the proxy model in intervals (based on sorted order), so that the proper rows/columnsInserted(start, end) signals will be generated.
Definition at line 408 of file qsortfilterproxymodelhelper.cpp.
|
virtual |
Handles source model items removal (columnsRemoved(), rowsRemoved()).
Definition at line 538 of file qsortfilterproxymodelhelper.cpp.
| QModelIndex QSortFilterProxyModelHelper::source_to_proxy | ( | const QModelIndex & | source_index | ) | const |
Definition at line 195 of file qsortfilterproxymodelhelper.cpp.
| QModelIndexPairList QSortFilterProxyModelHelper::store_persistent_indexes | ( | ) | const |
Definition at line 289 of file qsortfilterproxymodelhelper.cpp.
| void QSortFilterProxyModelHelper::update_persistent_indexes | ( | const QModelIndexPairList & | source_indexes | ) |
Definition at line 302 of file qsortfilterproxymodelhelper.cpp.
| void QSortFilterProxyModelHelper::updateChildrenMapping | ( | const QModelIndex & | source_parent, |
| Mapping * | parent_mapping, | ||
| Direction | direction, | ||
| int | start, | ||
| int | end, | ||
| int | delta_item_count, | ||
| bool | remove ) |
updates the mapping of the children when inserting or removing items
Definition at line 146 of file qsortfilterproxymodelhelper.cpp.
|
friend |
Definition at line 34 of file qsortfilterproxymodelhelper_p.h.
|
friend |
Definition at line 35 of file qsortfilterproxymodelhelper_p.h.
|
mutable |
Definition at line 61 of file qsortfilterproxymodelhelper_p.h.