Prevent QDockWidget autosizing behaviour
<p>Qt 5.5.0</p>

<p>In my application, I have a QGraphicsView as the main widget and a QDockWidget for properties.
The goal is for the user to select an item in the graphics view and, depending on the item, present the appropriate properties for that item.</p>

<p>I achieve this by having a properties manager widget with a layout containing each of the properties widgets. I have signals and slots hooked up for getting the currently selected item, and then show() the widget I need and hide() the rest.</p>

<p>This works great! However, when selecting different items, the dock shrinks or grows based on the shown widget. It is very jarring, and rather annoying. The thing is though, that when the user manually resizes the dock, it maintains that size. I want the maintained size to be default rather than this autosizing behaviour.</p>

<hr>

<p><strong>Things I've tried:</strong></p>

<p>I've tried changing the sizePolicy() of the dock and the mainwindow: No effect.</p>

<p>I've set a minimum size for my properties manager which does indeed prevent the dock from shrinking when a smaller set of properties is shown. However, I still want the user to be able to shrink the dock to a smaller size if they wish, and this method prevents that...</p>

<hr>

<p>Conclusion:</p>

<p>Is there a flag or something that is set when the user resizes the dock that tells it to maintain that size? If so, is there a way to manually set it? </p>

<p>I haven't tried subclassing QDockWidget or QMainWindow yet. Is there a method(s) that I can override to achieve the correct behaviour?</p>

<p>Thanks for any help!</p>