I use the QWT Release 6.0.
searching in my QWT folder i found this in the qwt_plot_picker.cpp
{
return trackerTextF( invTransform( pos ) );
}
/*!
\brief Translate a position into a position string
In case of HLineRubberBand the label is the value of the
y position, in case of VLineRubberBand the value of the x position.
Otherwise the label contains x and y position separated by a ',' .
The format for the double to string conversion is "%.4f".
\param pos Position
\return Position string
*/
{
switch ( rubberBand() )
{
case HLineRubberBand:
text.sprintf( "%.4f", pos.y() );
break;
case VLineRubberBand:
text.sprintf( "%.4f", pos.x() );
break;
default:
text.sprintf( "%.4f, %.4f", pos.x(), pos.y() );
}
}
QwtText QwtPlotPicker::trackerText( const QPoint &pos ) const
{
return trackerTextF( invTransform( pos ) );
}
/*!
\brief Translate a position into a position string
In case of HLineRubberBand the label is the value of the
y position, in case of VLineRubberBand the value of the x position.
Otherwise the label contains x and y position separated by a ',' .
The format for the double to string conversion is "%.4f".
\param pos Position
\return Position string
*/
QwtText QwtPlotPicker::trackerTextF( const QPointF &pos ) const
{
QString text;
switch ( rubberBand() )
{
case HLineRubberBand:
text.sprintf( "%.4f", pos.y() );
break;
case VLineRubberBand:
text.sprintf( "%.4f", pos.x() );
break;
default:
text.sprintf( "%.4f, %.4f", pos.x(), pos.y() );
}
return QwtText( text );
}
To copy to clipboard, switch view to plain text mode
is there an obvious reason I cannot overload these functions? should I just go manually and change them?!
Added after 15 minutes:
I FOUND IT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Ι should overload the trackerTextF function and not the trackerText!!!
I realized it when I saw the source code of the qwt_plot_picker

Bookmarks