There are many possibilities, e.g. using invokeMethod() with Qt::QueuedConnection. Or you can do that the first time the widget is shown (using showEvent()). Or possibly using other means.
There are many possibilities, e.g. using invokeMethod() with Qt::QueuedConnection. Or you can do that the first time the widget is shown (using showEvent()). Or possibly using other means.
In my apps I find it easiest to restore the window state in the showEvent() and to save it in the closeEvent(). You can also restore the state in the constructor if you wish, and it will be applied when the window is shown.
Thank you! I'll try your suggestions. For the moment I am doing my stuff in the resize event only when the top and bottom widgets have size, and only once...
Better to do it in the show event. When this occurs, the widget (and its children) have been properly sized and positioned (by layouts), so you can safely examine their sizes and positions and resize or move them as you wish.I am doing my stuff in the resize event
As you have probably seen, the resize event can be called multiple times, including when widgets have no sizes.
Bookmarks