Hi,
I'm trying to create a distance measure tool, that will display the delta X and delta Y values of 2 points within the plot, and draw a line between these two points.
I started out with some old code from (http://www.qtcentre.org/archive/index.php/t-10367.html). Some changes were needed to get it running in Qwt6.
Qt Code:
{ public: { setRubberBand( PolygonRubberBand ); } protected: { painter->drawPolygon( selection() ); } { const QPolygon& polygon = selection(); if ( polygon.size() != 2 ) { } bg.setAlpha(180); return text; } };To copy to clipboard, switch view to plain text mode
While this seems to be working good, i do have a few problems with it.
1) Depending on where you move the second selection for the measurement, the measurement picker text runs through the default picker that that always displays the current x,y position. Is there something to do about that ?
2) When we zoom in to the plot, just after releasing the mouse for the zoom action, the plot zooms in to new selection, and then automagically a measurement is started.
Is it possible to do measurements only when user presses space bar for instance ?
Thanks for any help !
TJ
Bookmarks