HiDPI rendering improvement
AbandonedPublic

Authored by guoyunhe on Sat, Sep 7, 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.Sat, Sep 7, 4:39 PM
Restricted Application added a subscriber: kde-utils-devel. · View Herald TranscriptSat, Sep 7, 4:39 PM
guoyunhe requested review of this revision.Sat, Sep 7, 4:39 PM
guoyunhe edited the summary of this revision. (Show Details)Sat, Sep 7, 4:41 PM
guoyunhe updated this revision to Diff 65588.EditedSat, Sep 7, 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.Mon, Sep 9, 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.Tue, Sep 10, 3:16 PM

Update Qt version requirement

guoyunhe marked an inline comment as done.Tue, Sep 10, 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.Wed, Sep 11, 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.Mon, Sep 16, 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