I have a QHBoxLayout that contains a fixed size spacer, a widget and another fixed size spacer. I connected the resizing signal of another widget to a slot where I would like to update the width of the first spacer, but I cannot find a way to do it. How can I update the width of a spacer that is already in the layout?

I tried creating my own QSpacerItems andd add them to the layout using addItem(), so later on I can call their changeSize(), but it does not have any effect.

Any ideas?

Thanks