doggrant
23rd February 2010, 15:08
Hi,
I have a library which contains blocking function calls, which I can't change. Therefore i need to make them non-blocking. I was thinking about using QFuture and QFutureWatcher to do this, since I can pass in the library parameter when creating the furture, and wait on for the finished () signal from the QFutureWatcher to get the result back from the future.
My problem is, i'm not sure where and how i should be destorying the QFuture and QFutureWatcher, since I would create them when making the call to the library, but do not know how to get any references to them when the finished() signal is emitted.
Any ideas, or will they be destroyed automatically when the finished signal is fired.
I have a library which contains blocking function calls, which I can't change. Therefore i need to make them non-blocking. I was thinking about using QFuture and QFutureWatcher to do this, since I can pass in the library parameter when creating the furture, and wait on for the finished () signal from the QFutureWatcher to get the result back from the future.
My problem is, i'm not sure where and how i should be destorying the QFuture and QFutureWatcher, since I would create them when making the call to the library, but do not know how to get any references to them when the finished() signal is emitted.
Any ideas, or will they be destroyed automatically when the finished signal is fired.