Use custom QScrollArea with size hint not limited by font size
ClosedPublic

Authored by valeriymalov on Aug 8 2018, 12:35 PM.

Details

Summary

For some reason original QScrollArea has constraint on a size hint
This causes large KCMShell pages open in relatively small windows,
because QScrollArea inside reports small size hint

BUG: 389585

Test Plan

patched 5.48.0 with this, tested networkmanager and few other kcms,
they now seem to open in full size (except for kscreen which has custom sizehint,
it probably needs size hint for the QML area specifically, not the whole window;
and except for opengl that has it's own scrollable area which needs a size hint too)

Diff Detail

Repository
R295 KCMUtils
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
valeriymalov created this revision.Aug 8 2018, 12:35 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptAug 8 2018, 12:35 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
valeriymalov requested review of this revision.Aug 8 2018, 12:35 PM

Context for the size hint limitation this patch is supposed to circumvent: https://code.woboq.org/qt5/qtbase/src/widgets/widgets/qscrollarea.cpp.html#403

ngraham accepted this revision.EditedAug 8 2018, 1:00 PM
ngraham added a subscriber: ngraham.

Wow, this works perfectly for me. I banged my head against this by trying to pass the sizeHint to the existing scrollview, so it makes sense to me know to know that a regular scrollView doesn't respect it. Do you know if there's a Qt bug tracking this? Since we're working around a Qt issue, I'd like a comment in the code with the Qt bug.

Could it be https://bugreports.qt.io/browse/QTBUG-38369?

This revision is now accepted and ready to land.Aug 8 2018, 1:00 PM

OK, great! Could you add a comment in the code indicating that the custom scrollview is a workaround for that bug?

  • add link to qt bug
ngraham accepted this revision.Aug 8 2018, 1:46 PM

Thanks!

Are you waiting for another review before landing this?

I don't know, it's frameworks after all but I guess I can land it today since it's a popular bug. Should I just land it on master since there seem to be no other branches?

Yes please.

This revision was automatically updated to reflect the committed changes.

Thanks so much!