Skip to content

fix: avoid deprecated invalidateFilter on Qt 6.5+#1038

Merged
annejan merged 2 commits into
mainfrom
fix/invalidate-filter-deprecation
Apr 18, 2026
Merged

fix: avoid deprecated invalidateFilter on Qt 6.5+#1038
annejan merged 2 commits into
mainfrom
fix/invalidate-filter-deprecation

Conversation

@nogeenharrie
Copy link
Copy Markdown
Contributor

@nogeenharrie nogeenharrie commented Apr 18, 2026

Refactored the setStore method in StoreModel to conditionally call invalidateFilter(). For Qt versions 6.5.0 and newer, it now explicitly calls QSortFilterProxyModel::invalidateFilter() to avoid using the deprecated unqualified invalidateFilter() method. For older Qt versions, it retains the original invalidateFilter() call, ensuring backward compatibility. This change prevents deprecation warnings and ensures future compatibility with Qt 6.5+ while maintaining support for earlier versions.

Summary by CodeRabbit

  • Chores
    • Updated internal code compatibility and formatting.

@codeant-ai
Copy link
Copy Markdown
Contributor

codeant-ai Bot commented Apr 18, 2026

CodeAnt AI is reviewing your PR.

@kody-ai

This comment has been minimized.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: a8e3a3b6-42af-4614-acaf-8b230c61d579

📥 Commits

Reviewing files that changed from the base of the PR and between 9880d73 and 0c19a69.

📒 Files selected for processing (1)
  • src/storemodel.cpp

📝 Walkthrough

Walkthrough

Added a Qt compatibility include and ensured StoreModel::setStore() assigns the new store and calls invalidateFilter(). Also removed the file trailing newline.

Changes

Cohort / File(s) Summary
StoreModel implementation
src/storemodel.cpp
Added #include <QtGlobal>, updated StoreModel::setStore(const QString&) to assign store and call invalidateFilter(), and removed the trailing newline at end-of-file.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

🐰 I hopped into code with a merry twirl,

Added a header and gave filters a whirl,
Store set anew, then the filter wakes,
A tiny tweak for compatibility's sakes,
Hooray — a carrot for clean, small stakes! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: avoid deprecated invalidateFilter on Qt 6.5+' accurately and concisely describes the main change: addressing Qt 6.5+ deprecation by conditionally calling the unqualified invalidateFilter() method.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/invalidate-filter-deprecation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codeant-ai codeant-ai Bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Apr 18, 2026
Comment thread src/storemodel.cpp Outdated
@codeant-ai
Copy link
Copy Markdown
Contributor

codeant-ai Bot commented Apr 18, 2026

CodeAnt AI finished reviewing your PR.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/storemodel.cpp`:
- Around line 104-108: The conditional around
QSortFilterProxyModel::invalidateFilter() uses QT_VERSION_CHECK(6,5,0) but the
deprecation/remedy timeline is wrong; to fix, either remove the `#if/`#else
entirely if your minimum supported Qt is >= 6.5 (making the else dead code) or
change the version check to the actual deprecation target (e.g.
QT_VERSION_CHECK(6,11,0) or the version where
beginFilterChange()/endFilterChange() exist) and update the call to use
beginFilterChange()/endFilterChange() pairs when targeting that newer Qt; locate
the call to QSortFilterProxyModel::invalidateFilter() in storemodel.cpp and
adjust the preprocessor condition or replace the call with the proper
beginFilterChange()/endFilterChange() sequence accordingly.
🪄 Autofix (Beta)

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7b81bca7-f27d-470c-ac8d-b90e9a68d6ee

📥 Commits

Reviewing files that changed from the base of the PR and between 79d758a and 9880d73.

📒 Files selected for processing (1)
  • src/storemodel.cpp

Comment thread src/storemodel.cpp Outdated
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 18, 2026

Coverage Status

coverage: 21.908%. remained the same — fix/invalidate-filter-deprecation into main

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 18, 2026

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 1 file(s) based on 1 unresolved review comment.

Files modified:

  • src/storemodel.cpp

Commit: 0c19a69d73df5dd9226189a82abefcb33058a198

The changes have been pushed to the fix/invalidate-filter-deprecation branch.

Time taken: 1m 47s

Fixed 1 file(s) based on 1 unresolved review comment.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
@kody-ai
Copy link
Copy Markdown

kody-ai Bot commented Apr 18, 2026

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Cross File
Business Logic

Access your configuration settings here.

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

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants