[Interest] How to detect moment when window/widget fully resized at startup?

André Somers andre at familiesomers.nl
Mon Jan 19 09:53:49 CET 2015


Igor Mironchik schreef op 19-1-2015 om 09:48:
> Hi. I have one not very simple question. I need to know the size of the
> window when it launched and all Qt/OS preparations done.
>
> For example, in main() I launch QWidget::showMaximized(). On my Windows 7
> this leads to resizeEvent( 640, 480 ) -> resizeEvent( 640, 480 ) when
> actual size of the window is( 1366, 706 ). And I don't know when to get
> the size() property of my widget to be sure that it is resized.
>
> How to detect this moment in Qt?
>
> Thank you.
>
Do you mean that you're not getting the resizeEvent to the actual size 
at all? That would be strange.

As for how you know that this is the "final" event: you don't. One way 
would be to wait a little bit when receiving the event before deciding 
to act on it. If you get a new resize event in the mean time, restart 
your wait period.

André



More information about the Interest mailing list