Priority: P3: Somewhat important
Affects Version/s: 5.6.1, 5.8.0
Fix Version/s: 5.9
Component/s: GUI: Painting
Environment:Linux Mint KDE 18.1, Antergos.
Commits:8b62673d9f0cf8aea126b3cd2f52686f013d7fe1, 9595622e366fcbef6bcc3a2ee08597959e3e2bd2, db2de20c59137eab15fac9592c001a4d234c82d4 (qtbase/5.9, 19.4.17, 5.9)
When setting a QGraphicsEffect of any kind on a widget, the effect is drawn in such a way that the widget's text/image no longer scales properly in HiDPI.
For example, if you run a Qt application with QT_SCALE_FACTOR=2, and then set a QGraphicsColorizeEffect on a QLabel, that label will not look crisp when it is scaled. Instead it will be scaled, but will look jagged and pixelated. This also happens to icons that are set in the widget, and even to SVG images. If no QGraphicsEffect were set, then the text or image would scale properly and look crisp.
Below is some sample code:
If you run the above with the environment variable QT_SCALE_FACTOR set to 1 (or without that environment variable set at all), the text will be green and will look normal, as seen in the attached image "no_hidpi.png". If you run the above with QT_SCALE_FACTOR=2 to test for HiDPI displays, the text will be overly large and jagged. It will also be clipped. See the attached image "hidpi.png".
Interestingly enough, if you use a drop shadow effect instead, the text or image in the widget will scale properly and look crisp, but the drop shadow will look jagged.
However, other custom QGraphicsEffects show similar behavior to the QGraphicsColorizeEffect and do not look crisp when scaled.
|For Gerrit Dashboard: QTBUG-60026|
|191848,2||QGraphicsColorizeEffect: Fix for high DPI scaling||5.9||qt/qtbase||Status: MERGED||+2||0|
|191856,2||QGraphicsBlurEffect: Fix for high DPI scaling||5.9||qt/qtbase||Status: MERGED||+2||0|
|191858,2||QGraphicsDropShadowEffect: Fix for high DPI scaling||5.9||qt/qtbase||Status: MERGED||+2||0|