If you can use gui, you can be sure there is an event loop running.
This piece of code does not belong to anything, it's just a pseudo-code, you've asked about advice and here it is - I suggest you to setup a timer to grab frames. Don't forget to call "exec()" in your thread's run() method as well.I can not emit from here because this peace of code is belong to MainGUI
Bookmarks