Results 1 to 2 of 2

Thread: plotting curve with dashed lines alternating colors

  1. #1
    Join Date
    Jul 2010
    Posts
    37
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default plotting curve with dashed lines alternating colors

    Should be possible to draw a curve using dashed lines with different alternate colors?
    I want to draw a curve using red,white,yellow and repeating the pattern.

    I'm looking to QwtPlotCurve::setPen but seems it is a topic related to QT properly.
    Is there a way to derive QwtPlotCurve and reimplement draw methods?

  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: plotting curve with dashed lines alternating colors

    Quote Originally Posted by corrado1972 View Post
    Is there a way to derive QwtPlotCurve and reimplement draw methods?
    Yes - the solution is to derive from QwtPlotCurve and to reimplement draw methods.

    Ok, more serious:

    Reimplement YourCurve::drawCurve call QwtPlotCurve::drawLines for each curve segment with a different pen assigned to the painter.

    Uwe

Similar Threads

  1. Alternating colors in QTableWidget
    By gtSasha in forum Qt Programming
    Replies: 2
    Last Post: 5th March 2011, 18:20
  2. Do it yourself alternating row colors.
    By barnabyr in forum Qt Programming
    Replies: 3
    Last Post: 1st November 2008, 17:30
  3. Plotting part of a curve
    By viridis in forum Qwt
    Replies: 6
    Last Post: 21st July 2008, 08:12
  4. QTreeView -- Alternating Row Colors Oddity
    By chuckshaw in forum Qt Programming
    Replies: 2
    Last Post: 4th October 2007, 19:41
  5. Draw a rectangle alternating two colors with qPainter
    By SkripT in forum Qt Programming
    Replies: 12
    Last Post: 24th January 2006, 23:12

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.