Skip to content

Fix #33698: Locale problems in IntInputValidator [4.7.3]#33701

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

Fix #33698: Locale problems in IntInputValidator [4.7.3]#33701
mathesoncalum wants to merge 2 commits into
musescore:4.7from
mathesoncalum:33698-export_resolution_bug-473

Conversation

@mathesoncalum

Copy link
Copy Markdown
Contributor

Resolves: #33698

The comma was causing problems here (this is basically the same idea as #30299). Not sure why but the IntInputValidator tests file also appears to have been dropped at some point - I've re-enabled it and everything seems to be passing.

@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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 108ea14b-4465-48a0-8b85-141f75f981bd

📥 Commits

Reviewing files that changed from the base of the PR and between 70f1371 and baeb708.

📒 Files selected for processing (3)
  • src/framework/uicomponents/qml/Muse/UiComponents/tests/CMakeLists.txt
  • src/framework/uicomponents/qml/Muse/UiComponents/tests/intinputvalidator_tests.cpp
  • src/framework/uicomponents/qml/Muse/UiComponents/validators/intinputvalidator.cpp

📝 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
Description check ⚠️ Warning The PR description is incomplete and does not follow the provided template, missing most required sections and checklist items. Fill out the complete PR template with all required sections including CLA confirmation, checklist items, and detailed description of changes and testing performed.
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.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: fixing locale problems in IntInputValidator for issue #33698, making it specific and relevant to the changeset.
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.

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

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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Infer (1.2.0)
src/framework/uicomponents/qml/Muse/UiComponents/tests/intinputvalidator_tests.cpp

src/framework/uicomponents/qml/Muse/UiComponents/tests/intinputvalidator_tests.cpp:22:10: fatal error: 'gtest/gtest.h' file not found
22 | #include <gtest/gtest.h>
| ^~~~~~~~~~~~~~~
1 error generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/baeb7086dffda66d4e583ba84bf9b7a0ec4b121f-9d655a558fecd809/tmp/clang_command_.tmp.cb18a4.txt
++Contents of '/tmp/coderabbit-infer/baeb7086dffda66d4e583ba84bf9b7a0ec4b121f-9d655a558fecd809/tmp/clang_command_.tmp.cb18a4.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
"-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
"-plugin-arg-BiniouASTExporter" "MAX_STRING_SIZE=65535" "-cc1" "-triple"
"x86_64-un

... [truncated 1197 characters] ...

/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-fdeprecated-macro" "-ferror-limit" "19" "-fgnuc-version=4.2.1"
"-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/9d655a558fecd809/file.o" "-x" "c++"
"src/framework/uicomponents/qml/Muse/UiComponents/tests/intinputvalidator_tests.cpp"
"-O0" "-fno-builtin" "-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"

src/framework/uicomponents/qml/Muse/UiComponents/validators/intinputvalidator.cpp

In file included from src/framework/uicomponents/qml/Muse/UiComponents/validators/intinputvalidator.cpp:22:
src/framework/uicomponents/qml/Muse/UiComponents/validators/intinputvalidator.h:25:10: fatal error: 'qqmlintegration.h' file not found
25 | #include <qqmlintegration.h>
| ^~~~~~~~~~~~~~~~~~~
1 error generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/baeb7086dffda66d4e583ba84bf9b7a0ec4b121f-0e5a12d5251ec009/tmp/clang_command_.tmp.739cd5.txt
++Contents of '/tmp/coderabbit-infer/baeb7086dffda66d4e583ba84bf9b7a0ec4b121f-0e5a12d5251ec009/tmp/clang_command_.tmp.739cd5.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
"-plugin-arg-BiniouASTExporter

... [truncated 1307 characters] ...

r/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-fdeprecated-macro" "-ferror-limit" "19" "-fgnuc-version=4.2.1"
"-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/0e5a12d5251ec009/file.o" "-x" "c++"
"src/framework/uicomponents/qml/Muse/UiComponents/validators/intinputvalidator.cpp"
"-O0" "-fno-builtin" "-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"


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
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