Results 1 to 4 of 4

Thread: How to stop QwtPlot::drawItems when moving scroll bar

  1. #1
    Join Date
    Jul 2013
    Posts
    72
    Qt products
    Qt5
    Platforms
    Unix/X11
    Thanks
    1

    Default How to stop QwtPlot::drawItems when moving scroll bar

    we have several curves attached one plot, which is inside a QScrollArea. When moving the slider , Qt run QwtPlot::drawItems repeately . How can I stop it ?

  2. #2
    Join Date
    Jul 2013
    Posts
    72
    Qt products
    Qt5
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: How to stop QwtPlot::drawItems when moving scroll bar

    As the drawitems takes some time , it doesn't response quick enough when moving the slider.

  3. #3
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: How to stop QwtPlot::drawItems when moving scroll bar

    Putting QwtPlot to a QScrollArea is usually not a good idea When zooming in deep with a scroll area the plot widget gets huge in size:


    • memory issues: e.g think of the backing store of the canvas !
    • performance also might slow down heavily as you disable all Qwt drawing optimizations and you will run into QPainter bottlenecks


    Using scrollbars like in the realtime example ( zoom in and you see them ) is preferable

    But concerning your question: the plot canvas has a backing store ( at least if you didn't disable it ) and I don't see why scrolling a plot inside a QScrollArea should be a reason for not using it, as it only gets invalidated:


    • resize event for the canvas
    • replot from the application side ( disable the auto replot feature to be sure ).


    Uwe

  4. #4
    Join Date
    Jul 2013
    Posts
    72
    Qt products
    Qt5
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: How to stop QwtPlot::drawItems when moving scroll bar

    oh,I have the backing store disabled. Now it works better .
    Thanks

Similar Threads

  1. how to scroll qwtplot?
    By alizadeh91 in forum Qwt
    Replies: 15
    Last Post: 9th July 2012, 10:52
  2. Replies: 1
    Last Post: 30th July 2010, 07:23
  3. Moving QObject to QThread causes signals to stop working
    By Ban-chan in forum Qt Programming
    Replies: 8
    Last Post: 13th July 2010, 21:39
  4. Replies: 9
    Last Post: 17th June 2010, 09:53
  5. Stop window moving when clicking LMB
    By steg90 in forum Qt Programming
    Replies: 11
    Last Post: 11th June 2007, 10:59

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.