[Interest] geometry() for a widget that hasn't been shown

John Weeks john at wavemetrics.com
Tue Sep 22 23:57:13 CEST 2015


Thanks, Jan. I thought the same thing, but it didn't help. I even called EnsurePolished() first, having seen such things in the Qt source. But it appears that adjustSize() adjusts child widgets for the current window geometry, and doesn't try to determine an accurate window geometry first.

The fundamental problem is that Qt puts off creating the native window representation (NSWindow or NSView or HWND, etc.) until it is first shown. So until then, there is nothing to measure.

But it does seem as though the cached geometry could be used to return an accurate value. I guess its JIRA bug time...

-John Weeks


> On Sep 22, 2015, at 4:31 AM, Jan Dasselaar <jan at altus-escon.com> wrote:
> 
> Maybe the QWidget::adjustSize() function is what you are looking for.
> I think after calling adjustSize() the geometry() function should give a 
> up to date result.




More information about the Interest mailing list