|
7 | 7 | #include <qt/transactiontablemodel.h> |
8 | 8 | #include <qt/transactionrecord.h> |
9 | 9 |
|
| 10 | +#include <QtVersionChecks> |
| 11 | + |
10 | 12 | #include <algorithm> |
11 | 13 | #include <cstdlib> |
12 | 14 | #include <optional> |
@@ -52,32 +54,77 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex & |
52 | 54 |
|
53 | 55 | void TransactionFilterProxy::setDateRange(const std::optional<QDateTime>& from, const std::optional<QDateTime>& to) |
54 | 56 | { |
| 57 | +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 58 | + beginFilterChange(); |
| 59 | +#endif |
| 60 | + |
55 | 61 | dateFrom = from; |
56 | 62 | dateTo = to; |
| 63 | + |
| 64 | +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 65 | + endFilterChange(QSortFilterProxyModel::Direction::Rows); |
| 66 | +#else |
57 | 67 | invalidateFilter(); |
| 68 | +#endif |
58 | 69 | } |
59 | 70 |
|
60 | 71 | void TransactionFilterProxy::setSearchString(const QString &search_string) |
61 | 72 | { |
| 73 | +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 74 | + beginFilterChange(); |
| 75 | +#endif |
| 76 | + |
62 | 77 | if (m_search_string == search_string) return; |
63 | 78 | m_search_string = search_string; |
| 79 | + |
| 80 | +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 81 | + endFilterChange(QSortFilterProxyModel::Direction::Rows); |
| 82 | +#else |
64 | 83 | invalidateFilter(); |
| 84 | +#endif |
65 | 85 | } |
66 | 86 |
|
67 | 87 | void TransactionFilterProxy::setTypeFilter(quint32 modes) |
68 | 88 | { |
| 89 | +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 90 | + beginFilterChange(); |
| 91 | +#endif |
| 92 | + |
69 | 93 | this->typeFilter = modes; |
| 94 | + |
| 95 | +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 96 | + endFilterChange(QSortFilterProxyModel::Direction::Rows); |
| 97 | +#else |
70 | 98 | invalidateFilter(); |
| 99 | +#endif |
71 | 100 | } |
72 | 101 |
|
73 | 102 | void TransactionFilterProxy::setMinAmount(const CAmount& minimum) |
74 | 103 | { |
| 104 | +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 105 | + beginFilterChange(); |
| 106 | +#endif |
| 107 | + |
75 | 108 | this->minAmount = minimum; |
| 109 | + |
| 110 | +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 111 | + endFilterChange(QSortFilterProxyModel::Direction::Rows); |
| 112 | +#else |
76 | 113 | invalidateFilter(); |
| 114 | +#endif |
77 | 115 | } |
78 | 116 |
|
79 | 117 | void TransactionFilterProxy::setShowInactive(bool _showInactive) |
80 | 118 | { |
| 119 | +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 120 | + beginFilterChange(); |
| 121 | +#endif |
| 122 | + |
81 | 123 | this->showInactive = _showInactive; |
| 124 | + |
| 125 | +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 126 | + endFilterChange(QSortFilterProxyModel::Direction::Rows); |
| 127 | +#else |
82 | 128 | invalidateFilter(); |
| 129 | +#endif |
83 | 130 | } |
0 commit comments