Add HiDPI support

Authored by volkov on Apr 25 2019, 3:12 PM.

Diff Detail

R483 Skanlite
No Linters Available
No Unit Test Coverage
Build Status
Buildable 11227
Build 11245: arc lint + arc unit
volkov requested review of this revision.Apr 25 2019, 3:12 PM
volkov created this revision.
sars added a comment.Apr 25 2019, 7:11 PM

Same ignorant question here as for libksane... Why do we need the HighDpiPixmaps in skanlite? The images get the dpi settings from the scanner setting...

To paint non-pixelated icons on buttons.
This attribute "makes QIcon::pixmap() generate high-dpi pixmaps that can be larger than the requested size. Such pixmaps will have devicePixelRatio() set to a value higher than 1."

sars accepted this revision.Apr 28 2019, 7:22 PM

So to get nice icons on buttons we need to "setAttribute(Qt::AA_UseHighDpiPixmaps);", but that blurs the previews -> devicePixelRatioF() for preview images.

This revision is now accepted and ready to land.Apr 28 2019, 7:22 PM

AA_UseHighDpiPixmaps is not related to previews, it's for icons on buttons.
devicePixelRatioF is needed to paint an image as is without highdpi scaling by Qt.

volkov closed this revision.Apr 29 2019, 1:21 PM