I'm using my own logic to have customized ticks on my scale:
// mTimeScaleDiv is a AxisScaleDiv member
mTimeScaleDiv.invalidate();
mTimeScaleDiv.setInterval(0, 40000);
QList<double> majorTicks;
QList<double> minorTicks;
for (int i = 0; i < (20 + 1); i++)
{
if (i % 5 == 0)
{
majorTicks.append(i * 2000);
}
else
{
minorTicks.append(i * 2000);
}
}
mTimeScaleDiv.
setTicks(QwtScaleDiv::MajorTick, majorTicks
);
mTimeScaleDiv.
setTicks(QwtScaleDiv::MinorTick, minorTicks
);
// This returns false - why?
bool isValid = mTimeScaleDiv.isValid();
setAxisScaleDiv
(QwtPlot::xBottom, mTimeScaleDiv
);
// mTimeScaleDiv is a AxisScaleDiv member
mTimeScaleDiv.invalidate();
mTimeScaleDiv.setInterval(0, 40000);
QList<double> majorTicks;
QList<double> minorTicks;
for (int i = 0; i < (20 + 1); i++)
{
if (i % 5 == 0)
{
majorTicks.append(i * 2000);
}
else
{
minorTicks.append(i * 2000);
}
}
mTimeScaleDiv.setTicks(QwtScaleDiv::MajorTick, majorTicks);
mTimeScaleDiv.setTicks(QwtScaleDiv::MinorTick, minorTicks);
// This returns false - why?
bool isValid = mTimeScaleDiv.isValid();
setAxisScaleDiv(QwtPlot::xBottom, mTimeScaleDiv);
To copy to clipboard, switch view to plain text mode
Could anyone help me with an explanation why the scale div I'm creating is set to invalid?
Bookmarks