PDA

View Full Version : How to get Canvas



mqt
20th May 2015, 06:09
In qwt 5.x, I had a code in a class derived from qwtPlot



canvas()->setFrameStyle( QFrame::NoFrame );


This is not working in qwt 6.x as cavas() function now returns a *QWidget. Is there any reason for this change? How can I get QwtPlotCanvas ?

I need Canvas for two purposes

(1) to set the frame style as none as in the above code. Is there any other way to remove border from canvas?
(2) to create a QwtPlotZoomer which accept canvas as a parent in its constructor.

Uwe
21st May 2015, 06:33
Is there any reason for this change?.
Yes the canvas might be a QwtPlotCanvas or a QwtPlotCanvasGL.

How can I get QwtPlotCanvas ?
Like before, but you have to do a cast. Alternatively you could customize the canvas before inserting it - like it is done in the examples.

Uwe

mqt
21st May 2015, 13:14
Thanks Uwe