To render a QImage I use the QLabel class. I draw a cube that rotates in space. QImage form itself pixel by pixel (except fill the background - fill (QColor)). I start the rotation cycle for 10,000 iterations (one iteration is a rotation by gr) and all the time around 1500 - 2000 the image freezes, but the program does not break. When the loop ends, the cube is displayed in the final state. With the new launch, the old cube pattern is not strangely lagging behind (the new one rotates and the old in the final state). The question is why the image freezes and despite the fill, before drawing each frame, the old cube remains (it does not move).

    3 answers 3

    As far as I know, the drawing of your cube should be hung on a separate thread. Then there should be no suspensions.

    • Good . Thank . I will try to draw in a separate stream - Dmitry Artsukevich

    Show the program code, you can draw in different ways - most likely you do not call emit update () or something like that

      The image ceased to hang when I started to run the entire conveyor on a timer, in fact, what Danil advised)). For the sake of interest, I ran this code (without a timer) on Ubuntu, the cube twisted, but the OS then started to consider the program hung (the program worked as before, but the program window was just obscured)