Skip to content

Commit

Permalink
Qt 6.9: Call beginFilterChange and use QKeyEvent::matches
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn committed Jan 7, 2025
1 parent dc912a7 commit bb60bbb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tiled/issuesdock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
#include <QStyledItemDelegate>
#include <QVBoxLayout>

#include <memory>

namespace Tiled {

class IssueFilterModel : public QSortFilterProxyModel
Expand All @@ -51,6 +49,9 @@ class IssueFilterModel : public QSortFilterProxyModel
if (mShowWarnings == showWarnings)
return;

#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
beginFilterChange();
#endif
mShowWarnings = showWarnings;
invalidateFilter();
}
Expand Down
4 changes: 4 additions & 0 deletions src/tiled/newsfeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ int NewsFeed::unreadCount() const

void NewsFeed::timerEvent(QTimerEvent *event)
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
if (event->matches(mRefreshTimer)) {
#else
if (event->timerId() == mRefreshTimer.timerId()) {
#endif
refresh();
return;
}
Expand Down
4 changes: 4 additions & 0 deletions src/tiled/newversionchecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ bool NewVersionChecker::isNewVersionAvailable() const

void NewVersionChecker::timerEvent(QTimerEvent *event)
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
if (event->matches(mRefreshTimer)) {
#else
if (event->timerId() == mRefreshTimer.timerId()) {
#endif
refresh();
return;
}
Expand Down
3 changes: 3 additions & 0 deletions src/tiled/tilesetdocumentsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ void TilesetDocumentsFilterModel::setMapDocument(MapDocument *mapDocument)
if (mMapDocument == mapDocument)
return;

#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
beginFilterChange();
#endif
mMapDocument = mapDocument;
invalidateFilter();
}
Expand Down

0 comments on commit bb60bbb

Please sign in to comment.