In a separate component of my application that I want to keep free of Qt dependency I am using std::thread
for some operations. I want to make changes in my main application during the processing. For that I have attempted to pass a function (i.e.: function<void(UpdateNode*)> nodeUpdatedCallback
) to my component from my application.
This function updates the UI, but since I am calling that function from another thread, Qt says that I cannot access the UI from a non main thread.
I have seen many articles to solve this issue by using QThread
and signals, creating a worker and moving it to that thread.
Since I want to use std::thread
, is it possible to update a UI based on Qt using std::thread
?