Quote Originally Posted by jacobP View Post
You say that the blue widget should not show at all, does that mean that a QWidget should always call QWidget::show on himself after he is added to a QLayout ?
No, it depends on the state of the parent when the child is created/added.

Basically a widget shows all its children when it is shown for the first time, but if you show a widget and then add children, they remain hidden until they are shown explicitly.
So what you are seeing is some kind of weird hybrid behavior, quite likely a bug.

Quote Originally Posted by jacobP View Post
For the code being in the constructor, I only did it that way to have the simplest code possible to show my issue. I understand and agree with your point.
I was mostly pointing this out as it would then not trigger your problem.
I.e. the weird behavior would normally not be observable.

Cheers,
_