PDA

View Full Version : Direct QwtPlot painting



ssample
22nd January 2013, 22:29
Hi, how can I achieve this:
I have QwtPlot with axes and some functions (QwtPlotCurve) drawn on it.
I want to draw a blue line from qwtplot center to its right top corner.
I'd prefer to avoid computing canvas/logical coordinates - if possible.
Waiting impatiently for solution ...

Uwe
23rd January 2013, 06:41
class YourLine: public QwtPlotItem
{
public:
...

virtual void draw( QPainter *painter,
const QwtScaleMap &, const QwtScaleMap &, const QRectF &canvasRect ) const
{
painter->setPen( Qt::blue );
painter->drawLine( canvasRect.center(), canvasRect,topRight() );
}
};

Uwe