[vtkusers] size of QVTKWidget

Clinton Stimpson clinton at elemtech.com
Sat Aug 26 15:13:18 EDT 2006


> From: "Anja Ende" <anja.ende at googlemail.com>
> Subject: Re: [vtkusers] size of QVTKWidget
> To: vtkusers at vtk.org
>
> Hi Clint,
>
> Thanks for your reply. I really tried calling ensurePolished() and it still
> returns the same window size.
>
> Actually if I query the window size after the exec() has returned, then it
> returns the correct value... But my then it is too late :(
>
> Here is a bit of code, to see when I am actually querying for the size...
>
> QHBoxLayout * mainLayout = new QHBoxLayout;
> mainLayout->addLayout(viewersLayout);
> mainLayout->addLayout(toolbarLayout);
>
> mainWindow.AddLayout(mainLayout);
> mainWindow.Pack();
> // As you can see, I call show before I query the size...
> mainWindow.showFullScreen();
>
> // totally bogus values....
> int * size = xyViewer->GetSize();
>
> Is there a way yo override some of these creation events....???
>
> Cheers and thanks,
>
> Anja
>   

It appears the full screen thing makes the difference.  The reason why, 
I'm not sure.
Delayed initialization is done by getting the polish event.  But in this 
case, the resize appears to be done after the polish event.  I expect 
the resize to be before the polish.
It behaves the same whether it is a normal QWidget or the QVTKWidget.
So I suggest you take your question to the qt interest list, and ask 
them for more information or for a solution.

Clint




More information about the vtkusers mailing list