Change return type of qHash with Qt 6 to size_t

This commit is contained in:
Jonas Kvinge
2020-11-17 01:22:38 +01:00
parent 4dcae4ce21
commit 042da74955
8 changed files with 33 additions and 1 deletions

View File

@@ -84,7 +84,11 @@ bool PlaylistFilter::filterAcceptsRow(int row, const QModelIndex &parent) const
QString filter = filterRegExp().pattern();
#endif
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
size_t hash = qHash(filter);
#else
uint hash = qHash(filter);
#endif
if (hash != query_hash_) {
// Parse the query
FilterParser p(filter, column_names_, numerical_columns_);

View File

@@ -47,10 +47,14 @@ class PlaylistFilter : public QSortFilterProxyModel {
// public so Playlist::NextVirtualIndex and friends can get at it
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
private:
private:
// Mutable because they're modified from filterAcceptsRow() const
mutable QScopedPointer<FilterTree> filter_tree_;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
mutable size_t query_hash_;
#else
mutable uint query_hash_;
#endif
QMap<QString, int> column_names_;
QSet<int> numerical_columns_;