Results 1 to 17 of 17

Thread: Check perfomance of QwtPlotCurve with setPaintAttribute for displaying large data

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Nov 2019
    Posts
    31
    Thanks
    8
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Check perfomance of QwtPlotCurve with setPaintAttribute for displaying large data

    Uwe,

    I'm trying to explore QwtPlotOpenGLCanvas. I successfully built QWT 6.3.0 from SVN trunk.
    I found your discussion about perfomance and OpenGL issues: https://www.qtcentre.org/threads/666...ming-is-*SLOW*
    Now I can run your code from there. But when I change canvas to QwtPlotOpenGLCanvas *canvas = new QwtPlotOpenGLCanvas(); my launched application looks like green window (black or yellow on the picture) without curves. And there is a warning:
    DXGI WARNING: IDXGIFactory::CreateSwapChain: Blt-model swap effects (DXGI_SWAP_EFFECT_DISCARD and DXGI_SWAP_EFFECT_SEQUENTIAL) are legacy swap effects that are predominantly superceded by their flip-model counterparts (DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL and DXGI_SWAP_EFFECT_FLIP_DISCARD). Please consider updating your application to leverage flip-model swap effects to benefit from modern presentation enhancements. More information is available at http://aka.ms/dxgiflipmodel. [ MISCELLANEOUS WARNING #294: ]
    QSize(600, 400) 0

    Since I'm not quite familiar with graphics and OpenGL it is difficult to understand what is blamed for this app behaviour.
    If you know something that possibly could help with that please give me a hint.

    I'm on Windows 10 x64, DirectX 12, Qt 5.14.1, compilator MSVC 2017 x64.

    Here is the code that I use:
    Qt Code:
    1. #include <QApplication>
    2. #include <QElapsedTimer>
    3. #include <qwt_plot.h>
    4. #include <qwt_plot_curve.h>
    5. #include <qwt_plot_canvas.h>
    6. #include <qwt_plot_opengl_canvas.h>
    7. #include <QtMath>
    8. #include <QDebug>
    9. #include <QtOpenGL>
    10.  
    11. class MyPlot: public QwtPlot
    12. {
    13. public:
    14. MyPlot()
    15. {
    16. const int numPoints = 10;
    17.  
    18. //QwtPlotCanvas* canvas = new QwtPlotCanvas();
    19. QwtPlotOpenGLCanvas *canvas = new QwtPlotOpenGLCanvas(); // NEW OpenGL Canvas
    20. #if 0
    21. canvas->setPaintAttribute( QwtPlotCanvas::OpenGLBuffer, true );
    22. #endif
    23. setCanvas( canvas );
    24. setCanvasBackground( Qt::white );
    25. setAxisScale( QwtPlot::yLeft, -1.5, 1.5 );
    26. setAxisScale( QwtPlot::xBottom, 0.0, numPoints );
    27.  
    28. QwtPlotCurve *curve = new QwtPlotCurve();
    29. curve->setTitle( "Some Points" );
    30. curve->setPaintAttribute(QwtPlotCurve::FilterPointsAggressive, true);
    31.  
    32. QPolygonF points;
    33. for ( int i = 0; i < numPoints; i++ )
    34. points += QPointF( i, qSin( i ) );
    35.  
    36. curve->setSamples( points );
    37. curve->attach( this );
    38. }
    39.  
    40. virtual void drawCanvas( QPainter *painter )
    41. {
    42. QElapsedTimer timer;
    43. timer.start();
    44.  
    45. QwtPlot::drawCanvas( painter );
    46.  
    47. qDebug() << size() << timer.elapsed();
    48. }
    49. };
    50.  
    51. int main( int argc, char **argv )
    52. {
    53. QApplication a( argc, argv );
    54.  
    55. MyPlot plot;
    56.  
    57. plot.resize( 600, 400 );
    58. plot.show();
    59.  
    60. return a.exec();
    61. }
    To copy to clipboard, switch view to plain text mode 
    1.png
    Last edited by Vasya; 26th March 2020 at 22:14.

Similar Threads

  1. Replies: 3
    Last Post: 15th February 2017, 09:57
  2. Storing and displaying "large" amount of data
    By FreddyKay in forum Qt Programming
    Replies: 4
    Last Post: 27th November 2014, 19:31
  3. Replies: 2
    Last Post: 3rd January 2012, 15:00
  4. Replies: 4
    Last Post: 18th August 2009, 19:53
  5. QScrollArea not displaying large number of images
    By lpkincaid in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2009, 09:58

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
  •  
Qt is a trademark of The Qt Company.