10#include <private/qabstractitemmodel_p.h>
11#include <private/qabstractproxymodel_p.h>
12#include <private/qproperty_p.h>
40 : sort_column(
column), source_parent(parent), source_model(
source), proxy_model(
proxy) {}
46 return proxy_model->
lessThan(i1, i2);
62 : sort_column(
column), source_parent(parent),
69 return proxy_model->
lessThan(i2, i1);
96 if (parent == parent_source)
133 q_func()->setSortCaseSensitivity(cs);
137 emit q_func()->sortCaseSensitivityChanged(cs);
153 q_func()->setRecursiveFilteringEnabled(recursive);
157 emit q_func()->recursiveFilteringEnabledChanged(recursive);
163 emit q_func()->autoAcceptChildRowsChanged(accept);
170 q_func()->setFilterCaseSensitivity(cs);
174 emit q_func()->filterCaseSensitivityChanged(cs);
179 q_func()->setFilterRegularExpression(re);
261 re.setPatternOptions(cs);
272 Q_ASSERT(proxy_index.model() == q_func());
273 const void *
p = proxy_index.internalPointer();
290 const QList<int> &roles);
308 int sourceStart,
int sourceEnd,
311 int sourceStart,
int sourceEnd,
322 int sourceStart,
int sourceEnd,
325 int sourceStart,
int sourceEnd,
339 const QList<int> &
source_to_proxy,
const QList<int> &source_items)
const;
342 const QList<int> &source_items,
const QModelIndex &source_parent,
346 const QList<int> &source_items,
const QModelIndex &source_parent,
350 int proxy_start,
int proxy_end,
const QModelIndex &proxy_parent,
362 int &proxy_low,
int &proxy_high)
const;
385typedef QHash<QModelIndex, QSortFilterProxyModelPrivate::Mapping *>
IndexMap;
389 return int(
a) & int(
b);
394 QAbstractProxyModelPrivate::_q_sourceModelDestroyed();
403 if (
q->filterAcceptsRow(source_row, source_parent))
424 if (
q->filterAcceptsRow(source_parent.
row(),
index))
441 if (
q->filterAcceptsRow(
i,
index))
454 for (
const QModelIndex &mappedIdx : std::as_const(
m->mapped_children))
486 m->source_rows.reserve(source_rows);
487 for (
int i = 0;
i < source_rows; ++
i) {
489 m->source_rows.append(
i);
492 m->source_columns.reserve(source_cols);
493 for (
int i = 0;
i < source_cols; ++
i) {
494 if (
q->filterAcceptsColumn(
i, source_parent))
495 m->source_columns.append(
i);
499 m->proxy_rows.resize(source_rows);
501 m->proxy_columns.resize(source_cols);
504 m->source_parent = source_parent;
510 it2.value()->mapped_children.append(source_parent);
534 if (gm->proxy_rows.at(source_parent.
row()) == -1 ||
535 gm->proxy_columns.at(source_parent.
column()) == -1) {
545 if (!proxy_index.isValid())
547 if (proxy_index.model() != q_func()) {
548 qWarning(
"QSortFilterProxyModel: index from wrong model passed to mapToSource");
549 Q_ASSERT(!
"QSortFilterProxyModel: index from wrong model passed to mapToSource");
554 if ((proxy_index.row() >=
m->source_rows.size()) || (proxy_index.column() >=
m->source_columns.size()))
556 int source_row =
m->source_rows.at(proxy_index.row());
557 int source_col =
m->source_columns.at(proxy_index.column());
563 if (!source_index.isValid())
565 if (source_index.model() !=
model) {
566 qWarning(
"QSortFilterProxyModel: index from wrong model passed to mapFromSource");
567 Q_ASSERT(!
"QSortFilterProxyModel: index from wrong model passed to mapFromSource");
573 if ((source_index.row() >=
m->proxy_rows.size()) || (source_index.column() >=
m->proxy_columns.size()))
575 int proxy_row =
m->proxy_rows.at(source_index.row());
576 int proxy_column =
m->proxy_columns.at(source_index.column());
577 if (proxy_row == -1 || proxy_column == -1)
592 if (gm->proxy_rows.at(source_parent.
row()) == -1 ||
593 gm->proxy_columns.at(source_parent.
column()) == -1) {
639 if (proxy_sort_column < m->source_columns.size())
661 int accepted_columns = -1;
664 for (
int i = 0;
i < source_cols; ++
i) {
665 if (
q->filterAcceptsColumn(
i, rootIndex)) {
680 QList<int> &source_rows,
const QModelIndex &source_parent)
const
686 std::stable_sort(source_rows.begin(), source_rows.end(), lt);
689 std::stable_sort(source_rows.begin(), source_rows.end(), gt);
692 std::stable_sort(source_rows.begin(), source_rows.end(), std::less{});
694 std::stable_sort(source_rows.begin(), source_rows.end(), std::greater{});
710 const QList<int> &source_to_proxy,
const QList<int> &source_items)
const
712 QList<std::pair<int, int>> proxy_intervals;
713 if (source_items.isEmpty())
714 return proxy_intervals;
716 int source_items_index = 0;
717 while (source_items_index < source_items.size()) {
718 int first_proxy_item =
source_to_proxy.at(source_items.at(source_items_index));
720 int last_proxy_item = first_proxy_item;
721 ++source_items_index;
723 while ((source_items_index < source_items.size())
724 && (
source_to_proxy.at(source_items.at(source_items_index)) == last_proxy_item + 1)) {
726 ++source_items_index;
729 proxy_intervals.emplace_back(first_proxy_item, last_proxy_item);
731 std::stable_sort(proxy_intervals.begin(), proxy_intervals.end());
733 for (
int i = proxy_intervals.size()-1;
i > 0; --
i) {
734 std::pair<int, int> &interval = proxy_intervals[
i];
735 std::pair<int, int> &preceeding_interval = proxy_intervals[
i - 1];
736 if (interval.first == preceeding_interval.second + 1) {
737 preceeding_interval.second = interval.second;
738 interval.first = interval.second = -1;
741 proxy_intervals.removeIf([](std::pair<int, int> interval) {
return interval.first < 0; });
742 return proxy_intervals;
754 QList<int> &source_to_proxy, QList<int> &proxy_to_source,
755 const QList<int> &source_items,
const QModelIndex &source_parent,
759 QModelIndex proxy_parent =
q->mapFromSource(source_parent);
760 if (!proxy_parent.isValid() && source_parent.
isValid()) {
768 const auto end = proxy_intervals.rend();
769 for (
auto it = proxy_intervals.rbegin();
it !=
end; ++
it) {
770 const std::pair<int, int> &interval = *
it;
771 const int proxy_start = interval.first;
772 const int proxy_end = interval.second;
774 proxy_parent, orient, emit_signal);
786 QList<int> &source_to_proxy, QList<int> &proxy_to_source,
int proxy_start,
int proxy_end,
792 q->beginRemoveRows(proxy_parent, proxy_start, proxy_end);
794 q->beginRemoveColumns(proxy_parent, proxy_start, proxy_end);
798 for (
int i = proxy_start;
i <= proxy_end; ++
i)
808 q->endRemoveColumns();
825 const QList<int> &proxy_to_source,
const QList<int> &source_items,
829 QList<std::pair<int, QList<int>>> proxy_intervals;
830 if (source_items.isEmpty())
831 return proxy_intervals;
835 int source_items_index = 0;
837 while (source_items_index < source_items.size()) {
838 QList<int> source_items_in_interval;
839 int first_new_source_item = source_items.at(source_items_index);
840 source_items_in_interval.append(first_new_source_item);
841 ++source_items_index;
846 while (proxy_low <= proxy_high) {
847 proxy_item = (proxy_low + proxy_high) / 2;
851 proxy_high = proxy_item - 1;
853 proxy_low = proxy_item + 1;
856 proxy_high = proxy_item - 1;
858 proxy_low = proxy_item + 1;
861 proxy_item = proxy_low;
865 for ( ; source_items_index < source_items.size(); ++source_items_index)
866 source_items_in_interval.append(source_items.at(source_items_index));
869 for ( ; source_items_index < source_items.size(); ++source_items_index) {
870 int new_source_item = source_items.at(source_items_index);
879 source_items_in_interval.append(new_source_item);
884 proxy_intervals.emplace_back(proxy_item, std::move(source_items_in_interval));
886 return proxy_intervals;
898 QList<int> &source_to_proxy, QList<int> &proxy_to_source,
899 const QList<int> &source_items,
const QModelIndex &source_parent,
903 QModelIndex proxy_parent =
q->mapFromSource(source_parent);
904 if (!proxy_parent.isValid() && source_parent.
isValid())
910 const auto end = proxy_intervals.rend();
911 for (
auto it = proxy_intervals.rbegin();
it !=
end; ++
it) {
912 const std::pair<int, QList<int>> &interval = *
it;
913 const int proxy_start = interval.first;
914 const QList<int> &source_items = interval.second;
915 const int proxy_end = proxy_start + source_items.
size() - 1;
919 q->beginInsertRows(proxy_parent, proxy_start, proxy_end);
921 q->beginInsertColumns(proxy_parent, proxy_start, proxy_end);
926 std::copy(source_items.cbegin(), source_items.cend(),
proxy_to_source.begin() + proxy_start);
934 q->endInsertColumns();
963 QModelIndex proxy_parent =
q->mapFromSource(source_parent);
964 if (
m->source_rows.size() > 0) {
965 q->beginInsertRows(proxy_parent, 0,
m->source_rows.size() - 1);
968 if (
m->source_columns.size() > 0) {
969 q->beginInsertColumns(proxy_parent, 0,
m->source_columns.size() - 1);
970 q->endInsertColumns();
979 int delta_item_count =
end -
start + 1;
986 qWarning(
"QSortFilterProxyModel: invalid inserted rows reported by source model");
992 if (
start < old_item_count) {
995 for (
int proxy_item = 0; proxy_item < proxy_count; ++proxy_item) {
997 if (source_item >=
start)
1004 QList<int> source_items;
1008 :
q->filterAcceptsColumn(
i, source_parent)) {
1009 source_items.append(
i);
1018 QList<int> &orthogonal_proxy_to_source = (orient ==
Qt::Horizontal) ?
m->source_rows :
m->source_columns;
1019 QList<int> &orthogonal_source_to_proxy = (orient ==
Qt::Horizontal) ?
m->proxy_rows :
m->proxy_columns;
1021 if (orthogonal_source_to_proxy.isEmpty()) {
1024 orthogonal_source_to_proxy.resize(ortho_end);
1026 for (
int ortho_item = 0; ortho_item < ortho_end; ++ortho_item) {
1028 :
q->filterAcceptsColumn(ortho_item, source_parent)) {
1029 orthogonal_proxy_to_source.append(ortho_item);
1068 QList<int> source_items_to_remove;
1070 for (
int proxy_item = 0; proxy_item < proxy_count; ++proxy_item) {
1072 if ((source_item >=
start) && (source_item <=
end))
1073 source_items_to_remove.append(source_item);
1077 source_parent, orient);
1104 int delta_item_count =
end -
start + 1;
1110 qWarning(
"QSortFilterProxyModel: inconsistent changes reported by source model");
1112 q->beginResetModel();
1119 for (
int proxy_item = 0; proxy_item < proxy_count; ++proxy_item) {
1121 if (source_item >=
start) {
1122 Q_ASSERT(source_item - delta_item_count >= 0);
1141 QList<std::pair<QModelIndex, Mapping *>> moved_source_index_mappings;
1142 auto it2 = parent_mapping->mapped_children.begin();
1143 for ( ; it2 != parent_mapping->mapped_children.end();) {
1146 ? source_child_index.
row()
1147 : source_child_index.column();
1153 it2 = parent_mapping->mapped_children.erase(it2);
1158 const int newpos =
remove ?
pos - delta_item_count :
pos + delta_item_count;
1161 source_child_index.column(),
1164 new_index =
model->
index(source_child_index.row(),
1175 moved_source_index_mappings.emplace_back(new_index, cm);
1180 for (
auto &pair : std::as_const(moved_source_index_mappings)) {
1181 pair.second->source_parent = pair.first;
1190 const QList<int> &source_to_proxy,
const QList<int> &source_items,
1191 int &proxy_low,
int &proxy_high)
const
1193 proxy_low = INT_MAX;
1194 proxy_high = INT_MIN;
1195 for (
int i = 0;
i < source_items.size(); ++
i) {
1198 if (proxy_item < proxy_low)
1199 proxy_low = proxy_item;
1200 if (proxy_item > proxy_high)
1201 proxy_high = proxy_item;
1209 const QList<int> &proxy_to_source, QList<int> &source_to_proxy,
int start)
1214 for (
int i =
start;
i < proxy_count; ++
i)
1231 QModelIndex source_index =
q->mapToSource(proxy_index);
1232 source_indexes.emplace_back(proxy_index, source_index);
1234 return source_indexes;
1248 const int numSourceIndexes = source_indexes.
size();
1249 from.
reserve(numSourceIndexes);
1251 for (
const auto &indexPair : source_indexes) {
1253 const QModelIndex &old_proxy_index = indexPair.first;
1255 QModelIndex proxy_index =
q->mapFromSource(source_index);
1256 from << old_proxy_index;
1259 q->changePersistentIndexList(from, to);
1296 const QList<QModelIndex> mappedChildren =
m->mapped_children;
1297 QList<int> indexesToRemove;
1298 for (
int i = 0;
i < mappedChildren.size(); ++
i) {
1299 const QModelIndex &source_child_index = mappedChildren.at(
i);
1300 if (rows_removed.contains(source_child_index.row()) || columns_removed.contains(source_child_index.column())) {
1301 indexesToRemove.push_back(
i);
1315 while (removeIt != removeBegin) {
1317 m->mapped_children.remove(*removeIt);
1326 QList<int> &source_to_proxy, QList<int> &proxy_to_source,
1331 QList<int> source_items_remove;
1336 : !
q->filterAcceptsColumn(source_item, source_parent)) {
1338 source_items_remove.append(source_item);
1342 QList<int> source_items_insert;
1344 for (
int source_item = 0; source_item < source_count; ++source_item) {
1348 :
q->filterAcceptsColumn(source_item, source_parent)) {
1350 source_items_insert.append(source_item);
1354 if (!source_items_remove.isEmpty() || !source_items_insert.isEmpty()) {
1357 source_items_remove, source_parent, orient);
1361 source_items_insert, source_parent, orient);
1372 return std::any_of(source_rows.begin(), source_rows.end(),
1373 [
this,
q, proxyRowCount, source_parent](
int sourceRow) ->
bool {
1374 const QModelIndex sourceIndex = model->index(sourceRow, source_sort_column, source_parent);
1375 const QModelIndex proxyIndex = source_to_proxy(sourceIndex);
1376 Q_ASSERT(proxyIndex.isValid());
1377 if (proxyIndex.row() > 0) {
1378 const QModelIndex prevProxyIndex = q->sibling(proxyIndex.row() - 1, proxy_sort_column, proxyIndex);
1379 const QModelIndex prevSourceIndex = proxy_to_source(prevProxyIndex);
1380 if (sort_order == Qt::AscendingOrder ? q->lessThan(sourceIndex, prevSourceIndex) : q->lessThan(prevSourceIndex, sourceIndex))
1383 if (proxyIndex.row() < proxyRowCount - 1) {
1384 const QModelIndex nextProxyIndex = q->sibling(proxyIndex.row() + 1, proxy_sort_column, proxyIndex);
1385 const QModelIndex nextSourceIndex = proxy_to_source(nextProxyIndex);
1386 if (sort_order == Qt::AscendingOrder ? q->lessThan(nextSourceIndex, sourceIndex) : q->lessThan(sourceIndex, nextSourceIndex))
1395 const QList<int> &roles)
1398 if (!source_top_left.isValid() || !source_bottom_right.isValid())
1401 std::vector<QSortFilterProxyModelDataChanged> data_changed_list;
1402 data_changed_list.emplace_back(source_top_left, source_bottom_right);
1408 while (source_parent.
isValid()) {
1409 data_changed_list.emplace_back(source_parent, source_parent);
1410 source_parent = source_parent.
parent();
1415 const QModelIndex &source_top_left = data_changed.topLeft;
1416 const QModelIndex &source_bottom_right = data_changed.bottomRight;
1419 bool change_in_unmapped_parent =
false;
1430 change_in_unmapped_parent =
true;
1436 QList<int> source_rows_remove;
1437 QList<int> source_rows_insert;
1438 QList<int> source_rows_change;
1439 QList<int> source_rows_resort;
1440 int end =
qMin(source_bottom_right.row(),
m->proxy_rows.size() - 1);
1441 for (
int source_row = source_top_left.row(); source_row <=
end; ++source_row) {
1443 if (
m->proxy_rows.at(source_row) != -1) {
1446 source_rows_remove.append(source_row);
1449 source_rows_resort.append(source_row);
1452 source_rows_change.append(source_row);
1457 source_rows_insert.append(source_row);
1461 if (
m->proxy_rows.at(source_row) != -1)
1462 source_rows_change.append(source_row);
1466 if (!source_rows_remove.isEmpty()) {
1469 QSet<int> source_rows_remove_set =
qListToSet(source_rows_remove);
1471 while (childIt !=
m->mapped_children.begin()) {
1474 if (source_rows_remove_set.contains(source_child_index.row())) {
1475 childIt =
m->mapped_children.erase(childIt);
1481 if (!source_rows_resort.isEmpty()) {
1484 QList<QPersistentModelIndex> parents;
1485 parents <<
q->mapFromSource(source_parent);
1497 source_rows_change += source_rows_resort;
1500 if (!source_rows_change.isEmpty()) {
1502 int proxy_start_row;
1505 proxy_start_row, proxy_end_row);
1507 if (proxy_end_row >= 0) {
1509 int source_left_column = source_top_left.column();
1510 while (source_left_column < source_bottom_right.column()
1511 &&
m->proxy_columns.at(source_left_column) == -1)
1512 ++source_left_column;
1513 if (
m->proxy_columns.at(source_left_column) != -1) {
1515 proxy_start_row,
m->proxy_columns.at(source_left_column),
it);
1516 int source_right_column = source_bottom_right.column();
1517 while (source_right_column > source_top_left.column()
1518 &&
m->proxy_columns.at(source_right_column) == -1)
1519 --source_right_column;
1520 if (
m->proxy_columns.at(source_right_column) != -1) {
1522 proxy_end_row,
m->proxy_columns.at(source_right_column),
it);
1523 emit q->dataChanged(proxy_top_left, proxy_bottom_right, roles);
1529 if (!source_rows_insert.isEmpty()) {
1547 QList<int> proxy_positions;
1548 proxy_positions.reserve(
end -
start + 1);
1553 for ( ;
it != endIt; ++
it) {
1555 proxy_positions.push_back(*
it);
1559 std::sort(proxy_positions.begin(), proxy_positions.end());
1562 const int numItems = proxy_positions.size();
1563 while (last_index < numItems) {
1564 const int proxyStart = proxy_positions.at(last_index);
1565 int proxyEnd = proxyStart;
1567 for (
int i = last_index;
i < numItems; ++
i) {
1568 if (proxy_positions.at(
i) == proxyEnd + 1) {
1575 emit q->headerDataChanged(orientation, proxyStart, proxyEnd);
1582 q->beginResetModel();
1610 if (mappedParent.isValid())
1654 const bool toplevel = !source_parent.
isValid();
1670 top_source_parent =
parent;
1692 bool accept =
false;
1732 while (source_ascendant.isValid()) {
1736 to_hide = source_ascendant;
1737 source_ascendant = source_ascendant.
parent();
1740 if (to_hide.isValid())
1754 QList<QPersistentModelIndex> parents;
1755 parents << sourceParent;
1756 if (sourceParent != destParent)
1757 parents << destParent;
1764 QList<QPersistentModelIndex> parents;
1765 parents << sourceParent;
1766 if (sourceParent != destParent)
1767 parents << destParent;
1833 QList<QPersistentModelIndex> parents;
1834 parents << sourceParent;
1835 if (sourceParent != destParent)
1836 parents << destParent;
1843 QList<QPersistentModelIndex> parents;
1844 parents << sourceParent;
1845 if (sourceParent != destParent)
1846 parents << destParent;
2023 d->source_index_mapping.clear();
2044 d->invalidatePersistentIndexes();
2045 d->_q_clearMapping();
2049 d->sourceConnections = std::array<QMetaObject::Connection, 18>{
2105 if (
d->update_source_sort_column() &&
d->dynamic_sortfilter)
2132 if (!
d->indexValid(
child))
2138 return proxy_parent;
2147 if (!
d->indexValid(idx))
2167 return it.value()->source_rows.
size();
2180 return it.value()->source_columns.
size();
2192 if (!
d->model->hasChildren(source_parent))
2195 if (
d->model->canFetchMore(source_parent))
2209 if (
index.isValid() && !source_index.isValid())
2211 return d->model->data(source_index, role);
2221 if (
index.isValid() && !source_index.isValid())
2223 return d->model->setData(source_index,
value, role);
2233 if (
it.value()->source_rows.
size() *
it.value()->source_columns.
size() > 0)
2237 if (section < 0 || section >=
it.value()->source_rows.
size())
2239 source_section =
it.value()->source_rows.at(section);
2241 if (section < 0 || section >=
it.value()->source_columns.
size())
2243 source_section =
it.value()->source_columns.at(section);
2245 return d->model->headerData(source_section, orientation, role);
2256 if (
it.value()->source_rows.
size() *
it.value()->source_columns.
size() > 0)
2260 if (section < 0 || section >=
it.value()->source_rows.
size())
2262 source_section =
it.value()->source_rows.at(section);
2264 if (section < 0 || section >=
it.value()->source_columns.
size())
2266 source_section =
it.value()->source_columns.at(section);
2268 return d->model->setHeaderData(source_section, orientation,
value, role);
2281 return d->
model->mimeData(source_indexes);
2290 return d->model->mimeTypes();
2299 return d->model->supportedDropActions();
2324 if (
row >
m->source_rows.size())
2326 int source_row = (
row >=
m->source_rows.size()
2327 ?
m->proxy_rows.size()
2328 :
m->source_rows.at(
row));
2329 return d->model->insertRows(source_row,
count, source_parent);
2344 if (
column >
m->source_columns.size())
2346 int source_column = (
column >=
m->source_columns.size()
2347 ?
m->proxy_columns.size()
2348 :
m->source_columns.at(
column));
2349 return d->model->insertColumns(source_column,
count, source_parent);
2364 if (
row +
count >
m->source_rows.size())
2367 || ((
d->source_sort_column < 0) && (
m->proxy_rows.size() ==
m->source_rows.size()))) {
2369 return d->model->removeRows(source_row,
count, source_parent);
2374 rows.reserve(
count);
2376 rows.append(
m->source_rows.at(
i));
2377 std::sort(rows.begin(), rows.end());
2379 int pos = rows.size() - 1;
2382 const int source_end = rows.at(
pos--);
2383 int source_start = source_end;
2384 while ((
pos >= 0) && (rows.at(
pos) == (source_start - 1))) {
2388 ok =
ok &&
d->model->removeRows(source_start, source_end - source_start + 1,
2408 if ((
count == 1) || (
m->proxy_columns.size() ==
m->source_columns.size())) {
2410 return d->model->removeColumns(source_column,
count, source_parent);
2414 columns.reserve(
count);
2416 columns.append(
m->source_columns.at(
i));
2418 int pos = columns.size() - 1;
2421 const int source_end = columns.at(
pos--);
2422 int source_start = source_end;
2423 while ((
pos >= 0) && (columns.at(
pos) == (source_start - 1))) {
2427 ok =
ok &&
d->model->removeColumns(source_start, source_end - source_start + 1,
2463 if (!
d->indexValid(
index))
2467 if (source_index == source_buddy)
2477 Qt::MatchFlags
flags)
const
2489 if (
index.isValid() && !source_index.isValid())
2491 return d->model->span(source_index);
2503 if (
d->dynamic_sortfilter &&
d->proxy_sort_column ==
column &&
d->sort_order ==
order)
2506 d->proxy_sort_column =
column;
2507 d->update_source_sort_column();
2523 return d->proxy_sort_column;
2538 return d->sort_order;
2564 return d->filter_regularexpression;
2570 return QBindable<QRegularExpression>(&
d->filter_regularexpression);
2577 const bool regExpChanged =
2578 regularExpression !=
d->filter_regularexpression.valueBypassingBindings();
2579 d->filter_regularexpression.removeBindingUnlessInWrapper();
2580 d->filter_casesensitive.removeBindingUnlessInWrapper();
2582 d->filter_about_to_be_changed();
2586 d->filter_regularexpression.setValueBypassingBindings(regularExpression);
2587 if (cs != updatedCs)
2588 d->filter_casesensitive.setValueBypassingBindings(updatedCs);
2593 d->filter_regularexpression.notify();
2594 if (cs != updatedCs)
2595 d->filter_casesensitive.notify();
2609 return d->filter_column;
2620 d->filter_column.removeBindingUnlessInWrapper();
2621 d->filter_about_to_be_changed();
2622 const auto oldColumn =
d->filter_column.valueBypassingBindings();
2623 d->filter_column.setValueBypassingBindings(
column);
2626 d->filter_column.notify();
2632 return QBindable<int>(&
d->filter_column);
2660 return d->filter_casesensitive;
2666 d->filter_casesensitive.removeBindingUnlessInWrapper();
2667 d->filter_regularexpression.removeBindingUnlessInWrapper();
2668 if (cs ==
d->filter_casesensitive)
2672 QRegularExpression::PatternOptions options =
2673 d->filter_regularexpression.value().patternOptions();
2675 d->filter_casesensitive.setValueBypassingBindings(cs);
2677 d->filter_about_to_be_changed();
2680 d->filter_regularexpression.setValueBypassingBindings(re);
2682 d->filter_regularexpression.notify();
2683 d->filter_casesensitive.notify();
2689 return QBindable<Qt::CaseSensitivity>(&
d->filter_casesensitive);
2711 return d->sort_casesensitivity;
2717 d->sort_casesensitivity.removeBindingUnlessInWrapper();
2718 if (
d->sort_casesensitivity == cs)
2721 d->sort_casesensitivity.setValueBypassingBindings(cs);
2723 d->sort_casesensitivity.notify();
2729 return QBindable<Qt::CaseSensitivity>(&
d->sort_casesensitivity);
2751 return d->sort_localeaware;
2757 d->sort_localeaware.removeBindingUnlessInWrapper();
2758 if (
d->sort_localeaware == on)
2761 d->sort_localeaware.setValueBypassingBindings(on);
2763 d->sort_localeaware.notify();
2769 return QBindable<bool>(&
d->sort_localeaware);
2793 d->filter_regularexpression.removeBindingUnlessInWrapper();
2794 d->filter_about_to_be_changed();
2797 d->filter_regularexpression.notify();
2816 d->filter_regularexpression.removeBindingUnlessInWrapper();
2817 d->filter_about_to_be_changed();
2821 d->filter_regularexpression.notify();
2840 d->filter_regularexpression.removeBindingUnlessInWrapper();
2841 d->filter_about_to_be_changed();
2844 d->filter_regularexpression.notify();
2868 return d->dynamic_sortfilter;
2879 d->dynamic_sortfilter.removeBindingUnlessInWrapper();
2880 const bool valueChanged =
d->dynamic_sortfilter.value() !=
enable;
2881 d->dynamic_sortfilter.setValueBypassingBindings(
enable);
2885 d->dynamic_sortfilter.notify();
2891 return QBindable<bool>(&
d->dynamic_sortfilter);
2913 return d->sort_role;
2919 d->sort_role.removeBindingUnlessInWrapper();
2920 if (
d->sort_role.valueBypassingBindings() == role)
2922 d->sort_role.setValueBypassingBindings(role);
2924 d->sort_role.notify();
2930 return QBindable<int>(&
d->sort_role);
2952 return d->filter_role;
2958 d->filter_role.removeBindingUnlessInWrapper();
2959 if (
d->filter_role.valueBypassingBindings() == role)
2961 d->filter_about_to_be_changed();
2962 d->filter_role.setValueBypassingBindings(role);
2964 d->filter_role.notify();
2970 return QBindable<int>(&
d->filter_role);
2994 return d->filter_recursive;
3000 d->filter_recursive.removeBindingUnlessInWrapper();
3001 if (
d->filter_recursive == recursive)
3003 d->filter_about_to_be_changed();
3004 d->filter_recursive.setValueBypassingBindings(recursive);
3006 d->filter_recursive.notify();
3012 return QBindable<bool>(&
d->filter_recursive);
3038 return d->accept_children;
3044 d->accept_children.removeBindingUnlessInWrapper();
3045 if (
d->accept_children == accept)
3048 d->filter_about_to_be_changed();
3049 d->accept_children.setValueBypassingBindings(accept);
3051 d->accept_children.notify();
3057 return QBindable<bool>(&
d->accept_children);
3071 d->_q_clearMapping();
3177 QVariant l = (source_left.model() ? source_left.model()->data(source_left,
d->sort_role) :
QVariant());
3178 QVariant r = (source_right.model() ? source_right.model()->data(source_right,
d->sort_role) :
QVariant());
3200 if (
d->filter_regularexpression.value().pattern().isEmpty())
3203 int column_count =
d->model->columnCount(source_parent);
3204 if (
d->filter_column == -1) {
3208 if (
key.contains(
d->filter_regularexpression.value()))
3214 if (
d->filter_column >= column_count)
3216 QModelIndex source_index =
d->
model->index(source_row,
d->filter_column, source_parent);
3218 return key.contains(
d->filter_regularexpression.value());
3246 return d->proxy_to_source(proxyIndex);
3258 return d->source_to_proxy(sourceIndex);
3279#include "moc_qsortfilterproxymodel.cpp"
void invalidatePersistentIndexes()
struct QAbstractItemModelPrivate::Persistent persistent
static bool isVariantLessThan(const QVariant &left, const QVariant &right, Qt::CaseSensitivity cs=Qt::CaseSensitive, bool isLocaleAware=false)
void rowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow, QPrivateSignal)
void endResetModel()
Completes a model reset operation.
void modelAboutToBeReset(QPrivateSignal)
virtual Q_INVOKABLE QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const
Returns a list of indexes for the items in the column of the start index where data stored under the ...
void columnsRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after columns have been removed from the model.
LayoutChangeHint
This enum describes the way the model changes layout.
void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before rows are inserted into the model.
void columnsAboutToBeInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before columns are inserted into the model.
void modelReset(QPrivateSignal)
Q_INVOKABLE Qt::SortOrder order
void layoutAboutToBeChanged(const QList< QPersistentModelIndex > &parents=QList< QPersistentModelIndex >(), QAbstractItemModel::LayoutChangeHint hint=QAbstractItemModel::NoLayoutChangeHint)
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles=QList< int >())
This signal is emitted whenever the data in an existing item changes.
void columnsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn, QPrivateSignal)
void columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before columns are removed from the model.
void layoutChanged(const QList< QPersistentModelIndex > &parents=QList< QPersistentModelIndex >(), QAbstractItemModel::LayoutChangeHint hint=QAbstractItemModel::NoLayoutChangeHint)
void headerDataChanged(Qt::Orientation orientation, int first, int last)
This signal is emitted whenever a header is changed.
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before rows are removed from the model.
void beginResetModel()
Begins a model reset operation.
void rowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow, QPrivateSignal)
void rowsInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after rows have been inserted into the model.
void columnsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn, QPrivateSignal)
void columnsInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after columns have been inserted into the model.
virtual Q_INVOKABLE QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index.
void rowsRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after rows have been removed from the model.
The QAbstractProxyModel class provides a base class for proxy item models that can do sorting,...
void fetchMore(const QModelIndex &parent) override
\reimp
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
\reimp
virtual Q_INVOKABLE QItemSelection mapSelectionFromSource(const QItemSelection &selection) const
Returns a proxy selection mapped from the specified sourceSelection.
Qt::ItemFlags flags(const QModelIndex &index) const override
\reimp
bool canFetchMore(const QModelIndex &parent) const override
\reimp
QAbstractItemModel * sourceModel
the source model of this proxy model.
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
\reimp
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole) override
\reimp
virtual Q_INVOKABLE QItemSelection mapSelectionToSource(const QItemSelection &selection) const
Returns a source selection mapped from the specified proxySelection.
virtual void setSourceModel(QAbstractItemModel *sourceModel)
Sets the given sourceModel to be processed by the proxy model.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Returns the index of the data in row and column with parent.
friend class const_iterator
qsizetype size() const noexcept
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
constexpr int row() const noexcept
Returns the row this model index refers to.
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
constexpr const QAbstractItemModel * model() const noexcept
Returns a pointer to the model containing the item that this index refers to.
constexpr int column() const noexcept
Returns the column this model index refers to.
constexpr bool isValid() const noexcept
Returns {true} if this model index is valid; otherwise returns {false}.
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
QObject * parent() const
Returns a pointer to the parent object.
\inmodule QtCore \reentrant
PatternOptions patternOptions() const
Returns the pattern options for the regular expression.
void setPatternOptions(PatternOptions options)
Sets the given options as the pattern options of the regular expression.
static QString escape(const QString &str)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString wildcardToRegularExpression(const QString &str, WildcardConversionOptions options=DefaultWildcardConversion)
@ UnanchoredWildcardConversion
RAII class around Qt::beginPropertyUpdateGroup()/Qt::endPropertyUpdateGroup().
const_iterator constEnd() const noexcept
QSortFilterProxyModelGreaterThan(int column, const QModelIndex &parent, const QAbstractItemModel *source, const QSortFilterProxyModel *proxy)
bool operator()(int r1, int r2) const
QSortFilterProxyModelLessThan(int column, const QModelIndex &parent, const QAbstractItemModel *source, const QSortFilterProxyModel *proxy)
bool operator()(int r1, int r2) const
void _q_sourceColumnsInserted(const QModelIndex &source_parent, int start, int end)
QModelIndex source_to_proxy(const QModelIndex &sourceIndex) const
void _q_sourceRowsAboutToBeInserted(const QModelIndex &source_parent, int start, int end)
void setDynamicSortFilterForwarder(bool enable)
void _q_sourceColumnsRemoved(const QModelIndex &source_parent, int start, int end)
bool filterAcceptsRowInternal(int source_row, const QModelIndex &source_parent) const
bool can_create_mapping(const QModelIndex &source_parent) const
QHash< QModelIndex, Mapping * >::const_iterator index_to_iterator(const QModelIndex &proxy_index) const
QHash< QModelIndex, Mapping * >::const_iterator create_mapping(const QModelIndex &source_parent) const
Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QSortFilterProxyModelPrivate, Qt::CaseSensitivity, sort_casesensitivity, &QSortFilterProxyModelPrivate::setSortCaseSensitivityForwarder, &QSortFilterProxyModelPrivate::sortCaseSensitivityChangedForwarder, Qt::CaseSensitive) Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QSortFilterProxyModelPrivate
void _q_sourceColumnsAboutToBeInserted(const QModelIndex &source_parent, int start, int end)
QList< std::pair< int, int > > proxy_intervals_for_source_items(const QList< int > &source_to_proxy, const QList< int > &source_items) const
void source_items_about_to_be_removed(const QModelIndex &source_parent, int start, int end, Qt::Orientation orient)
void _q_sourceAboutToBeReset()
void sortRoleChangedForwarder(int role)
void _q_sourceModelDestroyed() override
void remove_source_items(QList< int > &source_to_proxy, QList< int > &proxy_to_source, const QList< int > &source_items, const QModelIndex &source_parent, Qt::Orientation orient, bool emit_signal=true)
void _q_sourceRowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest)
Qt::DisplayRole Qt::DisplayRole false dynamic_sortfilter
bool recursiveChildAcceptsRow(int source_row, const QModelIndex &source_parent) const
bool needsReorder(const QList< int > &source_rows, const QModelIndex &source_parent) const
void setAutoAcceptChildRowsForwarder(bool accept)
QHash< QModelIndex, Mapping * > source_index_mapping
void remove_from_mapping(const QModelIndex &source_parent)
void setRecursiveFilteringEnabledForwarder(bool recursive)
void _q_sourceColumnsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest)
void _q_sourceRowsAboutToBeRemoved(const QModelIndex &source_parent, int start, int end)
void sortCaseSensitivityChangedForwarder(Qt::CaseSensitivity cs)
void _q_sourceColumnsAboutToBeRemoved(const QModelIndex &source_parent, int start, int end)
void setFilterKeyColumnForwarder(int column)
bool recursiveParentAcceptsRow(const QModelIndex &source_parent) const
void source_items_inserted(const QModelIndex &source_parent, int start, int end, Qt::Orientation orient)
QList< QPersistentModelIndex > saved_layoutChange_parents
Qt::DisplayRole Qt::DisplayRole filter_recursive
std::array< QMetaObject::Connection, 18 > sourceConnections
QModelIndexPairList saved_persistent_indexes
QSet< int > handle_filter_changed(QList< int > &source_to_proxy, QList< int > &proxy_to_source, const QModelIndex &source_parent, Qt::Orientation orient)
void autoAcceptChildRowsChangedForwarder(bool accept)
void filterCaseSensitivityChangedForwarder(Qt::CaseSensitivity cs)
QModelIndexPairList store_persistent_indexes() const
QRowsRemoval itemsBeingRemoved
Qt::DisplayRole filter_role
void _q_sourceLayoutAboutToBeChanged(const QList< QPersistentModelIndex > &sourceParents, QAbstractItemModel::LayoutChangeHint hint)
void setFilterRegularExpressionForwarder(const QRegularExpression &re)
void _q_sourceRowsInserted(const QModelIndex &source_parent, int start, int end)
void filter_changed(Direction dir, const QModelIndex &source_parent=QModelIndex())
void update_persistent_indexes(const QModelIndexPairList &source_indexes)
void _q_sourceRowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest)
QModelIndex create_index(int row, int column, QHash< QModelIndex, Mapping * >::const_iterator it) const
void source_items_removed(const QModelIndex &source_parent, int start, int end, Qt::Orientation orient)
void _q_sourceHeaderDataChanged(Qt::Orientation orientation, int start, int end)
void setFilterCaseSensitivityForwarder(Qt::CaseSensitivity cs)
QHash< QModelIndex, Mapping * >::const_iterator create_mapping_recursive(const QModelIndex &source_parent) const
void _q_sourceColumnsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest)
Qt::DisplayRole Qt::DisplayRole false true filter_regularexpression
static void build_source_to_proxy_mapping(const QList< int > &proxy_to_source, QList< int > &source_to_proxy, int start=0)
void setSortCaseSensitivityForwarder(Qt::CaseSensitivity cs)
void sortLocaleAwareChangedForwarder(bool on)
void filter_about_to_be_changed(const QModelIndex &source_parent=QModelIndex())
Qt::DisplayRole Qt::DisplayRole false true &QSortFilterProxyModelPrivate::setFilterRegularExpressionForwarder QModelIndex last_top_source
void updateChildrenMapping(const QModelIndex &source_parent, Mapping *parent_mapping, Qt::Orientation orient, int start, int end, int delta_item_count, bool remove)
void sort_source_rows(QList< int > &source_rows, const QModelIndex &source_parent) const
int find_source_sort_column() const
void setFilterRoleForwarder(int role)
void set_filter_pattern(const QString &pattern)
void filterRoleChangedForwarder(int role)
QModelIndex proxy_to_source(const QModelIndex &proxyIndex) const
void setSortLocaleAwareForwarder(bool on)
void insert_source_items(QList< int > &source_to_proxy, QList< int > &proxy_to_source, const QList< int > &source_items, const QModelIndex &source_parent, Qt::Orientation orient, bool emit_signal=true)
void _q_sourceRowsRemoved(const QModelIndex &source_parent, int start, int end)
void setSortRoleForwarder(int role)
void remove_proxy_interval(QList< int > &source_to_proxy, QList< int > &proxy_to_source, int proxy_start, int proxy_end, const QModelIndex &proxy_parent, Qt::Orientation orient, bool emit_signal=true)
void recursiveFilteringEnabledChangedForwarder(bool recursive)
bool update_source_sort_column()
void _q_sourceLayoutChanged(const QList< QPersistentModelIndex > &sourceParents, QAbstractItemModel::LayoutChangeHint hint)
void _q_sourceDataChanged(const QModelIndex &source_top_left, const QModelIndex &source_bottom_right, const QList< int > &roles)
QList< std::pair< int, QList< int > > > proxy_intervals_for_source_items_to_add(const QList< int > &proxy_to_source, const QList< int > &source_items, const QModelIndex &source_parent, Qt::Orientation orient) const
void proxy_item_range(const QList< int > &source_to_proxy, const QList< int > &source_items, int &proxy_low, int &proxy_high) const
The QSortFilterProxyModel class provides support for sorting and filtering data passed between anothe...
void setFilterFixedString(const QString &pattern)
Sets the fixed string used to filter the contents of the source model to the given pattern.
virtual bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const
Returns true if the item in the column indicated by the given source_column and source_parent should ...
QBindable< int > bindableFilterKeyColumn()
int sortRole
the item role that is used to query the source model's data when sorting items.
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder) override
\reimp Sorts the model by column in the given order.
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
\reimp
QBindable< bool > bindableRecursiveFilteringEnabled()
Qt::DropActions supportedDropActions() const override
\reimp
QStringList mimeTypes() const override
\reimp
void setSortCaseSensitivity(Qt::CaseSensitivity cs)
QItemSelection mapSelectionToSource(const QItemSelection &proxySelection) const override
\reimp
~QSortFilterProxyModel()
Destroys this sorting filter model.
bool autoAcceptChildRows
if true the proxy model will not filter out children of accepted rows, even if they themselves would ...
QSortFilterProxyModel(QObject *parent=nullptr)
Constructs a sorting filter model with the given parent.
void setSourceModel(QAbstractItemModel *sourceModel) override
\reimp
Qt::CaseSensitivity sortCaseSensitivity
the case sensitivity setting used for comparing strings when sorting
QModelIndex mapFromSource(const QModelIndex &sourceIndex) const override
Returns the model index in the QSortFilterProxyModel given the sourceIndex from the source model.
QBindable< bool > bindableAutoAcceptChildRows()
void invalidateColumnsFilter()
QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const override
\reimp
QObject * parent() const
Returns a pointer to the parent object.
bool isRecursiveFilteringEnabled() const
void setSortLocaleAware(bool on)
int rowCount(const QModelIndex &parent=QModelIndex()) const override
\reimp
void invalidateRowsFilter()
void setFilterRegularExpression(const QString &pattern)
QItemSelection mapSelectionFromSource(const QItemSelection &sourceSelection) const override
\reimp
bool dynamicSortFilter
whether the proxy model is dynamically sorted and filtered whenever the contents of the source model ...
QBindable< bool > bindableDynamicSortFilter()
QModelIndex mapToSource(const QModelIndex &proxyIndex) const override
Returns the source model index corresponding to the given proxyIndex from the sorting filter model.
void setFilterCaseSensitivity(Qt::CaseSensitivity cs)
QMimeData * mimeData(const QModelIndexList &indexes) const override
\reimp
QBindable< QRegularExpression > bindableFilterRegularExpression()
bool canFetchMore(const QModelIndex &parent) const override
\reimp
QBindable< Qt::CaseSensitivity > bindableFilterCaseSensitivity()
int filterKeyColumn
the column where the key used to filter the contents of the source model is read from.
bool hasChildren(const QModelIndex &parent=QModelIndex()) const override
\reimp
QModelIndex sibling(int row, int column, const QModelIndex &idx) const override
\reimp
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole) override
\reimp
QBindable< int > bindableFilterRole()
Qt::ItemFlags flags(const QModelIndex &index) const override
\reimp
Qt::CaseSensitivity filterCaseSensitivity
the case sensitivity of the QRegularExpression pattern used to filter the contents of the source mode...
void fetchMore(const QModelIndex &parent) override
\reimp
void setFilterKeyColumn(int column)
QSize span(const QModelIndex &index) const override
\reimp
bool removeColumns(int column, int count, const QModelIndex &parent=QModelIndex()) override
\reimp
int columnCount(const QModelIndex &parent=QModelIndex()) const override
\reimp
QModelIndex buddy(const QModelIndex &index) const override
\reimp
int filterRole
the item role that is used to query the source model's data when filtering items.
void setRecursiveFilteringEnabled(bool recursive)
virtual bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
Returns true if the value of the item referred to by the given index source_left is less than the val...
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
\reimp
QBindable< Qt::CaseSensitivity > bindableSortCaseSensitivity()
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
\reimp
virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
Returns true if the item in the row indicated by the given source_row and source_parent should be inc...
bool isSortLocaleAware
the local aware setting used for comparing strings when sorting
Qt::SortOrder sortOrder() const
QBindable< int > bindableSortRole()
void setFilterRole(int role)
QRegularExpression filterRegularExpression
the QRegularExpression used to filter the contents of the source model
QBindable< bool > bindableIsSortLocaleAware()
void setDynamicSortFilter(bool enable)
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
\reimp
void setFilterWildcard(const QString &pattern)
Sets the wildcard expression used to filter the contents of the source model to the given pattern.
bool insertColumns(int column, int count, const QModelIndex &parent=QModelIndex()) override
\reimp
void setSortRole(int role)
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
\reimp
void setAutoAcceptChildRows(bool accept)
bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
\reimp
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
\reimp
int rowCount(const QModelIndex &parent=QModelIndex()) const override
If the database supports returning the size of a query (see QSqlDriver::hasFeature()),...
int columnCount(const QModelIndex &parent=QModelIndex()) const override
\reimp
\macro QT_RESTRICTED_CAST_FROM_ASCII
QChar * data()
Returns a pointer to the data stored in the QString.
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
Combined button and popup list for selecting options.
DBusConnection * connection
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr const T & qMin(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLsizei GLsizei GLchar * source
GLenum GLenum GLsizei void GLsizei void * column
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLsizei void * row
GLfixed GLfixed GLint GLint order
#define Q_OBJECT_COMPAT_PROPERTY(...)
#define Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(...)
QHash< QModelIndex, QSortFilterProxyModelPrivate::Mapping * > IndexMap
static bool operator&(QSortFilterProxyModelPrivate::Direction a, QSortFilterProxyModelPrivate::Direction b)
static QSet< int > qListToSet(const QList< int > &vector)
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
static int compare(quint64 a, quint64 b)
QSqlQueryModel * model
[16]
if(qFloatDistance(a, b)<(1<< 7))
[0]
settings remove("monkey")
myObject disconnect()
[26]
bool contains(QModelIndex parent, int row) const
QRowsRemoval(const QModelIndex &parent_source, int start, int end)
QSortFilterProxyModelDataChanged(const QModelIndex &tl, const QModelIndex &br)
QModelIndex source_parent
QList< QModelIndex > mapped_children
QList< int > proxy_columns
QList< int > source_columns