Details
Description
See attached code with a QTableWidget inside a QDockWidget. If the user does any moving of the splitter for the dock widget, that positioning will be lost on any subsequent window resize.
Also, default size policy of the QTableWidget or setting it to (Expanding, Expanding) will only show one column. Overriding the sizeHint() seems the only way to get it to size to two columns.
Reproduce by:
- Dragging the splitter a bit from its starting position (could be expansion, could be contraction--doesn't matter)
- Now drag the bottom edge of the window down a bit, and snap, it jumps back to the initial size (the sudden jump occurs right when the mouse first starts dragging).
Changing the horizontal size policy from QSizePolicy::Preferred to QSizePolicy::Ignored doesn't seem to influence this behavior, not calling setStretchLastSection() doesn't seem to help either.
Expected behavior:
If the window is resized only vertically, the horizontal splitter should not move at all...and if it's resized horizontally then something more gradual should happen than a jump.
Default behavior of QTableWidget should act as with the overridden sizeHint(), or failing that, setting to (Expanding, Expanding) should do it.