fix(qt): handle pixel-sized fonts when scaling widgets#7465
Draft
thepastaclaw wants to merge 2 commits into
Draft
fix(qt): handle pixel-sized fonts when scaling widgets#7465thepastaclaw wants to merge 2 commits into
thepastaclaw wants to merge 2 commits into
Conversation
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.
This was referenced Jul 15, 2026
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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