PDA

View Full Version : Crosshair on Canvas



JSchn88
16th March 2011, 10:37
Hello community,

the simple things i need are a vertical- and horizontal line which cross on mouse position. While using QwtPlotPicker i saw that this class has the functionality to do that by using the rubberband. But it´s just visible while the left mousebutton is clicked and not the whole time my mouse is over the canvas.

hope you can give me a hint if there is a qwt class that provides this functionality :)

After searching some hours by google i found a good solution for it ! It works fine!

thx a lot
Jens

Uwe
16th March 2011, 18:51
Use Qwt 6:


picker = new QwtPlotPicker( QwtPlot::xBottom, QwtPlot::yLeft,
QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOn,
plot->canvas() );
picker->setStateMachine(new QwtPickerTrackerMachine());
picker->setRubberBandPen(...);
picker->setRubberBand(QwtPicker::CrossRubberBand);Uwe