signalplotter: Add highdpi support
Needs ReviewPublic

Authored by volkov on Apr 10 2019, 4:31 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None

Diff Detail

Repository
R111 KSysguard Library
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10783
Build 10801: arc lint + arc unit
volkov created this revision.Apr 10 2019, 4:31 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 10 2019, 4:31 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
volkov requested review of this revision.Apr 10 2019, 4:31 PM
zzag added a subscriber: zzag.Apr 10 2019, 5:03 PM

Oh, nice! FWIW, I made a patch to add HighDPI support some time ago as well. I haven't uploaded it for review because there were issues with beams not being smooth.

signalplotter/ksignalplotter.cpp
681–682

Can be const.

691

Don't abuse auto.

zzag added a comment.EditedApr 10 2019, 5:07 PM

Yep, this patch has the same issues. :(

Hi, thanks for the review.
I know about the issues, I've uploaded the patch to avoid losing it :)

volkov updated this revision to Diff 56079.Apr 12 2019, 4:38 PM

reduced beam width

volkov updated this revision to Diff 56102.Apr 12 2019, 9:44 PM

use QPen::setWidthF() instead of QPen::setWidth()

zzag added inline comments.Apr 15 2019, 3:11 PM
signalplotter/ksignalplotter.cpp
897–899

Could you please explain why we have to do this?

volkov added inline comments.Apr 15 2019, 3:43 PM
signalplotter/ksignalplotter.cpp
897–899

To avoid artifacts when painting beams.

To avoid artifacts when painting beams.

It might avoid it, but it doesn't explain why it makes sense.
setWidth should be in logical sizes. It gets affected by the view transform.

Beams look ugly when their width is >= 4 pixels.
The idea is to draw them with the same width regardless of DPI.
Another option is to not set Qt::FlatCap for thick pens, but I prefer this one.