PDA

View Full Version : selection of multiple areas/items on plot



rambo83
2nd December 2009, 15:14
Hello,

could you tell me, whether it is possible by means of QwtPlotPicker to select multiple items on the plot by using Ctrl button? In common programs there is always the option to select first one item by clicking on it (or drag a rectangle around it) and then pressing Ctrl button and do the same action with the mouse, more items can added into selection?

How can I get this behaviour? Help me please.

Thank you.

best regards,

Vitali

scascio
2nd December 2009, 16:01
Assuming that the selection of a set a vertices by dragging the mouse resides in a method that add vertices in the current selection, just check the result of QMouseEvent::modifiers() in mouse press event, and if not equqals to Qt::ControlModifier, just reset the list.

Better use a set for selection member to prevent from double entries.

rambo83
2nd December 2009, 18:29
Hello,

I'm afraid that it is not possible to use QMouseEvent / QEvent to check, whether Ctrl button is pressed because QwtPlotPicker does not provide it, right?

scascio
2nd December 2009, 20:30
ah all right.

Since I dont use QwtPlotPicker I cant help you.

But what about creating another QwtPlotPicker and merge selection? Is it possible?

Astronomy
10th February 2010, 11:01
Hi Rambo83,

Soon i am going to have the same task, and wanted to ask you if you have made progress in here?
I'am going use QwtPlotPicker to select multible aeras of a curve in a QwtPlot, and store the selected data elsewhere, and so on...

thanks in advance,
Astronomy

rambo83
10th February 2010, 11:08
Hello,

I did not try further to get work the action with CTRL button, thus I had to satisfy with the simple QwtPlotPicker, that provides me only a selection of one certain area by dragging a selection rectangle around it.

good luck