emrares
11th August 2009, 07:34
I have a big problem when i try to change the scale and i have previous specified a tick list.
For example
setAutoReplot( false );
setAxisScale(QwtPlot::xBottom, -9,5); // I specify a interval
replot();
// Here I specify a fix list of ticks
QwtScaleDiv* scdiv = axisScaleDiv(xBottom);
QwtValueList tick_lst= scdiv->ticks(QwtScaleDiv::MajorTick);
tick_lst.clear();
tick_lst.push_back(-8);
tick_lst.push_back(-4);
tick_lst.push_back(-2);
tick_lst.push_back(1);
tick_lst.push_back(5);
scdiv->setTicks(QwtScaleDiv::MajorTick,tick_lst); // set the ticks
replot();
The ticks are shown on the xBottom scale, but when i change the the interval with
setAxisScale(QwtPlot::xBottom, 6,10); the program crashes because of the ticks.
How can i delete the tick list, or how can i change the ticks?? I tried several methods but without any success.
For example
setAutoReplot( false );
setAxisScale(QwtPlot::xBottom, -9,5); // I specify a interval
replot();
// Here I specify a fix list of ticks
QwtScaleDiv* scdiv = axisScaleDiv(xBottom);
QwtValueList tick_lst= scdiv->ticks(QwtScaleDiv::MajorTick);
tick_lst.clear();
tick_lst.push_back(-8);
tick_lst.push_back(-4);
tick_lst.push_back(-2);
tick_lst.push_back(1);
tick_lst.push_back(5);
scdiv->setTicks(QwtScaleDiv::MajorTick,tick_lst); // set the ticks
replot();
The ticks are shown on the xBottom scale, but when i change the the interval with
setAxisScale(QwtPlot::xBottom, 6,10); the program crashes because of the ticks.
How can i delete the tick list, or how can i change the ticks?? I tried several methods but without any success.