Problem with Drag Drop for QWT Graph
Hi,
I am trying to drag the graph which is plotted on a widget using QWT to a word document.
canvas->paintCache returns pointer to QPixmap.
I am using this pixmap to set as Image data to QMimeData.
When I actually drop the QMimeData to the word document, I can see only the curves. Axis ,Labels and Legends are not dragged/copied at all from my qwt graph to the word document!.
I have not implemented this feature before, hence I am wondering whether my logic is right with respect to Drag and Drop of QWT graphs.
Kindly let me know.
Regards,
Ankitha
Re: Problem with Drag Drop for QWT Graph
Tha paint cache of the canvas is for the content of the plot canvas. So no surprise, that is doesn't contain axes, legend and plot title.
You can render to a QPixmap using QPixmap::grabWidget(). You can also use QWidget::render() if you like to have someting different as a QPixmap. F.e. a scalable vector graphics format like PDF or SVG makes a lot of sense in a text document.
Finally you can also use QwtPlot::print, that also renders to any specific type of QPaintDevice. In opposite to QWiget::render you can render the plot in a different geometry than the widget is. F.e you can align your plot to your paper geometries without any scaling effects.
HTH,
Uwe
Re: Problem with Drag Drop for QWT Graph
Hey!
Thanx
It works with grabwidget :)