Hi Clint,<br><br>Thanks for your reply. I really tried calling ensurePolished() and it still returns the same window size.<br><br>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 :(
<br><br>Here is a bit of code, to see when I am actually querying for the size...<br><br>QHBoxLayout * mainLayout = new QHBoxLayout;<br>mainLayout->addLayout(viewersLayout);<br>mainLayout->addLayout(toolbarLayout);<br>
<br>mainWindow.AddLayout(mainLayout);<br>mainWindow.Pack();<br>// As you can see, I call show before I query the size...<br>mainWindow.showFullScreen();<br><br>// totally bogus values.... <br> int * size = xyViewer->GetSize();
<br><br>Is there a way yo override some of these creation events....???<br><br>Cheers and thanks,<br><br>Anja<br><br><div><span class="gmail_quote">On 25/08/06, <b class="gmail_sendername">Clinton Stimpson</b> <<a href="mailto:clinton@elemtech.com">
clinton@elemtech.com</a>> wro<br>te:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>> Date: Thu, 24 Aug 2006 18:24:46 +0100
<br>> From: "Anja Ende" <<a href="mailto:anja.ende@googlemail.com">anja.ende@googlemail.com</a>><br>> Subject: [vtkusers] size of QVTKWidget<br>> To: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org
</a><br>> Message-ID:<br>> <<a href="mailto:1f5d2b4f0608241024p79b2c47fkeff09ce5cd96d1c2@mail.gmail.com">1f5d2b4f0608241024p79b2c47fkeff09ce5cd96d1c2@mail.gmail.com</a>><br>> Content-Type: text/plain; charset="iso-8859-1"
<br>><br>> Hi everyone,<br>><br>> This might be more of a QT question than a VTK question.<br>><br>> I am having trouble finding the size of a QVTKWidget that hosts a<br>> vtkImageViewer. I want to center the input image and of course I need to
<br>> find the host window size for that.<br>><br>> Does not matter when I call the getRenderWindow()->GetSize() or the QTWidget<br>> size functions it always seems to return the wrong size of the<br>> window...Anything in the range from 640 to 86!
<br>><br>> If anyone has found a way to find the correct size of a QT window, please<br>> let me know.<br>><br>> By the way, the window is contained in a vertical layout manager.<br>><br>> Thanks,<br>
><br>> Anja<br>><br><br>Looks like you are asking for the size of the window before it has been<br>properly sized.<br>If that is what you are doing, then you could call ensurePolished() on<br>the widget or get the QEvent::Polish event, before you ask the size.
<br>Otherwise, just getting the size should work.<br><br>Clint<br><br></blockquote></div><br>