Для добавления в этот список написан метод у основного класса:
def addLineNew(self,line):
print line + "newline\n"
row = self.fileList.rowCount()
print row
self.fileList.setRowCount(row + 1)
self.fileList.setItem(row, 0, QtGui.QTableWidgetItem("03.04.10 15:18"))
self.fileList.setItem(row, 1, QtGui.QTableWidgetItem("Normal"))
self.fileList.setItem(row, 2, QtGui.QTableWidgetItem(line))
class Receive_data(Thread):
def __init__(self):
Thread.__init__(self)
self._main = signalview()
self._want_abort = 0
def run(self):
HOST = "172.16.1.24"
PORT = 9000
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((HOST, PORT))
self._want_abort = 0
while 1:
if self._want_abort:
sock.close()
return
else:
self.receives_data = sock.recv(1024)
temp=self.receives_data.split("#")
for line in temp:
print line + "\n"
self._main.addLineNew(line)
time.sleep(0.2)
sock.close()