class ShipHolderApplication(QMainWindow): serialWrite = pyqtSignal(object) def __init__(self, parent=None): super(ShipHolderApplication, self).__init__(parent) self.createWidgets() def createWidgets(self): self.ui = Ui_MainWindow() self.ui.setupUi(self) self.ui.spy_spotted.show() @pyqtSlot(object) def updateData(self, data): print("INCOMING") print(data) print() if data.startswith('$'): self.ui.spy_spotted.setText("UID {}".format(data)) def usingMoveToThread(self): self.serialc = SerialCon() # binding signals: self.serialc.received.connect(self.updateData) self.serialWrite.connect(self.serialc.writeData) # start thread self.serialc.start()
def createWidgets(self): self.ui = Ui_MainWindow() self.ui.setupUi(self) self.ui.spy_spotted.show()