Hi.
I would like to insert a QwtPlot inside a QTextDocument.
I know that I can do it by calling something like that:
m_cursor.insertImage(image)
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
{
filter.setOptions(options);
print(image,filter);
return ℑ
}
QPixmap* MyPlot::getImage()
{
QwtPlotPrintFilter filter;
int options = QwtPlotPrintFilter::PrintAll;
options |= QwtPlotPrintFilter::PrintBackground;
options |= QwtPlotPrintFilter::PrintFrameWithScales|QwtPlotPrintFilter::PrintMargin;
filter.setOptions(options);
print(image,filter);
return ℑ
}
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?
Bookmarks