Hi.
I would like to insert a QwtPlot inside a QTextDocument.
I know that I can do it by calling something like that:

Qt Code:
  1. m_cursor.insertImage(image)
To copy to clipboard, switch view to plain text mode 
where image is the QwtPlot.
But: how can I grab the qwtplot into an image?

I tried
Qt Code:
  1. QPixmap* MyPlot::getImage()
  2.  
  3. {
  4.  
  5. int options = QwtPlotPrintFilter::PrintAll;
  6. options |= QwtPlotPrintFilter::PrintBackground;
  7. options |= QwtPlotPrintFilter::PrintFrameWithScales|QwtPlotPrintFilter::PrintMargin;
  8. filter.setOptions(options);
  9. print(image,filter);
  10.  
  11.  
  12.  
  13.  
  14. return ℑ
  15. }
To copy to clipboard, switch view to plain text mode 
but the debug said that the image is empty. image is a member variable (QPixmap image)
Any idea?