Ok, I have reimplemented QGraphicsProxyWidget in this way
class MyProxyWidget : public QGraphicsProxyWidget
{
public:
MyProxyWidget
(QGraphicsItem * parent
= 0, Qt
::WindowFlags wFlags
= 0) : QGraphicsProxyWidget(parent, wFlags)
{
}
{
//QGraphicsProxyWidget::paint(painter, option, widget);
QwtPlotRenderer rdr;
rdr.
render((QwtPlot *) this
->widget
(), painter, boundingRect
());
}
private:
};
class MyProxyWidget : public QGraphicsProxyWidget
{
public:
MyProxyWidget(QGraphicsItem * parent = 0, Qt::WindowFlags wFlags = 0)
: QGraphicsProxyWidget(parent, wFlags)
{
}
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
//QGraphicsProxyWidget::paint(painter, option, widget);
QwtPlotRenderer rdr;
rdr.render((QwtPlot *) this->widget(), painter, boundingRect());
}
private:
};
To copy to clipboard, switch view to plain text mode
During common visualization on the GUI, the look is very good and with minor adjustments it could be even better. Now, when I export to pdf all the axes ticks, fonts, labels, etc, the grid lines, the plot title are vectorial, but they are huge! They almost fill all the space assigned to the plot item and practically no curve can be seen. Maybe it depends on the boundingRect() size I am passing to the render method?
Bookmarks