私は PySide を使用しており、Qt アプリを再起動する方法を探しています。これはpythonに依存していますか、それともQtで制御する必要がありますか?
ROSTYSLAVの提案ベローによる:
class MyAppMainWindow(QMainWindow):
def __init__(self):
self.EXIT_CODE_REBOOT = -15123123
exit_code = self.EXIT_CODE_REBOOT
def slotReboot(self):
print "Performing application reboot.."
qApp.exit( self.EXIT_CODE_REBOOT )
def main():
currentExitCode = 0
app = QApplication(sys.argv)
ex = MyAppMainWindow()
while currentExitCode == ex.EXIT_CODE_REBOOT :
currentExitCode = app.exec_()
return currentExitCode
if __name__ == '__main__':
main()
明らかに、私は完全には理解していませんでした。助けてください。