I've done some more fiddling with the centering of the main widget and got a somewhat solid solution now which works with various combinations of geometry, min_size and width + height.
It will basically go through all and use the biggest it finds. This also "fixes" the "issue" that the window manager can end up overriding width + height.
If these are set and end up being the biggest values found, then the window will end up with exactly that size, instead of letting the manager have the last word and do whatever with that info.
The only remaining issue for me is, that it can still pop up for a single frame in the original position. It seems be a lot less likely to happen by setting size and position with app.mainwindow.geometry(), but it can still happen regardless.
But I guess most people wouldn't really care or even notice, so that's why I'm putting it out in this form.
I think the only way around the popping would be the 'original' solution, which basically asked the .builder what size the main window will likely end up being.
I've done some more fiddling with the centering of the main widget and got a somewhat solid solution now which works with various combinations of
geometry
,min_size
andwidth
+height
. It will basically go through all and use the biggest it finds. This also "fixes" the "issue" that the window manager can end up overridingwidth
+height
. If these are set and end up being the biggest values found, then the window will end up with exactly that size, instead of letting the manager have the last word and do whatever with that info.The only remaining issue for me is, that it can still pop up for a single frame in the original position. It seems be a lot less likely to happen by setting size and position with
app.mainwindow.geometry()
, but it can still happen regardless.But I guess most people wouldn't really care or even notice, so that's why I'm putting it out in this form. I think the only way around the popping would be the 'original' solution, which basically asked the
.builder
what size the main window will likely end up being.