I have a Qwt canvas with a gradient which works diagonally, but I don't want the gradient to run from the upper left corner to the bottom right corner. I just want the gradient to run from top to bottom, so both top corners have the same color and both bottom corners have the same corner. Searching but can't find a way to do this.

Qt Code:
  1. // code in the Canvas class:
  2. QPalette pal = palette();
  3.  
  4. QLinearGradient gradient;
  5.  
  6. gradient.setCoordinateMode( QGradient::StretchToDeviceMode );
  7.  
  8. gradient.setColorAt( 0.0, QColor( 100, 100, 100 ) );
  9. gradient.setColorAt( 1.0, QColor( 25, 25, 112 ) );
  10.  
  11. pal.setBrush( QPalette::Window, QBrush( gradient ) );
  12.  
  13. setPalette( pal );
  14.  
  15. // and set the canvas to the plot:
  16. QwtPlot::setCanvas(new Canvas());
To copy to clipboard, switch view to plain text mode 
I get the gradient ok, just not in the desired direction.
Any help is appreciated.