Created attachment 113904 [details] Self-contained test case for the issue If a KCollapsibleGroupBox contains a QLabel with word-wrapping enabled, it will be wrongly positioned in its parent layout. This issue seems to be called by the setFocusPolicy() call in overrideFocusPolicyOf(). Not sure whether the bug is in KCollapsibleGroupBox or in Qt.
Created attachment 113905 [details] Expected layout
Created attachment 113906 [details] Actual layout
Patch available: https://phabricator.kde.org/D13570
Git commit e8519d6af2ad2b9c342a270a915e613bc88dff47 by Elvis Angelaccio. Committed on 04/08/2018 at 15:02. Pushed by elvisangelaccio into branch 'master'. Add workaround for labels with word-wrapping Summary: It's not clear why, but the combination of a word-wrapped QLabel with the `setFocusPolicy()` call in `overrideFocusPolicyOf()` seems to break the positioning of the groupbox in its parent layout. Until we understand where the bug is and how to fix it, we can toggle the groupbox twice when we detect that a QLabel with word-wrapping enabled has been added as child. Not clear why (again), but this fixes (or at least hides) the issue. Test Plan: Apply the patch, then run `kcollapsiblegroupboxtest` with/without the workaround compiled in. Reviewers: davidedmundson Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D13570 M +12 -0 src/kcollapsiblegroupbox.cpp M +6 -0 tests/kcollapsiblegroupboxtest.cpp https://commits.kde.org/kwidgetsaddons/e8519d6af2ad2b9c342a270a915e613bc88dff47
I tested this, and with and without the above commit the issue seems to be fixed.