[Okular-devel] [okular] [Bug 362856] [Frameworks] Wrong render resolution, possibly caused by Plasma 5 "Scale Display"

Yi Yang via KDE Bugzilla bugzilla_noreply at kde.org
Sun May 22 14:45:54 UTC 2016


https://bugs.kde.org/show_bug.cgi?id=362856

--- Comment #11 from Yi Yang <ahyangyi at gmail.com> ---
By reading more documents and doing more experiments, things are now clear.

Qt 5.6 introduces a new option, called "High DPI Scaling", which is both
controllable form environment variables and application-wise options
(Qt::AA_EnableHighDpiScaling and Qt::AA_DisbleHighDpiScaling). This gives us
solution A: temporarily force Qt::AA_DisbleHighDpiScaling. This solution does
uglify menus and icons, though.

The more complex solution B needs more code refactoring. The key is to realize
that you are using "device-independent geometry" while the pixmap inside
QPixmap are using real physical values. You need to get this magical value from
QScreen::devicePixelRatio() and set them to QPixmap::setDevicePixelRatio().
This step might be simplified by "Qt::AA_UseHighDpiPixmaps". I'm not sure, the
documentation here isn't clear.

But the even harder part is you need to rewrite the image rotation and cropping
code, since now you are cropping the image to (widget size *
devicePixelRatio()). It's a bit tricky and many code in different locations
made the assumption that widget size = the pixmap size in it, which no longer
holds and thus broken code is scattered everywhere.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Okular-devel mailing list