I overloaded QwtRoundScaleDraw and it works.
AzimuthLabels::AzimuthLabels(const QList<QString>& azimLabels, const double & intervWidth):
m_azimLabels(azimLabels),
m_intervWidth(intervWidth)
{
}
QwtText AzimuthLabels
::label( double value
) const {
if(m_azimLabels.size() > 0)
{
if ( value == m_intervWidth * m_azimLabels.size() )
{
return m_azimLabels[0];
}
return m_azimLabels[value / m_intervWidth];
}
}
AzimuthLabels::AzimuthLabels(const QList<QString>& azimLabels, const double & intervWidth):
m_azimLabels(azimLabels),
m_intervWidth(intervWidth)
{
}
QwtText AzimuthLabels::label( double value ) const
{
if(m_azimLabels.size() > 0)
{
if ( value == m_intervWidth * m_azimLabels.size() )
{
return m_azimLabels[0];
}
return m_azimLabels[value / m_intervWidth];
}
else return QString("");
}
To copy to clipboard, switch view to plain text mode
Bookmarks