seit 2 Tagen versuche ich verzweifelt das "beendet"-Signal eines QProcess zu verarbeiten.
Hier ein Beispielscript mit welchem sich das Problem reproduzieren lässt.
Code: Alles auswählen
#!/usr/bin/env python
#-*- coding: utf-8
import sys
import os
from PyQt4 import QtCore, QtGui
from frmMain import Ui_MainWindow
class StartQT4(QtGui.QMainWindow):
#
# Initialisation
#
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
# process and slots
self.qp = QtCore.QProcess()
QtCore.QObject.connect(self.qp, QtCore.SIGNAL("started()"), self.qpStart)
# keines dieser Signale wird gesendet
QtCore.QObject.connect(self.qp, QtCore.SIGNAL("stateChanged()"), self.qpStateChanged)
QtCore.QObject.connect(self.qp, QtCore.SIGNAL("finished()"), self.qpExit)
QtCore.QObject.connect(self.qp, QtCore.SIGNAL("readyReadStdout()"), self.qpExit)
QtCore.QObject.connect(self.qp, QtCore.SIGNAL("processExited()"), self.qpExit)
# button
QtCore.QObject.connect(self.ui.btn_get_syx,QtCore.SIGNAL("clicked()"), self.get_syx_clicked)
#
# button
#
def get_syx_clicked(self):
self.ui.textBrowser.append("starting process")
#kleines GUI-Programm welches ich per dann Hand beende
self.qp.start('kcalc')
self.ui.textBrowser.append("process started")
# funktioniert
def qpStart(self):
self.ui.textBrowser.append("[slot] process started")
# funktioniert nicht
def qpExit(self):
self.ui.textBrowser.append("[slot] process exited")
# funktioniert nicht
def qpStateChanged(self):
self.ui.textBrowser.append("[slot] process state changed")
#
# start the main application
#
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
myapp = StartQT4()
myapp.show()
sys.exit(app.exec_())
Hat jemand eine Idee?
TIA darkstorm
PS: Ich bin PyQt-Einsteiger und verwende PyQt4.0.1 and Qt 4.3.3 unter Debian Etch.