D13570: Add workaround for labels with word-wrapping
This revision was automatically updated to reflect the committed changes. Closed by commit R236:e8519d6af2ad: Add workaround for labels with word-wrapping (authored by elvisangelaccio). REPOSITORY R236 KWidgetsAddons CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D13570?vs=37669=39070 REVISION DETAIL https://phabricator.kde.org/D13570 AFFECTED FILES src/kcollapsiblegroupbox.cpp tests/kcollapsiblegroupboxtest.cpp To: elvisangelaccio, davidedmundson, cfeck Cc: anthonyfieroni, ngraham, kde-frameworks-devel, michaelh, bruns
D13570: Add workaround for labels with word-wrapping
cfeck accepted this revision. cfeck added a comment. This revision is now accepted and ready to land. Please commit until we find a better solution. REPOSITORY R236 KWidgetsAddons BRANCH workaround-wordwrap (branched from master) REVISION DETAIL https://phabricator.kde.org/D13570 To: elvisangelaccio, davidedmundson, cfeck Cc: anthonyfieroni, ngraham, kde-frameworks-devel, michaelh, bruns
D13570: Add workaround for labels with word-wrapping
anthonyfieroni added inline comments. INLINE COMMENTS > kcollapsiblegroupbox.cpp:307-308 > +if (label->wordWrap()) { > +toggle(); > +toggle(); > +} Did you know why it should be called twice? Does one later toggle invoke will fix it? REPOSITORY R236 KWidgetsAddons REVISION DETAIL https://phabricator.kde.org/D13570 To: elvisangelaccio, davidedmundson, cfeck Cc: anthonyfieroni, ngraham, kde-frameworks-devel, michaelh, bruns
D13570: Add workaround for labels with word-wrapping
elvisangelaccio updated this revision to Diff 37669. elvisangelaccio added a comment. - Added bug report REPOSITORY R236 KWidgetsAddons CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D13570?vs=36232=37669 BRANCH workaround-wordwrap (branched from master) REVISION DETAIL https://phabricator.kde.org/D13570 AFFECTED FILES src/kcollapsiblegroupbox.cpp tests/kcollapsiblegroupboxtest.cpp To: elvisangelaccio, davidedmundson, cfeck Cc: kde-frameworks-devel, michaelh, ngraham, bruns
D13570: Add workaround for labels with word-wrapping
elvisangelaccio edited the summary of this revision. REPOSITORY R236 KWidgetsAddons REVISION DETAIL https://phabricator.kde.org/D13570 To: elvisangelaccio, davidedmundson, cfeck Cc: kde-frameworks-devel, michaelh, ngraham, bruns
D13570: Add workaround for labels with word-wrapping
elvisangelaccio planned changes to this revision. elvisangelaccio added a comment. There is no bugreport, I'll have to file one. While working on a minimal test case I realized that `QBoxLayout::addStretch()` might also be involved. Needs more investigation. REPOSITORY R236 KWidgetsAddons REVISION DETAIL https://phabricator.kde.org/D13570 To: elvisangelaccio, davidedmundson, cfeck Cc: kde-frameworks-devel, michaelh, ngraham, bruns
D13570: Add workaround for labels with word-wrapping
cfeck added a comment. Could you add a bug number so that people reading the code can decide if/when the workaround can get removed? REPOSITORY R236 KWidgetsAddons REVISION DETAIL https://phabricator.kde.org/D13570 To: elvisangelaccio, davidedmundson, cfeck Cc: kde-frameworks-devel, michaelh, ngraham, bruns
D13570: Add workaround for labels with word-wrapping
elvisangelaccio added a comment. Ping. If no one has objections, I'll push it after the next tag. REPOSITORY R236 KWidgetsAddons REVISION DETAIL https://phabricator.kde.org/D13570 To: elvisangelaccio, davidedmundson, cfeck Cc: kde-frameworks-devel, michaelh, ngraham, bruns
D13570: Add workaround for labels with word-wrapping
elvisangelaccio added a reviewer: cfeck. REPOSITORY R236 KWidgetsAddons REVISION DETAIL https://phabricator.kde.org/D13570 To: elvisangelaccio, davidedmundson, cfeck Cc: kde-frameworks-devel, michaelh, ngraham, bruns
D13570: Add workaround for labels with word-wrapping
elvisangelaccio added a comment. Ping? REPOSITORY R236 KWidgetsAddons REVISION DETAIL https://phabricator.kde.org/D13570 To: elvisangelaccio, davidedmundson Cc: kde-frameworks-devel, michaelh, ngraham, bruns
D13570: Add workaround for labels with word-wrapping
elvisangelaccio created this revision. elvisangelaccio added a reviewer: davidedmundson. Restricted Application added a project: Frameworks. Restricted Application added a subscriber: kde-frameworks-devel. elvisangelaccio requested review of this revision. REVISION 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. REPOSITORY R236 KWidgetsAddons BRANCH workaround-wordwrap (branched from master) REVISION DETAIL https://phabricator.kde.org/D13570 AFFECTED FILES src/kcollapsiblegroupbox.cpp tests/kcollapsiblegroupboxtest.cpp To: elvisangelaccio, davidedmundson Cc: kde-frameworks-devel, michaelh, ngraham, bruns