How to make separate thread for a callback function using QtConcurrent?
-
How to make separate thread for a callback function using QtConcurrent?
a statement for a bit clarity:
camera->requestCompleted.connect(this, &TestCam::requestComplete);
where requestComplete is a function@Renu Why do you need a thread?
If you really need a thread then use a worker object which implements that slot and runs in another thread. The connect statement will make sure the slot is called in that other thread (don't use DirectConnection!). -
@Renu Why do you need a thread?
If you really need a thread then use a worker object which implements that slot and runs in another thread. The connect statement will make sure the slot is called in that other thread (don't use DirectConnection!). -
@jsulm Is it not possible to use QtConcurrent to create a separate thread for the asked question?
@Renu Why do you need QtConcurrent?
If you really want to use it you can call https://doc.qt.io/qt-6/qtconcurrent.html#run inside requestComplete to delegate the work to another thread. -
@Renu Why do you need QtConcurrent?
If you really want to use it you can call https://doc.qt.io/qt-6/qtconcurrent.html#run inside requestComplete to delegate the work to another thread.