Results 1 to 3 of 3

Thread: Multiple curves paint most recent on top

  1. #1
    Join Date
    Apr 2008
    Posts
    53
    Thanks
    10

    Default Multiple curves paint most recent on top

    Hi,

    I have two curves that get populated with an almost identical set of data (just shifted a bit from each other and with different colors). My problem is that I need to paint the most recent data from each curve on top of all the other old data.

    Is there any way to do this?

    Thank you,
    -James

  2. #2
    Join Date
    Apr 2008
    Posts
    53
    Thanks
    10

    Default Re: Multiple curves paint most recent on top

    By the way, I tried setting Z-values of both curves equal to each other, but that didn't work. Do i have to make a user-defined QwtPlotItem that consists of both QwtPlotCurves?

    Thanks

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

    Default Re: Multiple curves paint most recent on top

    Plot items are painted in order of their z values. The points of a curve are painted in increasing order according to the point index.
    If you want to change this you can overload QwtPlot::drawItems and paint your curves in several parts using:

    Qt Code:
    1. void QwtPlotCurve::draw(QPainter *painter,
    2. const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    3. int from, int to) const
    To copy to clipboard, switch view to plain text mode 
    Uwe

Similar Threads

  1. Multiple curves on top of each other
    By jmsbc in forum Qwt
    Replies: 2
    Last Post: 15th July 2009, 19:46
  2. Replies: 10
    Last Post: 18th September 2008, 15:14
  3. How to paint across/over multiple widgets?
    By richy in forum Qt Programming
    Replies: 3
    Last Post: 31st August 2006, 10:57

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.