Search code examples
qtboost-thread

Qt update GUI with boost threads


i am using boost thread for collecting images from camera and i call Qt signal whenever new image arrives. Now when this signal is emitted the connected slot run in which i am updating the widget the control comes to my slot but it dont update the widget while it prints on console for debugging. My question is whether this slot runs in main thread or in the thread which is emitting the signal and how to achieve the desired update? Thanks


Solution

  • The slot will run in whatever thread created the Qt widget. Qt will use a QueuedConnection on cross thread signals and slots.

    Edit: This may be useful signal qt from a non-qt thread, QueuedConnection

    Are you blocking the main thread?