It is generally not advisable to rely on size() when the widget has not been shown yet.
sizeHint() can come close provided no other effects influence the window's size (e.g. the windowing system resizing the window).
size() usually has a good initial value when retrieved from showEvent() though.
Cheers,
_
Bookmarks