Bug 414218 - KConfigDialog wraps pages in QScrollArea; KPageDialog does not
Summary: KConfigDialog wraps pages in QScrollArea; KPageDialog does not
Status: CONFIRMED
Alias: None
Product: frameworks-kconfigwidgets
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.64.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-17 01:54 UTC by Mariusz Glebocki
Modified: 2022-03-24 21:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
KConfigDialog vs KPageDialog - demo sources & screenshot (41.89 KB, application/gzip)
2019-11-17 01:54 UTC, Mariusz Glebocki
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mariusz Glebocki 2019-11-17 01:54:14 UTC
Created attachment 123962 [details]
KConfigDialog vs KPageDialog - demo sources & screenshot

KConfigDialog, unlike KPageDialog, wraps all pages added through its API (i.e. all pages we want to be managed) in QScrollArea. This is something unexpected - either both classes should wrap pages, or none of them. Especially when documentation (and common sense) suggests that KConfigDialog is a KPageDialog with built-in config management.

The dialog with QScrollArea sometimes will not adjust its size to its pages, even when it would be possible. This happens at least when resulting height would be larger than 2/3 of the screen height. In this case scrollbar appears, even when everything would fit without it on window few pixels higher. This is Qt thing, but it does not happen when window min size is in effect, e.g. in KPageDialog.

KDE HIG[1][2] recommends that config dialogs should not be scrollable, and this behavior makes it harder/impossible on smaller resolutions. For example: Konsole configuration dialog is made to fit on 800x600 screen, yet with KConfigDialog scrollbars appeared even on 1366x768 (the scrollbarless window is ~560px high). This has been solved with KPageDialog.

Small demo attached. Please adjust `checkboxesCount` for your resolution.

[1] https://hig.kde.org/components/navigation/dialog.html#behavior
[2] https://hig.kde.org/platform/settings.html?highlight=configuration#appearance (this is for system settings, but regular configuration dialogs should be consistent with it IMO)
Comment 1 Soren Stoutner 2022-03-24 21:51:11 UTC
I would like to note that this behavior is particularly annoying in instances where the size of the information displayed in KConfigDialog changes programmatically in response to user interaction.  A standard QDialog window will auto resize (if possible) to display the contents if screen room is available.  Even if `KConfigDialog::setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)` is explicitly set, the QScrollArea prevents this from functioning correctly.