QRunnables with QThreadPool seem to work great in my case.
I am instantitating my main worker class inside the QRunnable now to be able send signals via that (e.g. runnable.worker.signal.emit()). I tried multiple inheritance to just have one QRunnable class that can emit signals, but that didn't work, e.g.:
    class MyRunable(QtCore.QObject, QtCore.QRunnable()

But I'm happy with my solution now, so thanks everybody for contributing.

frank

On 20/01/17 3:08 PM, Thiago Macieira wrote:
On quinta-feira, 19 de janeiro de 2017 07:55:12 PST Elvis Stansvik wrote:
Frank, another threading approach in Qt which we haven't mentioned yet
is QtConcurrent. I use that myself in an application where I had to
load a series of large tomographic volumes using VTK (so blocking
I/O). It might not be a good fit for your use case, but thought I
should mention it for brevity.
Or you can use Thread Building Blocks too.


_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to