Resolve "QLayout: Attempting to add QLayout "" to otb::Wrapper::QtWidgetParameterGroup "", which already has a layout"
Summary
Create QLayout without a parent in the constructor, as is done in QT documentation.
Rationale
Closes #1645 (closed)
Implementation Details
The QLayout constructor sets the parent's widget layout to this
. In MR !125 (merged) I added this
as default parent to all QObjects (including QLayouts) to avoid potential memory leaks. This is bad idea for layouts because a widget's layout cannot be changed without removing the existing one first. This causes the warning reported in #1645 (closed) for QtWidgetView and QtWidgetParameterGroup because they create a layout not intended for this
. When adding a layout to this
later, the warning is emitted.
Additional notes
Copyright
The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.
Check before merging:
- All discussions are resolved
- At least 2
👍 votes from core developers, no👎 vote. - The feature branch is (reasonably) up-to-date with the base branch
- Dashboard is green
- Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
Edited by Victor Poughon