Skip to content

fix: replace deprecated invalidateFilter in Qt6.10#798

Open
uqlidi wants to merge 1 commit into
bitcoin-core:qt6from
uqlidi:fix/qt/deprecated/invalidateFilter
Open

fix: replace deprecated invalidateFilter in Qt6.10#798
uqlidi wants to merge 1 commit into
bitcoin-core:qt6from
uqlidi:fix/qt/deprecated/invalidateFilter

Conversation

@uqlidi

@uqlidi uqlidi commented Jul 18, 2026

Copy link
Copy Markdown

replace deprecated invalidateFilter with beginFilterChange and endFilterChange in >=Qt6.10

same solution in bitcoin-core/gui#899

fix #776 #740

@hebasto hebasto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach ACK b1d9377.

The testing code seems to require patching as well:

/home/hebasto/dev/bitcoin-qml/test/qml/qml_tests_main.cpp:2923:25: warning: ‘void QSortFilterProxyModel::invalidateFilter()’ is deprecated: Use begin/endFilterChange() instead [-Wdeprecated-declarations]
 2923 |         invalidateFilter();
      |         ~~~~~~~~~~~~~~~~^~
In file included from /usr/include/qt6/QtCore/QSortFilterProxyModel:1,
                 from /home/hebasto/dev/bitcoin-qml/test/qml/qml_tests_main.cpp:15:
/usr/include/qt6/QtCore/qsortfilterproxymodel.h:128:10: note: declared here
  128 |     void invalidateFilter();
      |          ^~~~~~~~~~~~~~~~
/home/hebasto/dev/bitcoin-qml/test/qml/qml_tests_main.cpp: In member function ‘void MockActivityFilterProxyModel::setDateFilter(DateFilter)’:
/home/hebasto/dev/bitcoin-qml/test/qml/qml_tests_main.cpp:2933:25: warning: ‘void QSortFilterProxyModel::invalidateFilter()’ is deprecated: Use begin/endFilterChange() instead [-Wdeprecated-declarations]
 2933 |         invalidateFilter();
      |         ~~~~~~~~~~~~~~~~^~
/usr/include/qt6/QtCore/qsortfilterproxymodel.h:128:10: note: declared here
  128 |     void invalidateFilter();
      |          ^~~~~~~~~~~~~~~~
/home/hebasto/dev/bitcoin-qml/test/qml/qml_tests_main.cpp: In member function ‘void MockActivityFilterProxyModel::setTypeFilter(TypeFilter)’:
/home/hebasto/dev/bitcoin-qml/test/qml/qml_tests_main.cpp:2943:25: warning: ‘void QSortFilterProxyModel::invalidateFilter()’ is deprecated: Use begin/endFilterChange() instead [-Wdeprecated-declarations]
 2943 |         invalidateFilter();
      |         ~~~~~~~~~~~~~~~~^~
/usr/include/qt6/QtCore/qsortfilterproxymodel.h:128:10: note: declared here
  128 |     void invalidateFilter();
      |          ^~~~~~~~~~~~~~~~

Also feel free to pick ea12a28 from #795 to ensure the CI tests Qt 6.10.

#else
invalidateFilter();
#endif

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style nit: Drop this empty line?

#endif

m_date_filter = date_filter;
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style nit: Add an empty line above for consistency with other similar places?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using deprecated QSortFilterProxyModel::invalidateFilter()

2 participants