Results 1 to 2 of 2

Thread: QtConcurrent::mappedReduced

  1. #1
    Join Date
    Jun 2010
    Posts
    38
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Question QtConcurrent::mappedReduced

    Qt Code:
    1. QStringList PaltUnit::dayMap(QStringList s)
    2. {
    3. ......
    4. }
    5.  
    6. void PaltUnit:upReduce(QStringList &res,QStringList s)
    7. {
    8. ......
    9. }
    10.  
    11. QStringList PaltUnit::solutionPick()
    12. {
    13. QVector<QStringList> vec;
    14.  
    15. vec = divStockData(DIVIDEDAYS);
    16.  
    17. QFuture<QStringList> res = QtConcurrent::mappedReduced<QStringList>(vec, dayMap, upReduce);
    18.  
    19. return res;
    20. }
    To copy to clipboard, switch view to plain text mode 

    the buildissues will show : argument of type 'QStringList(PaltUnit::*)(QStringList)' does not match 'QStringList(PaltUnit::*)(QStringList)' ï¼›
    QStringList(PaltUnit::*)(QStringList) is not a class,struct, or union type

    If I made "dayMap" and "upReduce" to be globe function, then will build pass. Why..?

    So If I want made "dayMap" and "upReduce" still be the member functions of the PaltUnit, what should I do?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QtConcurrent::mappedReduced

    Quote Originally Posted by wookoon View Post
    If I made "dayMap" and "upReduce" to be globe function, then will build pass. Why..?
    There are numerous problems with your current call.

    So If I want made "dayMap" and "upReduce" still be the member functions of the PaltUnit, what should I do?
    One thing would be to make them static.

    But in the current for your code makes completely no sense, you might want to use blockingMappedReduced() instead.
    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.


Similar Threads

  1. QtConcurrent mappedReduced QFuture Core Dump
    By shawno in forum Qt Programming
    Replies: 0
    Last Post: 16th July 2010, 03:29
  2. Partial results with mappedReduced
    By 0x4e84 in forum Qt Programming
    Replies: 8
    Last Post: 16th March 2010, 11:29
  3. qtconcurrent
    By knishaq in forum Qt Programming
    Replies: 4
    Last Post: 15th December 2009, 09:41
  4. Reduce Functor in QtConcurrent::mappedReduced
    By ksrarc in forum Qt Programming
    Replies: 1
    Last Post: 12th June 2009, 20:22
  5. QtConcurrent
    By Brandybuck in forum An Introduction to QThreads
    Replies: 2
    Last Post: 9th May 2008, 15:10

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.