Results 1 to 6 of 6

Thread: QtConcurrent Questions and Clarifications

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QtConcurrent Questions and Clarifications

    Quote Originally Posted by OzQTNoob View Post
    Hi Wysota,

    The Extraction function takes a
    Qt Code:
    1. QVector<double>
    To copy to clipboard, switch view to plain text mode 
    as its input and represents a single instance of the mapped input sequence (which I have just noticed is named the same thing e.g spectrain) The mapped spectrain is of the form
    Qt Code:
    1. QVector<QVector<double> >
    To copy to clipboard, switch view to plain text mode 
    . The actual declaration of Extraction within the feature_finder class is given below
    Qt Code:
    1. QVector<QVector<QVector<QVector<double> > > > feature_finder::Extraction(QVector<double> spectrain)
    To copy to clipboard, switch view to plain text mode 
    This is a correct call to mapped then:

    Qt Code:
    1. #include <QtConcurrentMap>
    2. #include <QVector>
    3.  
    4. QVector<QVector<double> > mapFunc(const QVector<double> inData) {
    5. return QVector<QVector<double> >();
    6. }
    7.  
    8. int main(int argc, char **argv) {
    9. QVector<QVector<double> > inVector;
    10.  
    11. QFuture<void> future = QtConcurrent::mapped(inVector, mapFunc);
    12. return 0;
    13. }
    To copy to clipboard, switch view to plain text mode 

    After the thread is done, "inVector" will contain the result of the call.

    Can you expand a little on the
    bit. If I can have a functor set these prior to the call to mapped() then it would help me a lot.
    I'm not sure what to expand. The docs contain an example of using a functor (function object), just have a look at it.

    Since I cant send any updates via QtConcurrent::run
    Why not? You could post some custom events and then grab them and process them elsewhere.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. The following user says thank you to wysota for this useful post:

    OzQTNoob (22nd November 2012)

Similar Threads

  1. QtConcurrent: clarifications needed
    By papillon in forum Qt Programming
    Replies: 5
    Last Post: 28th April 2012, 17:17
  2. QtConcurrent, i need advice
    By SABROG in forum Qt Programming
    Replies: 10
    Last Post: 29th December 2009, 19:53
  3. Why is QtConcurrent so slow?
    By ArlexBee-871RBO in forum Qt Programming
    Replies: 10
    Last Post: 29th December 2009, 10:37
  4. qtconcurrent
    By knishaq in forum Qt Programming
    Replies: 4
    Last Post: 15th December 2009, 08:41
  5. QtConcurrent
    By Brandybuck in forum An Introduction to QThreads
    Replies: 2
    Last Post: 9th May 2008, 14:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.