Skip to content

Fix symbol icon size and pixelation issues on hidpi screens - #66530

Merged
nyalldawson merged 8 commits into
qgis:masterfrom
nyalldawson:fix_preview_dpi
Jun 27, 2026
Merged

Fix symbol icon size and pixelation issues on hidpi screens#66530
nyalldawson merged 8 commits into
qgis:masterfrom
nyalldawson:fix_preview_dpi

Conversation

@nyalldawson

Copy link
Copy Markdown
Collaborator

Description

Fixes a range of issues where symbol icons are missized and badly rendered on screens with device pixel ratios > 1.

Fixes #55349

AI tool usage

  • AI tool(s) (Copilot, Claude, or something similar) supported my development of this PR. See our policy about AI tool use. Use of AI tools must be indicated. Failure to be honest might result in banning.
The screen might not be valid when the widget is first constructed,
so we need to make sure we don't store it and instead just
always retrieve the actual screen when needing to draw the icons.
…view icon

It's not appropriate to assume that we are always updating the
preview icon as a result of a user-initiated modification to
the symbol.
Instead of assertion we should just NOT use the cache image

Otherwise this assert frequently triggers when dragging QGIS between windows with different DPI
Previously we'd draw oversized, pixelated icons for >1 devicePixelRatio
For devices with pixel ratios > 1
@github-actions github-actions Bot added this to the 4.2.0 milestone Jun 23, 2026

@nirvn nirvn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is any of this screen DPI testable on CI?

@nyalldawson

Copy link
Copy Markdown
Collaborator Author

@nirvn

I don't think so -- you can't manually create QScreen objects with particular properties (it's a qt internal only). I tried previously (in #66531) to see if there were anyway to influence that via Qt environment variables, but those only change how the screens are interpreted, not the properties returned by QScreen...

@nyalldawson
nyalldawson merged commit 4c3d932 into qgis:master Jun 27, 2026
56 of 59 checks passed
@nyalldawson
nyalldawson deleted the fix_preview_dpi branch June 27, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants