Object: Cannot create children for a parent that is in a different thread.
(Parent is QTextDocument(0x2451f656940), parent's thread is QThread(0x2451f301980), current thread is Thread1(0x2451f7e6540)
ㅅㅂ이렇게 뜨는데 한쓰래드내에서 작성한코드이거든?
class Thread1(QThread):
#parent = MainWidget을 상속 받음.
def __init__(self, parent):
super().__init__(parent)
self.parent = parent
def run(self):
num = 0
while True:
num += 1
self.parent.num1.setText(str(num))
일케해서 순환할때마다 텍스트 브라우저에 1씩 갱신된 글자 넣으려는데 append로 작성하면 작동은 잘되는데 출력이 한줄씩 게속나오는데
내가원하는건 숫자가 1오를때마다 딱 그숫자만 표시되고싶은데 머가잘못된걸까
댓글 0