Qwt scale widget setSpacing problem
hi friends,
SetSpacing in QWtScaleWidget and SetSpacing in QwtScaleDraw is shrinking the Canvas size , when increasing the value. my requirement is the title and the scale distance from the Axis should increase and canvas style should remain same.
i tried
QwtScaleDraw::setSpacing(int) for distance between axis and label and QwtScaleWidget::setSpacing(int) for distance between axis and title.
but when i increase the value, the space is provided by shrinking the Canvas rect.
my requirement is to keep the rect stable and the title and label should move away from the axis.
Please help me,
Thanks in advance.
Re: Qwt scale widget setSpacing problem
Quote:
Originally Posted by
wagmare
SetSpacing in QWtScaleWidget and SetSpacing in QwtScaleDraw is shrinking the Canvas size ...
This is a problem of the layout, where the plot widget is in. If you are increasing the space needed for the scales and you don't want the canvas to shrink, then the plot widget needs to get more space.
In case the geometry of the plot is under control of a QLayout you could try to overload QwtPlot::sizeHint(), using an implementation, where the value is directly related to your spacings. Of course you also would have to choose a sizePolicy, where the layout is not ignoring the hint.
Uwe