{
{
const QwtDoublePoint p = invTransform(pos);
const QwtDoublePoint curvePos(p.x(), ::sin(p.x());
if ( qAbs(pos.y() - transform(curvePos).y() ) < 4 )
text.sprintf("%.4f, %.4f", curvePos.x(), curvePos.y());
return text;
}
};
class YourPicker: public QwtPlotPicker
{
virtual QwtText QwtPlotPicker::trackerText(const QPoint &pos) const
{
const QwtDoublePoint p = invTransform(pos);
const QwtDoublePoint curvePos(p.x(), ::sin(p.x());
QString text;
if ( qAbs(pos.y() - transform(curvePos).y() ) < 4 )
text.sprintf("%.4f, %.4f", curvePos.x(), curvePos.y());
return text;
}
};
To copy to clipboard, switch view to plain text mode
Then use your picker like in the bode or like in the spectrogram example.
HTH,
Uwe
Bookmarks