- 论坛徽章:
- 0
|
class Dialog(QDialog, ui_ping.Ui_Dialog):
def __init__(self, parent=None):
super(Dialog, self).__init__(parent)
self.setupUi(self)
self.process = QProcess(self)
self.process.readyRead.connect(self.dataReady)
self.connect(self.pingButton, SIGNAL("clicked()"), self.ping)
self.bl=True
def dataReady(self):
cursor = self.outputEdit.textCursor()
cursor.movePosition(cursor.End)
cursor.insertText(self.process.readAll().data().decode("gb2312"))
self.outputEdit.ensureCursorVisible()
def ping(self):
self.process.start('ping', [self.inputEdit.text()])
self.bl = False
if self.bl == False:
print dir(self.pingButton.setEnabled(self.bl)) |
|