HiDPI rendering improvement
AbandonedPublic

Authored by guoyunhe on Sep 7 2019, 4:39 PM.

Details

Reviewers
None
Group Reviewers
KDE Applications
Summary

Make UI look sharp in HiDPI display. Following this wiki https://techbase.kde.org/Development/Tutorials/Graphics/HiDPI

Before (@1.5):

After (@1.5):

Diff Detail

Repository
R352 Filelight
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 16335
Build 16353: arc lint + arc unit
guoyunhe created this revision.Sep 7 2019, 4:39 PM
Restricted Application added a subscriber: kde-utils-devel. · View Herald TranscriptSep 7 2019, 4:39 PM
guoyunhe requested review of this revision.Sep 7 2019, 4:39 PM
guoyunhe edited the summary of this revision. (Show Details)Sep 7 2019, 4:41 PM
guoyunhe updated this revision to Diff 65588.EditedSep 7 2019, 4:50 PM

Replace QFontMetrics::width() (obsolete) with QFontMetrics::horizontalAdvance()

GB_2 added a subscriber: KDE Applications.

Are you sure horizontalAdvance() is the correct thing here? boundingRect().width() seems more appropriate to me.

Are you sure horizontalAdvance() is the correct thing here? boundingRect().width() seems more appropriate to me.

I only visually tested it. Tooltips and labels are all in good position and sizes.

aacid added a subscriber: aacid.Sep 9 2019, 1:59 PM
aacid added inline comments.
src/progressBox.cpp
92

This increases the Qt dependency to 5.11, please change the CMakeLists.txt accordingly (or maybe try to use bondingRect and see if that works since that doesn't need a newer Qt than we need at tis point)

guoyunhe updated this revision to Diff 65773.Sep 10 2019, 3:16 PM

Update Qt version requirement

guoyunhe marked an inline comment as done.Sep 10 2019, 3:19 PM
guoyunhe added inline comments.
src/progressBox.cpp
92

@aacid I updated dependency to Qt 5.11. According to the previous deprecation message from compiler, it suggests to use horizontalAdvance instead of boundingRect. I am not sure about the reason. But from the result, horizontalAdvance did the exact same thing as width function.

guoyunhe marked an inline comment as done.Sep 11 2019, 9:14 AM

According to Qt's source code, horizontalAdvance() is the exact replacement of width(), while boundingRect() is a different function. So I prefer to have horizontalAdvanced() if it doesn't cause any issues. https://github.com/qt/qtbase/commit/4d88d79aa507777bce40740b21747f656efc074d

guoyunhe abandoned this revision.Sep 16 2019, 1:24 PM

Noticed that someone has changed width() to boundingRect() in master branch. I really hope someone can inform me to change the patch. Otherwise, we can never push it forward... Please review D23993