Hi everyone,

I'm trying to print a QwtPlot, but it is only printed in gray scale. Here is the code:

Qt Code:
  1. QPrinter printer;
  2.  
  3. printer.setOrientation(QPrinter::Landscape);
  4.  
  5. printer.setOutputFormat(QPrinter::NativeFormat);
  6. printer.setColorMode(QPrinter::Color);
  7.  
  8. QPrintDialog *dialog = new QPrintDialog(&printer, 0);
  9. dialog->setWindowTitle(tr("Print Plot: ") + myPlotName);
  10. if (dialog->exec() != QDialog::Accepted) return;
  11.  
  12. QPainter painter;
  13. painter.begin(&printer);
  14. painter.setPen( Qt::black);
  15. painter.setFont(QFont("Arial", 12));
  16.  
  17. my_plot->print(&painter, QRect(100,100,800,600), filter);
  18. QString dateLabel = "Produced on: " + QDate::currentDate().toString() + " at: " + QTime::currentTime().toString();
  19. painter.drawText(QRect(0,0, 600, 600), dateLabel);
  20. painter.end();
To copy to clipboard, switch view to plain text mode 

The curious thing, if I export it as PDF:

Qt Code:
  1. printer.setOutputFormat(QPrinter::PdfFormat);
  2. printer.setOutputFileName(filename);
To copy to clipboard, switch view to plain text mode 

It is correctly exported, in color.

Any idea please??

Thanks in advance