Z
Z
zaordu2021-05-31 21:32:20
PyQt
zaordu, 2021-05-31 21:32:20

Why is the intermediate result of the loop not displayed?

I decided to deal with threads, I wanted to make a window application in which labels would be extended in parallel in 3 different threads
Wrote a function

def multithread(self):
        self.pushButton.setEnabled(False)
        width = self.label.width()
        koef = 50
        for i in range(5):
            self.label.setGeometry((QtCore.QRect(10, 50, width+koef, 41)))
            width = width + koef
            sleep(1)
        self.pushButton.setEnabled(True)

But the fact is that I see only the initial and final result of the function
60b52b4f5b1ec073333215.png

60b52b5c5ef1d048423879.png

. in theory, it works correctly, but why I don’t see the work process, I don’t understand point-blank, please tell me what’s wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zaordu, 2021-05-31
@zaordu

Okay, the problem turned out to be super stupid, it's just that the function had to be checked not by a simple call, but already in the thread :D

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question