Add workaround for labels with word-wrapping

Authored by elvisangelaccio on Jun 16 2018, 2:09 PM.

Description

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.

CCBUG: 396450

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