Skip to content

Make int input validator locale aware [4.7.4 port]#33701

Open
mathesoncalum wants to merge 4 commits into
musescore:4.7from
mathesoncalum:33698-export_resolution_bug-473
Open

Make int input validator locale aware [4.7.4 port]#33701
mathesoncalum wants to merge 4 commits into
musescore:4.7from
mathesoncalum:33698-export_resolution_bug-473

Conversation

@mathesoncalum

@mathesoncalum mathesoncalum commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

@mathesoncalum mathesoncalum requested a review from Eism June 4, 2026 15:43
@mathesoncalum

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR refactors IntInputValidator to use Qt's QLocale API for numeric parsing and formatting instead of plain QString conversions. The fixup() method now parses values through QLocale::toInt, defaults invalid parses to locale-formatted zero, and clamps results to configured bounds. The validate() method strips locale group separators before parsing and uses QLocale::toInt with an ok flag to determine acceptability and intermediate states. Comprehensive test coverage is added for both plain (en_US) and grouped/decimal (de_DE) locales, with test registration in the build configuration.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning PR description is minimal and lacks required template sections like motivation, CLA signature, commit message verification, code compilation confirmation, testing details, and change justification. Complete the pull request description template: add detailed motivation for the changes, confirm CLA signature, verify commit messages reference the issue, confirm code compiles and tests pass, and explain all changes follow coding rules.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The code changes successfully address issue #33698 by fixing locale-aware number parsing in IntInputValidator, re-enabling tests, and ensuring DPI values are properly retained.
Out of Scope Changes check ✅ Passed All changes are scope-aligned: CMakeLists update adds test source file, intinputvalidator_tests.cpp adds comprehensive unit tests, and intinputvalidator.cpp fixes locale-aware string parsing logic per issue #33698.
Title check ✅ Passed The title accurately summarizes the main change: making the IntInputValidator locale-aware, which directly addresses the core fix in the changeset and resolves the locale-related parsing issue in the linked issue #33698.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@mathesoncalum mathesoncalum linked an issue Jun 9, 2026 that may be closed by this pull request
4 tasks
@mathesoncalum mathesoncalum changed the title Fix #33698: Locale problems in IntInputValidator [4.7.3] Fix #33698: Locale problems in IntInputValidator [4.7.4] Jun 15, 2026
@mathesoncalum mathesoncalum force-pushed the 33698-export_resolution_bug-473 branch from baeb708 to d190e7b Compare June 17, 2026 14:52
@mathesoncalum mathesoncalum changed the title Fix #33698: Locale problems in IntInputValidator [4.7.4] Make int input validator locale aware [4.7.4 port] Jun 17, 2026
@mathesoncalum mathesoncalum force-pushed the 33698-export_resolution_bug-473 branch from d190e7b to 971ac8e Compare June 17, 2026 15:55
Co-authored-by: Gabriel Sartori <gabriel@embarc.com.br>
Co-authored-by: Gabriel Sartori <gabriel@embarc.com.br>
Co-authored-by: Gabriel Sartori <gabriel@embarc.com.br>
Co-authored-by: Gabriel Sartori <gabriel@embarc.com.br>
@mathesoncalum mathesoncalum force-pushed the 33698-export_resolution_bug-473 branch from 971ac8e to e27b045 Compare June 17, 2026 17:03
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.

Unable to enter numbers to specify PDF resolution

1 participant