fix: invalidateFilter() Qt deprecation warning (#7940)

This commit is contained in:
Charles Kerr
2025-12-17 02:04:46 -06:00
committed by GitHub
parent f8970a9183
commit 6fcd2d2297

View File

@@ -13,8 +13,18 @@ TrackerModelFilter::TrackerModelFilter(QObject* parent)
void TrackerModelFilter::setShowBackupTrackers(bool b) void TrackerModelFilter::setShowBackupTrackers(bool b)
{ {
#if QT_VERSION < QT_VERSION_CHECK(6, 10, 0)
show_backups_ = b; show_backups_ = b;
invalidateFilter(); invalidateFilter(); // deprecated in Qt 6.13
#else
beginFilterChange();
show_backups_ = b;
endFilterChange(QSortFilterProxyModel::Direction::Rows);
#endif
} }
bool TrackerModelFilter::filterAcceptsRow(int source_row, QModelIndex const& source_parent) const bool TrackerModelFilter::filterAcceptsRow(int source_row, QModelIndex const& source_parent) const