Is there a way to save a widget's state (size, positions and sizes of child widgets, etc) similar to the way that a QMainWindow stores its toolbars and actual size?

Because my app allows the user to re-size the layout (using horizontal and vertical separators), it will likely be desirable to save any changes to the layout so that they can be applied on the next run.