Qt: Square constraint on window resize
qt, widget
Solution
When `resizeEvent()` is called, the widget already has it's new size. Calling `resize()` from it thus might result in flickering.
You can try reimplementing `QWidget::heightForWidth(int)`; that might work as long as the `QDockWindow` is docked, and Qt's layout managers have control over it. But IIRC, at least on X11, `heightForWidth()` doesn't work on top-level widgets (windows).
Problem
I have a `QDockWidget` with a single square widget inside. I would like the ``QDockWidget to be resizable, but to always maintain a square shape, whereas by default it can be stretched disproportionately. What combination of size policies, size hints, etc. do I need to set to do this?