Re: [Interest] QThreadPool functionality for QThreads

2017-01-20 Thread Frank Rueter | OHUfx
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

Re: [Interest] QThreadPool functionality for QThreads

2017-01-19 Thread Thiago Macieira
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 mig

Re: [Interest] QThreadPool functionality for QThreads

2017-01-18 Thread Frank Rueter | OHUfx
Thanks Elvis, much appreciated! On 19/01/17 7:55 PM, Elvis Stansvik wrote: 2017-01-19 1:10 GMT+01:00 Thiago Macieira : On quarta-feira, 18 de janeiro de 2017 20:04:41 PST Elvis Stansvik wrote: If you have one QThread that depends on the completion of another, then no, I don't think there's a

Re: [Interest] QThreadPool functionality for QThreads

2017-01-18 Thread Elvis Stansvik
2017-01-19 1:10 GMT+01:00 Thiago Macieira : > On quarta-feira, 18 de janeiro de 2017 20:04:41 PST Elvis Stansvik wrote: >> If you have one QThread that depends on the completion of another, >> then no, I don't think there's a convenient API in Qt to express that >> relationship and run the threads

Re: [Interest] QThreadPool functionality for QThreads

2017-01-18 Thread Frank Rueter | OHUfx
OK, thanks Thiago and Elvis. I think I got the picture now and can proceed knowing I'm not heading into a dead end. Cheers, frank On 19/01/17 1:10 PM, Thiago Macieira wrote: On quarta-feira, 18 de janeiro de 2017 20:04:41 PST Elvis Stansvik wrote: If you have one QThread that depends on the

Re: [Interest] QThreadPool functionality for QThreads

2017-01-18 Thread Thiago Macieira
On quarta-feira, 18 de janeiro de 2017 20:04:41 PST Elvis Stansvik wrote: > If you have one QThread that depends on the completion of another, > then no, I don't think there's a convenient API in Qt to express that > relationship and run the threads in sequence. You'll have to string > them togethe

Re: [Interest] QThreadPool functionality for QThreads (Frank Rueter | OHUfx)

2017-01-18 Thread Frank Rueter | OHUfx
Thanks Tim, yes, that thought had crossed my mind while I was converting to QRunnables. The latter seems to give me the control for what I need in the main controller code without having to adjust the downloader class, so I will see if that behaves through some testing. But it's certainly goo

Re: [Interest] QThreadPool functionality for QThreads

2017-01-18 Thread Frank Rueter | OHUfx
Thanks Elvis. And my apologies (especially to Thiago) for posting a misleading and incopmlete question. I have been playing with converting to QRunner which seems to work fine (haven't tested it thoroughly though). I will have a look at QNetworkAccessManager so I can compare the approaches, t

Re: [Interest] QThreadPool functionality for QThreads

2017-01-18 Thread Elvis Stansvik
2017-01-18 20:11 GMT+01:00 Elvis Stansvik : > 2017-01-18 20:04 GMT+01:00 Elvis Stansvik : >> 2017-01-18 8:17 GMT+01:00 Frank Rueter | OHUfx : >>> Hi Thiago, >>> >>> thanks for your quick reply. I will try and give some more context: >>> I use the python requests module inside my PySide app to post

Re: [Interest] QThreadPool functionality for QThreads

2017-01-18 Thread Elvis Stansvik
2017-01-18 20:04 GMT+01:00 Elvis Stansvik : > 2017-01-18 8:17 GMT+01:00 Frank Rueter | OHUfx : >> Hi Thiago, >> >> thanks for your quick reply. I will try and give some more context: >> I use the python requests module inside my PySide app to post requests to a >> website. Some of those requests re

Re: [Interest] QThreadPool functionality for QThreads

2017-01-18 Thread Elvis Stansvik
2017-01-18 8:17 GMT+01:00 Frank Rueter | OHUfx : > Hi Thiago, > > thanks for your quick reply. I will try and give some more context: > I use the python requests module inside my PySide app to post requests to a > website. Some of those requests return a lot of data that I need to parse to > be abl

Re: [Interest] QThreadPool functionality for QThreads (Frank Rueter | OHUfx)

2017-01-18 Thread Tim Iskander
instead of re-architecting your threading model, could you just tweak the downloader class to take a list of files and then each one would be synchronous. multiple concurrent downloads would each have a list of 1 file. just a thought... -- Tim Iskander Senior Engineer Critical Link LLC (315) 425-

Re: [Interest] QThreadPool functionality for QThreads

2017-01-17 Thread Frank Rueter | OHUfx
Hi Thiago, thanks for your quick reply. I will try and give some more context: I use the python requests module inside my PySide app to post requests to a website. Some of those requests return a lot of data that I need to parse to be able to show progress, other requests are file downloads th

Re: [Interest] QThreadPool functionality for QThreads

2017-01-17 Thread Thiago Macieira
On quarta-feira, 18 de janeiro de 2017 17:21:46 PST Frank Rueter | OHUfx wrote: > Hi, > > I got another threading question for the pros out there: > > In my current application I am using QThread objects and > QObject.moveToThread() to enable my GUI to download multiple files while > updating p

[Interest] QThreadPool functionality for QThreads

2017-01-17 Thread Frank Rueter | OHUfx
Hi, I got another threading question for the pros out there: In my current application I am using QThread objects and QObject.moveToThread() to enable my GUI to download multiple files while updating progress bars in the main event loop. This is the respective snippet of code: self.