Results 1 to 2 of 2

Thread: Changing/Customizing QwtPlot background into areas

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    165
    Thanked 2 Times in 2 Posts

    Default Changing/Customizing QwtPlot background into areas

    Hello!

    I'm not sure if this is actually a Qwt issue or general Qt, but since I want to apply it to a QwtPlot, here it goes:

    I'ld like to create a QwtPlot with limited yLeft axis 0-100% and then divide the background into four different areas, each of which with a different color in a gradient style (areas 0-25, 25-50, 50-75 and 75-100). All the rest of the plotting will be normal.

    How could I do this?

    Thanks,

    Momergil

  2. #2
    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: Changing/Customizing QwtPlot background into areas

    When your background is related to plot coordinates you can use QwtPlotZoneItem, otherwise you can use use the palette of the plot canvas. In both cases you want to use brushes with linear gradients: see QBrush and QLinearGradient.

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    Momergil (27th April 2013)

Similar Threads

  1. QwtPlot - Changing Title fonts
    By MrGarbage in forum Qwt
    Replies: 11
    Last Post: 26th April 2012, 09:16
  2. Replies: 2
    Last Post: 8th February 2011, 15:53
  3. changing the background for a tablewidget
    By qtlinuxnewbie in forum Newbie
    Replies: 4
    Last Post: 27th February 2010, 06:02
  4. Customizing a dialogs background with QStyle
    By SebastianBecker in forum Qt Programming
    Replies: 5
    Last Post: 10th September 2009, 14:11
  5. Changing the background of QTabWidget
    By ike in forum Qt Tools
    Replies: 2
    Last Post: 7th November 2008, 14:43

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.