I created a plot and I would like to print it.
From the Qwt examples, I used the bode example to create a print function:

Qt Code:
  1. void plotsMainWindow::print( ResultsPlot * plot )
  2. {
  3. QPrinter printer;
  4. printer.setOrientation( QPrinter::Landscape );
  5. QPrintDialog dialog( &printer );
  6. if ( dialog.exec() )
  7. {
  8. if ( printer.colorMode() == QPrinter::GrayScale )
  9. {
  10. filter.setOptions ( QwtPlotPrintFilter::PrintAll & ~QwtPlotPrintFilter::PrintCanvasBackground );
  11. }
  12. plot->print( printer, filter );
  13. }
  14. }
To copy to clipboard, switch view to plain text mode 

When I try to print to a pdf document, the plot is printed but I have a light gray background.
I would like the plot on a white background, or no background at all.
When defining the canvas for the plot I used:
Qt Code:
  1. canvas_->setBackgroundRole( QPalette::Window );
  2. canvas_->setAutoFillBackground( true );
To copy to clipboard, switch view to plain text mode 
the displayed plot on the screen shows a window background but it's different in the printing.

Also the documentation says that QwtPlotPrintFilter will be removed in future versions.
Should I use a different way to print the plot?