how to send data to the second class from the workerthread
-
wrote on 4 Jun 2024, 06:46 last edited by Blackzero 6 Apr 2024, 06:47
I created a multi-threaded class with mainwindow and workerthread class files then I turned on the doWork function from mainwindow on workerthread, but the problem is how can workerthread send the process information to the dialog class called viewproccess, how to solve it?
mainwidow invokes doWork on workerthread then workerthread sends the process information to the viewprocess dialog class, I want it that way. -
I created a multi-threaded class with mainwindow and workerthread class files then I turned on the doWork function from mainwindow on workerthread, but the problem is how can workerthread send the process information to the dialog class called viewproccess, how to solve it?
mainwidow invokes doWork on workerthread then workerthread sends the process information to the viewprocess dialog class, I want it that way.@Blackzero said in how to send data to the second class from the workerthread:
how can workerthread send the process information to the dialog class called viewproccess
By using signals/slots.
The worker class simply emits a signal if it wants to send data. Whoever needs this data connects a slot to that signal.
1/2