Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qslider is not updated while playing?



  • Is it possible to update the slider and text while playing animation? I'm using time.sleep() because it's necessary to config FPS (frame per second)?
    Untitled.jpg
    Video link


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    With a call to sleep you are blocking the event loop therefore blocking the GUI update as well.

    Rather than sleeping, why not use a QTimer ?


  • Banned

    In short yes it is possible the key is going to make sure you set this up so the Event Handler does not get saturated with the animae stream so that it cannot respond to these other events and no creating a Thread does not solve this inherently but it will make it a bit easier in some ways the biggest problem is going to be that both of these Events have to take place within the Main Event Handler Thread since they both involve QtWidget objects.

    Now I am aware of a utility that allows you to display streaming video that seems to work as if it were in its own process rather than thread and then somehow renders that to your GUI container for it but I have not personally played with this much but I have students that have and are knowledgeable on this if you cannot find a solid answer for this shoot me a PM and I will see if I can hook you up with one of those students

    The utility I think is called CV2 or something like -- so what are you using to display the animae stream?


Log in to reply