Skip to content

Instantly share code, notes, and snippets.

@fmorency
Created July 3, 2012 20:29
Show Gist options
  • Save fmorency/3042843 to your computer and use it in GitHub Desktop.
Save fmorency/3042843 to your computer and use it in GitHub Desktop.
VTKMdiSubWindowInteractor example
class QVTKRenderMdiSubWindowInteractor(QMdiSubWindow):
def __init__(self, parent=None,
wflags=Qt.WindowFlags() | Qt.WA_DeleteOnClose):
super(QVTKRenderMdiSubWindowInteractor, self).__init__(parent, wflags)
self.qhbox = QHBoxLayout()
self.qframe = QFrame()
self.vtk_interactor = QVTKRenderWindowInteractor(parent=self.qframe)
self.qhbox.addWidget(self.vtk_interactor)
self.qframe.setLayout(self.qhbox)
self.setWidget(self.qframe)
def closeEvent(self, ev):
self.vtk_interactor.closeEvent(ev)
def GetRenderWindow(self):
return self.vtk_interactor.GetRenderWindow()
def Render(self):
self.GetRenderWindow().Render()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment