Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PySide.QtCore import *
- from PySide.QtGui import *
- import sys
- class CarSocket(QObject):
- logSignal = Signal(str, str)
- def __init__(self):
- super(CarSocket, self).__init__()
- class MainWindow(QMainWindow):
- def __init__(self):
- super(MainWindow, self).__init__()
- self.carSocket = CarSocket()
- self.carSocket.logSignal.connect(self.addToLog)
- def addToLog(self, text, mode='NORMAL'):
- if mode == 'RAW':
- toAdd = text
- else:
- toAdd = "<p>{}</p> \n <hr> \n".format(text)
- # self.log.logEdit.append(toAdd)
- app = QApplication(sys.argv)
- window = MainWindow()
- window.show()
- app.exec_()
- sys.exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement