The QVTKRenderWindowInteractor class for qt4 defines resizeEvent method like this:<br><br><span style="font-family: courier new,monospace;"> def resizeEvent(self, ev):</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> w = self.width()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> h = self.height()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> self._RenderWindow.SetSize(w, h)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> self._Iren.SetSize(w, h)</span><br>
<br>This works ok on Linux, but on windows 7 x64 it leads to incosistent behavior. Try to run the attached example (it places the Interactor within a QGridLayout inside a QFrame) and change the tiling of the windows from the menu. You will notice that the size of the rendererwindow takes more place than it should.<br>
<br>If I override the resizeEvent method like this (essentially omitting the _RenderWindow.SetSize() method) it works ok on both linux and win 7.<br><br><span style="font-family: courier new,monospace;"> def resizeEvent(self, ev):</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> w = self.width()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> h = self.height()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> self._Iren.SetSize(w, h)</span><br><br>So, is there a reason for setting explicitly _RenderWindow's size or is it redundant?<br><br>Just for the record, the QVTKRenderWindowInteractor class for qt defines resizeEvent method like this (e.g. the same as the override method + calling the configureEvent method):<br>
<br><span style="font-family: courier new,monospace;"> def resizeEvent(self,ev):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> size = self.size()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> self._Iren.SetSize(size.width(), size.height())</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> self._Iren.ConfigureEvent()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> self.update()</span><br><br>So the questions are the following ones:<br>1. Are there any scenarios where setting the _RenderWindow's size is necessary?<br>2. Calling the ConfigureEvent method is necessary?<br>
<br>If the answer is no to both questions, then the resizeEvent method could be simplified to this<br><span style="font-family: courier new,monospace;"><br> def resizeEvent(self, ev):</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> w = self.width()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> h = self.height()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> self._Iren.SetSize(w, h)</span><br><br>with regards,<br>Panos<br>