<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-06-15 14:44 GMT+02:00 Elvis Stansvik <span dir="ltr"><<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi all,<br><br></div>I have a question about this chunk of code in QVTKRenderWindowInteractor.__init__:<br><br> WId = self.winId()<br><br> # Python2<br> if type(WId).__name__ == 'PyCObject':<br> from ctypes import pythonapi, c_void_p, py_object<br><br> pythonapi.PyCObject_AsVoidPtr.restype = c_void_p<br> pythonapi.PyCObject_AsVoidPtr.argtypes = [py_object]<br><br> WId = pythonapi.PyCObject_AsVoidPtr(WId)<br><br> # Python3<br> elif type(WId).__name__ == 'PyCapsule':<br> from ctypes import pythonapi, c_void_p, py_object, c_char_p<br><br> pythonapi.PyCapsule_GetName.restype = c_char_p<br> pythonapi.PyCapsule_GetName.argtypes = [py_object]<br><br> name = pythonapi.PyCapsule_GetName(WId)<br><br> pythonapi.PyCapsule_GetPointer.restype = c_void_p<br> pythonapi.PyCapsule_GetPointer.argtypes = [py_object, c_char_p]<br><br> WId = pythonapi.PyCapsule_GetPointer(WId, name)<br><br> self._RenderWindow.SetWindowInfo(str(int(WId)))<br><br></div>On which platforms will these two code blocks kick in? (i.e., when is winId() a PyCObject or PyCapsule?). It seems on Linux/X11 they do not, since winId() returns a sip.voidptr which can be used directly in the SetWindowInfo call.<br></div></div></div></blockquote><div><br></div><div>I also have a related question: On the C++ side of things, looking at <span class="">QVTKWidget2::SetRenderWindow</span>, it seems that QVTKWidget2 doesn't use the SetWindowInfo(...) approach that QVTKRenderWindowInteractor uses. Instead it seems to simply do <span class="">this</span>-><span class="">mRenWin</span>-><span class="">SetMapped</span>(<span class="">1</span>) and then resize the renderwindow to cover the widget (and keep it covering when the widget geometry changes). Anyone know the reasons for choosing one approach over the other, or at least why this approach was chosen for QVTKWidget2?<br><br></div><div>Elvis<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br></div>Thanks in advance,<br></div>Elvis<br><br></div>
</blockquote></div><br></div></div>