Results 1 to 4 of 4

Thread: the replot of a qwtPlot is too slow

  1. #1
    Join Date
    Feb 2012
    Posts
    6
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default the replot of a qwtPlot is too slow

    Hi There,
    I'm Using Qwt 6.0.1 and Qt 4.8.0.

    I have a QwtPlot and attach on it one qwtPlotCurve with 100000 points and a qwtPlotItems.
    I want to redraw the qwtPlotItems based on mouse movement. After updating of the qwtPlotItems position is necessary make a replot the qwtPlot to show the new qwtPlotItems position.
    For each mouse movement the entire qwtPlot is redraw therefore this passage is very slow, consequently the movement of the qwtPlotItems results not-allingned with the mouse movement. In short terms the updating of User Inteface isn't coherent with mouse movements.

    Is there a way to make more efficient this operation? For example is there a way for not redraws the entire qwtPlot, as in case of replot operation.

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: the replot of a qwtPlot is too slow

    You can do it in many ways.

    You can inherit from the QwtPlot and replot only a 'dirty rect' instead of whole plot.

    You could reduce your data as 100k poits is too high resolution for the screen no mater what.

    You could use a QWidget instead of QwtPlotItem when you move your mouse and just move the QwtPlotItem once when you're done with it.

    Or you could do all of the above.

    For example: in last app I've used Qwt I have curves made from between 2M and 5M points (up to 5 curves on the plot) and markers tracking each of the curves in real time. Reploting the plot in worst case takes around 200ms and markers are always smooth regardles of how many items there's on the plot.
    So, depending on your requirements - it can be done.

    ps. All above is true for qwt 5.x.x. For qwt 6.x.x there are few flags you can set to speed up things, see this thread for more details.

  3. #3
    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: the replot of a qwtPlot is too slow

    Quote Originally Posted by Spitfire View Post
    ps. All above is true for qwt 5.x.x. For qwt 6.x.x there are few flags ...
    Only true for Qwt 6.0.x - in Qwt 6.1.x ( = SVN trunk ) you have even more flags - none of them will help for the specific problems, that replotting a curve of many points is always too slow for mouse movements !

    For situations like these I'm always using an overlay widget, so that the repaints of the plot canvas only mean blitting the pixmap from the backing store of the canvas. You could also introduce a pixmap cache for plotitems up to a specific layer ( QwtPlotItem::z() ), but the advantage of using an overlay widget is, that the update regions for the plot canvas are calculated from the mask of the overlay widget by Qt.

    F.e. the rubberband and the tracker text of QwtPlotPicker are using overlay widgets.

    Uwe

  4. #4
    Join Date
    Feb 2012
    Posts
    6
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: the replot of a qwtPlot is too slow

    thanks for the quick response. the link is very helpful, I'm sorry for posting more times the same question but it was not a voluntary thing

Similar Threads

  1. replot in Qwt Zoomer
    By ruzik in forum Qwt
    Replies: 2
    Last Post: 22nd September 2011, 18:42
  2. how to accelerate the replot?
    By rambo83 in forum Qwt
    Replies: 6
    Last Post: 17th March 2010, 11:11
  3. how to speed up the replot?
    By rambo83 in forum Qwt
    Replies: 4
    Last Post: 16th December 2009, 11:51
  4. Replies: 1
    Last Post: 4th November 2009, 22:14
  5. Replies: 15
    Last Post: 26th October 2009, 18:47

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.