I have what I think is probably a simple problem with my layout, but I can't figure out what I'm doing wrong. I'm using designer, so the code is generated, but I can provide it if necessary.

I have a custom widget, which is designed to scale its self gracefully, and works well when stretching (you can use the generic "Widget" widget, if you want to try to replicate my problem). Below it, I have a horizontal spacer, a label, a fixed-width spin box, and another horizontal spacer. To keep the label and spin box centered, I grouped them and the spacers into a QHBoxLayout.

Me desired behavior is: My custom widget should expand as necessary, and the spin box layout should remain the same height. At first I grouped the widget and the spin box layout into a QVBoxLayout--oops! I realized my mistake, and grouped them into a vertical QSplitter instead.

The QSplitter works mostly as expected, but when stretching vertically, there comes a point there the spin box layout starts to stretch vertically--the child widgets don't stretch, just the layout its self.

As I said, I'd like the only child element doing any vertical expansion to be the custom widget. Can I somehow set the height of the spin box layout to a fixed dimension, or should I group them with something else?

Thanks!