-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
48 lines (31 loc) · 1.09 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from PySide.QtCore import *
from PySide.QtGui import *
import sys
import gui_test
import subprocess
import time
import showGui
class MainDialog(QDialog, showGui.Ui_mainDialog):
def __init__(self, parent=None):
super(MainDialog, self).__init__(parent)
self.setupUi(self)
self.showButton.setText("Process")
self.connect(self.showButton, SIGNAL("clicked()"), self.processData)
self.workerThread = WorkerThread()
self.connect(self.workerThread, SIGNAL("threadDone(QString, QString)"), self.threadDone, Qt.DirectConnection)
def processData(self):
self.workerThread.start()
QMessageBox.information(self, "Done!", "Done.")
def threadDone(self, text, text2):
self.nameEdit.setText("Worker thread finished processing.")
print(text)
print(text2)
class WorkerThread(QThread):
def __init__(self, parent=None):
super(WorkerThread, self).__init__(parent)
def run(self):
subprocess.Popen('Python gui_test.py',shell=False)
app = QApplication(sys.argv)
form = MainDialog()
form.show()
app.exec_()