[Qt-interest] QtConcurrent::run() and updating progress bar

Marius Roets roets.marius at gmail.com
Mon Sep 27 00:19:14 CEST 2010


Nevermind. Apparently QtConcurrent::run() does not support progress
reporting, so I had to create a QThread object.

Regards
Marius

On Sun, Sep 26, 2010 at 5:44 PM, Marius Roets <roets.marius at gmail.com>wrote:

> Hi everybody,
>
> I'm using QtConcurrent::run to call a method from MyClass like :
>
> MyClass m;
> QFutureWatcher *futureWatcher = new QFutureWatcher<void>;
> connect(futureWatcher, SIGNAL(finished()), this, SLOT(queriesFinished()));
> connect(&m, SIGNAL(runningQuery(const QString&)), this,
> SLOT(runningQuery(const QString&)));
> futureWatcher->setFuture(QtConcurrent::run(m, &MyClass::executeQueries));
>
> MyClass is derived from QObject and emits the "runningQuery(const
> QString&)" signal, saying which query it is currently processing. The main
> thread does not seem to catch this signal though. I'm sure I'm missing
> something obvious, so any suggestions would be very helpful.
>
> Thanks
> Marius
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100927/6a0c7a93/attachment.html 


More information about the Qt-interest-old mailing list