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-&gt;addLayout(viewersLayout);<br>mainLayout-&gt;addLayout(toolbarLayout);<br>
&nbsp;&nbsp;&nbsp; <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.... &nbsp;  <br> int * size = xyViewer-&gt;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> &lt;<a href="mailto:clinton@elemtech.com">
clinton@elemtech.com</a>&gt; 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>&gt; Date: Thu, 24 Aug 2006 18:24:46 +0100
<br>&gt; From: &quot;Anja Ende&quot; &lt;<a href="mailto:anja.ende@googlemail.com">anja.ende@googlemail.com</a>&gt;<br>&gt; Subject: [vtkusers] size of QVTKWidget<br>&gt; To: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org
</a><br>&gt; Message-ID:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<a href="mailto:1f5d2b4f0608241024p79b2c47fkeff09ce5cd96d1c2@mail.gmail.com">1f5d2b4f0608241024p79b2c47fkeff09ce5cd96d1c2@mail.gmail.com</a>&gt;<br>&gt; Content-Type: text/plain; charset=&quot;iso-8859-1&quot;
<br>&gt;<br>&gt; Hi everyone,<br>&gt;<br>&gt; This might be more of a QT question than a VTK question.<br>&gt;<br>&gt; I am having trouble finding the size of a QVTKWidget that hosts a<br>&gt; vtkImageViewer. I want to center the input image and of course I need to
<br>&gt; find the host window size for that.<br>&gt;<br>&gt; Does not matter when I call the getRenderWindow()-&gt;GetSize() or the QTWidget<br>&gt; size functions it always seems to return the wrong size of the<br>&gt; window...Anything in the range from 640 to 86!
<br>&gt;<br>&gt; If anyone has found a way to find the correct size of a QT window, please<br>&gt; let me know.<br>&gt;<br>&gt; By the way, the window is contained in a vertical layout manager.<br>&gt;<br>&gt; Thanks,<br>
&gt;<br>&gt; Anja<br>&gt;<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>