Results 1 to 2 of 2

Thread: QwtPointMapper toImage Can't Use Threads?

  1. #1
    Join Date
    Nov 2017
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default QwtPointMapper toImage Can't Use Threads?

    Hopefully I'm missing something, but it looks to me like QwtPointMapper::toImage() will never use threads.

    I'm trying to plot a large number of points using a QwtPlotCurve with the Dots style. While stepping through the code in debug I noticed that QwtPointMapper::toImage skipped the QFuture/QtConcurrent code based on a preprocessor check, "#if QWT_USE_THREADS".

    I don't see any way for this check to pass. The only define for QWT_USE_THREADS that I can find is at the top of qwt_point_mapper.cpp :
    Qt Code:
    1. #if !defined(QT_NO_QFUTURE)
    2. #define QWT_USE_THREADS 0
    3. #endif
    To copy to clipboard, switch view to plain text mode 
    If QT_NO_QFUTURE isn't defined then QWT_USE_THREADS = 0, and if QT_NO_QFUTURE is defined then QWT_USE_THREADS is not defined. Either way it seems that a subsequent check, "#if QWT_USE_THREADS", will fail.

    Am I misinterpreting the logic?

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,311
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPointMapper toImage Can't Use Threads?

    No you are right. Of course this setting was nonsense and I fixed it in all branches >= 6.1.

    QwtPointMapper::toImage() is relevant for scatter plots, where the values are displayed by a dot of 1 pixel. In this situation multithreading is possible and can improve the performance of the render cycle significantly.

    Uwe

Similar Threads

  1. Qt Threads vs Native Threads performance
    By StackOverflow in forum Qt Programming
    Replies: 1
    Last Post: 14th November 2010, 12:14
  2. whatś the better in Threads
    By Tio in forum Newbie
    Replies: 15
    Last Post: 27th May 2010, 13:14
  3. Qt threads
    By ^Nisok^ in forum Newbie
    Replies: 12
    Last Post: 22nd April 2009, 14:35
  4. Threads...
    By Abc in forum Qt Programming
    Replies: 1
    Last Post: 19th June 2008, 17:35
  5. Once more: Threads in Qt4
    By high_flyer in forum Qt Programming
    Replies: 5
    Last Post: 9th August 2006, 18:35

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.