def closeEvent(self, event): self.im2d.closeEvent(QtGui.QCloseEvent()) self.imboxed.closeEvent(QtGui.QCloseEvent()) self.improj.closeEvent(QtGui.QCloseEvent()) self.imslice.closeEvent(QtGui.QCloseEvent()) self.imvol.closeEvent(QtGui.QCloseEvent()) event.accept()
def runto(self): try: self.path = QtCore.QFileInfo(self.filename).path() except AttributeError: pass g = globals() os.chdir(str(self.path)) os.path.join(os.path.expanduser('~'), os.path.expandvars(str(self.path))) script = str(self.codebox.text()) try: exec (script, g) QtGui.QCloseEvent() except ImportError: os.chdir(str(self.path)) os.path.join(os.path.expanduser('~'), os.path.expandvars(str(self.path))) sys.path.append(str(self.path)) exec (script, g) QtGui.QCloseEvent() if TypeError (QTextStream): g = globals() os.chdir(str(self.path)) os.path.join(os.path.expanduser('~'), os.path.expandvars(str(self.path))) sys.path.insert(0, str(self.path)) exec int(script) QtGui.QCloseEvent()
def slotQuit(self): self.app.postEvent(self, QtGui.QCloseEvent())