Results 1 to 7 of 7

Thread: Simple question about QtConcurrent

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2007
    Location
    Jundiai/SP, Brazil
    Posts
    114
    Thanks
    5
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Simple question about QtConcurrent

    Hi Caduel,

    yes something as:

    class TEST
    {
    public:
    TESTE();

    void funct();
    };

    TESTE test;
    QList<QImage> images = ...;
    QFuture<QImage> thumbnails = QtConcurrent::mapped(images, test.funct(&QImage::scaledToWidth, 100 Qt::SmoothTransformation));

    Now I understand that isn't possible. I must be use static functions for example.
    Like the Wysota explained me

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Simple question about QtConcurrent

    your example is confusing... a function returning void does not make sense with "mapping".

    Qt Code:
    1. class TEST
    2. {
    3. public:
    4. TESTE();
    5.  
    6. QImage funct(const QString&);
    7. };
    8.  
    9. TESTE test;
    10. QLis<QString> files = ...;
    11. QFuture<QImage> pics = QtConcurrent::mapped(files, boost::bind(&TEST::func, &test));
    To copy to clipboard, switch view to plain text mode 
    something like that should work. (Haven't tried it.)

Similar Threads

  1. Simple namespace question
    By JPNaude in forum Qt Programming
    Replies: 3
    Last Post: 30th June 2009, 09:31
  2. QtConcurrent question
    By bair in forum Qt Programming
    Replies: 5
    Last Post: 24th March 2009, 10:46
  3. QTextEdit simple question
    By Marcopolo in forum Qt Tools
    Replies: 4
    Last Post: 11th October 2007, 00:01
  4. simple question on Class-Members
    By mickey in forum General Programming
    Replies: 7
    Last Post: 4th February 2006, 22:37
  5. QTextEdit Qt4: simple question
    By TheKedge in forum Qt Programming
    Replies: 4
    Last Post: 18th January 2006, 12:03

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.