Quantcast
Channel: Installation and Deployment
Viewing all articles
Browse latest Browse all 22112

QtConcurrent headers ?

$
0
0
I’m venturing into QtConcurrent for the first time and only have a little experience with threads. I had to use this include (Qt 5.0.2): #include <QtConcurrent/QtConcurrentRun> Is this correct ? I tried #include <QtConcurrentRun> #include <QtConcurrent> #include <QConcurrent> but they did not work for me. A few comments: The documentation is frustratingly minimal about using QtConcurrent. As a namespace of Qt, nowhere does it say the form of the above include and QtConcurrent doesn’t come under the documentation class index. In https://qt-project.org/doc/qt-5.0/qtcore/threads-qtconcurrent.html the QtConcurrent namespace functions are not linked. This page also says that QtConcurrent is a module. That suggests that your project file needs a line of QT += concurrent. But this is not the case. There is a need for some simple examples (preferably Qt 5) that do not talk about mutexes or thread pools or other thread related issues; just a simple explanation that you can write a non-blocking function that will be executed asynchronously and you can have a callback via signals/slots. Then various examples of forms of external functions, member functions, static member functions, arguments, maps etc. Also please mention somewhere that QFuture can be created on the stack but QFutureWatcher is created on the heap and you should delete it when you are done. If someone could please write a nice article about this I think it would be very useful ;)

Viewing all articles
Browse latest Browse all 22112

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>