fix(qt): handle pixel-sized fonts when scaling widgets#7465
fix(qt): handle pixel-sized fonts when scaling widgets#7465thepastaclaw wants to merge 2 commits into
Conversation
|
The The failing test is Filed #7466 with the failure logs and reproduction evidence. No commit, push, rebase, or CI retrigger is appropriate for this PR. |
|
✅ Final review complete — no blockers (commit aa68ce3) |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Codex + Sonnet
The pixel-sized font fix correctly converts pixels to points using the widget's logical DPI, handles invalid sizes safely, and has focused Qt regression coverage. The new Dash-specific test files are not yet registered for Dash cppcheck analysis, and the conversion branch contains one harmless redundant assignment.
Review provenance
- Codex reviewers:
gpt-5.6-sol— general (completed),gpt-5.6-sol— dash-core-commit-history (completed) - Verifier:
gpt-5.6-sol— final-verifier (fallback) - Sonnet reviewers:
claude-sonnet-5— general (failed),claude-sonnet-5— dash-core-commit-history (failed),claude-sonnet-5— general (completed),claude-sonnet-5— dash-core-commit-history (completed)
🟡 1 suggestion(s) | 💬 1 nitpick(s)
1 additional finding(s) omitted (not in diff).
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `test/util/data/non-backported.txt`:
- [SUGGESTION] test/util/data/non-backported.txt:38: Register the new font tests for Dash-specific cppcheck
The newly added `src/qt/test/fonttests.cpp` and `src/qt/test/fonttests.h` files have no upstream Bitcoin Core counterpart, but no pattern in this registry matches them. `test/lint/lint-cppcheck-dash.py` constructs its complete input set from these patterns, so both files are currently omitted from Dash-specific static analysis. Add the test files alongside the existing `guiutil_font.*` entry.
Stylesheets may set font-size in px, making pointSizeF() report -1 and tripping assert(font.pointSize() > 0) in updateFonts(). Convert pixel sizes to points when DPI is valid, otherwise skip the widget so invalid DPI cannot divide by zero. Fixes recovery-dialog / pixel-font crashes tracked in dashpay#7281/dashpay#7464.
Add FontTests that applies a pixel-sized font (recovery-dialog failure mode) and asserts GUIUtil::updateFonts() no longer aborts and yields a positive point size. Include the public API via guiutil.h after the guiutil_font.h inline. Run FontTests before AppTests so cocoa can exercise the regression path without full GUI startup.
aa1fcec to
aa68ce3
Compare
|
Addressed the current review findings in the existing clean two-commit stack:
Validation: |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Codex + Sonnet
Both carried-forward findings are resolved at the exact current head: the Dash-specific font tests are registered for cppcheck, and the redundant point-size assignment has been removed. Independent review of the rewritten PR stack and the incremental delta found no new in-scope issues; the pixel-to-point conversion handles invalid sizes safely and has focused Qt regression coverage.
GitHub does not allow PastaClaw to approve their own PR, so the canonical APPROVE verdict is transported as a COMMENT review.
Review provenance
- Codex reviewers:
gpt-5.6-sol— general (completed),gpt-5.6-sol— dash-core-commit-history (completed) - Verifier:
gpt-5.6-sol— final-verifier (fallback) - Sonnet reviewers:
claude-sonnet-5— general (failed),claude-sonnet-5— dash-core-commit-history (failed),claude-sonnet-5— general (completed),claude-sonnet-5— dash-core-commit-history (failed),claude-sonnet-5— dash-core-commit-history (completed)
Pixel-sized font scaling fix
Issue being fixed or feature implemented
GUIUtil::updateFonts()assumed every widget font had a positive point size. The recovery-phrase dialog stylesheet uses pixel-sized fonts, for which Qt reports an invalid point size, so an asynchronous global font refresh could abort while the dialog was open. This caused the original macOS report in #7281 and the cross-platform recurrence in #7464.Fixes #7281.
Fixes #7464.
Supersedes the earlier closed draft #7315, which GitHub would not reopen after the branch was rebased onto current
develop.What was done?
GUIUtil::updateFonts().How Has This Been Tested?
qt/libbitcoinqt.aandtest_dash_qtagainst currentdevelop../src/qt/test/test_dash-qtpasses with the defaultminimalplatform. On macOS, the focused font-test body is skipped underminimal, matching the existingAppTestsplatform limitation.QT_QPA_PLATFORM=cocoa ./src/qt/test/test_dash-qtexercises and passesFontTests; the later fullAppTestssuite cannot run to completion in this headless macOS environment because Cocoa pasteboard initialization aborts.git diff --check upstream/develop...HEADpasses.Breaking Changes
None.
Checklist