Qt IconEngine: Use a device pixel ratio of 1 when high-DPI pixmaps are disabled - #32221
Open
iccir wants to merge 1 commit into
Open
Qt IconEngine: Use a device pixel ratio of 1 when high-DPI pixmaps are disabled#32221iccir wants to merge 1 commit into
iccir wants to merge 1 commit into
Conversation
Member
|
I suspect we are using devicePixelRatio() also for other sizes like canvas/window size and event locations. Would those aspects not break when changing the behavior of devicePixelRatio()? |
Contributor
Author
This only modifies dpr = self._devicePixelRatio()
scaled_size = QtCore.QSize(int(size.width() * dpr), int(size.height() * dpr))
pixmap = QtGui.QPixmap(scaled_size)
pixmap.setDevicePixelRatio(dpr)On my retina display, I'm seeing the canvas and window at the correct size and events seem to still report the correct x/y coordinates. That said:
|
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.
PR summary
On Qt5, if the
QApplicationinstance has anAA_UseHighDpiPixmapsattribute set to false, our_IconEnginewill return icons that are too large.Check this attribute and return
1for_IconEngine._devicePixelRatio()if high DPI pixmaps are disabled.This attribute is always true on Qt6.
Closes #32217
AI Disclosure
I used AI to help me write a test reduction for #32217. I used AI to help me clean up the resulting implementation.
PR quality check