Answer the question
In order to leave comments, you need to log in
How is real-time graphics displayed in Qt applications?
As a matter of fact, here's what it's about.
There is an application on Qt for Windows, in which, upon receipt of an event from an external device, draw a light animation - for example, blink the image of a saber in the middle of the screen and then move it to a corner. This means:
1) something has already been drawn.
2) an event came via USB - I IMMEDIATELY draw a saber in the middle.
3) "blinking" - this means that for a couple of seconds, several times smooth transitions from transparency to a vector image and back.
4) then this vector picture smoothly “flies” into the corner.
"Vector" means that a set of filled curves is drawn.
“Smoothly” means that intermediate states of the image are drawn at short intervals.
QUESTION: how is such a smooth animation done? As I understand it, you need to start some timer (QBasicTimer?) for a short period (10 ... 20 msec) and start repaint with drawing (or output of prepared QPixmap?). I tried to do this, but the smoothness did not work out - the gaps come out clearly unequal. Yes, and the timer clicks much slower than we would like.
And the processor is heavily loaded, it seems.
But somehow images flicker in Opera? .. Yes, and in other programs there are smooth flickering of images. Finally, in the computer In games, this issue is somehow solved without a terrible CPU load.
Please tell me how this is done.
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question