1 Attachment(s)
QwtPlot Canvas Size Hint?
Hi All,
I have 3 QwtPlot in vertical layouted widget as you can from attached screenshot. When I zoomen in or out in my any canvas as you expect that scales changes so layout sizes changing too. Then my end-to-end alignment in each QwtPlot is breaking down.
At this point, how can set my canvas size fixed. So my all 3 canvas left and right point lined up on same line.
Thanks in advance.
Regards.
Re: QwtPlot Canvas Size Hint?
If you are not looking for a dynamic solution, you can setMinimumExtent of the left side of the axis to a higher number.
For example, p->axisScaleDraw ()->setMinimumExtent (80);
Re: QwtPlot Canvas Size Hint?
And if you are looking for a dynamic solution use QwtScaleDraw::extent() from all left axes to calculate the value for the minimum extent.
Uwe
Re: QwtPlot Canvas Size Hint?
In order to use extent(), one must know the currently used QFont and QPen.
Figuring out the QFont is easy:
Code:
self.plot.axisFont(axis)
, but how can I figure out the QPen used?
Re: QwtPlot Canvas Size Hint?
Re: QwtPlot Canvas Size Hint?
Thanks, but that seems qwt trunk version.
QwtScaleDraw::extent takes 2 parameters (as of http://qwt.sourceforge.net/class_qwt...6501cc5ff290c6), and I do not know from where to get the QPen.
Re: QwtPlot Canvas Size Hint?
Code:
QPen( Qt
::color1, axisWidget
(..
)->penWidth
() );
The color doesn't matter.
Uwe