HiDPI pixmap
Needs ReviewPublic

Authored by guoyunhe on Feb 21 2020, 8:51 PM.

Details

Reviewers
None
Group Reviewers
Plasma
Summary

Make the big icon at left side sharp in HiDPI screen.

Before:

After:

Diff Detail

Repository
R121 Policykit (Polkit) KDE Agent
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 22778
Build 22796: arc lint + arc unit
guoyunhe created this revision.Feb 21 2020, 8:51 PM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 21 2020, 8:51 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
guoyunhe requested review of this revision.Feb 21 2020, 8:51 PM
guoyunhe edited the summary of this revision. (Show Details)Feb 21 2020, 8:52 PM
guoyunhe added a reviewer: Plasma.
guoyunhe edited the summary of this revision. (Show Details)Feb 21 2020, 9:00 PM
apol added a subscriber: apol.Feb 22 2020, 12:59 AM
apol added inline comments.
AuthDialog.cpp
108

You should get the dpr from the window, not the qApp. Different screens will have different dprs.

133

All are integers, why are you turning it into QPointF?

guoyunhe updated this revision to Diff 76145.Feb 22 2020, 8:22 AM

Get DPR from widget instead of app

anthonyfieroni added inline comments.
AuthDialog.cpp
108

You wanna use devicePixelRatioF right?

guoyunhe marked 2 inline comments as done.Feb 22 2020, 8:27 AM
guoyunhe added inline comments.
AuthDialog.cpp
108

Fixed. Getting it from widget now.

133

This is how HiDPI QPainter works.

Source https://doc.qt.io/qt-5/highdpi.html#migrate-existing-applications

Always use the qreal versions of the QPainter drawing API.

guoyunhe updated this revision to Diff 76146.Feb 22 2020, 8:29 AM
guoyunhe marked 2 inline comments as done.

Change devicePixelRatio() to devicePixelRatioF()

guoyunhe marked an inline comment as done.Feb 22 2020, 8:30 AM
guoyunhe added inline comments.
AuthDialog.cpp
108

Fixed thanks!