I have a plot that uses a legend positioned initially with QwtPlot::RightLegend and then set to QwtPlot::ExternalLegend.
I want to render the plot to the clipboard but the legend rectangle ends up being painted at position 0,0 and not where I actually see it in my widget.
Here's the rendering code:
Qt Code:
QwtPlotRenderer renderer; renderer.render(this, &painter, this->rect()); clipboard->setImage(img);To copy to clipboard, switch view to plain text mode
I tried to reposition the legend to QwtPlot::RightLegend but then I naturally get it in the separate right section as you would see it in the widget, which is not what I want.
How can I make the legend rectangle painted in it's actual position?
Bookmarks