More coffee !
Uwe
More coffee !
Uwe
Instead of more coffee i think i need joint or something.....
when i throw : setMousePattern( QwtEventPattern::MouseSelect4, Qt::LeftButton, Qt::NoButton ); in the zoomer, and
setMousePattern( QwtEventPattern::MouseSelect2, Qt::LeftButton, Qt::NoButton ); in the distancepicker
i would have expected different behavior than described above... ?
what am i doing wrong ?
... really boring like reading the 2 lines of documentation ?
QwtPickerClickRectMachine implements a state machine with an input alphabet of 2 symbols:
- QwtEventPattern::MouseSelect1
- QwtEventPattern::KeySelect1.
So don't be surprised, that changing the mouse/key bindings of other symbols doesn't have any effect on this state machine.
Uwe
Uwe,
I can understand your frustration, i assume its as big as mine
You said : Use QwtEventPattern::setMousePattern() and redefine the input events for your distance picker.
I looked up, where the setMousePattern could be called on, and discovered that QwtPlotPicker is derived from QwtEventPattern. Since my DistancePicker is a QwtPlotPicker i assumed calling the setMousePattern in DistancePicker's constructor would do it.
I see now that all is handled through the statemachines.
For me, as qwt newbie, its still confusing why QwtPlotPicker is derived from QwtEventPattern then.
But anyway, ill create my own QwtPickerClickRectMachine for the distance picker then.
Thanks for all help !
Not all - the picker translates real mouse/key events into something abstract like QwtEventPattern::MouseSelect1 etc. Then this abstract symbol is handled by the state machine.
You can easily implement your own state machine - f.e, when you want to terminate your selection with a different input as you have started it. But as long as you start and terminate your measurement with the same operations there is no need to implement your own state machine: all you need to do is to redefine QwtEventPattern::MouseSelect1, so that it doesn't interfere with your zoomer.
You can call the whole system a bit "over-engineered" - but in the end it is very flexible and powerful.
Something you should always have in mind when you are dealing with open source software: instead of playing hours around with parameters of a method you can always try to look into the implementation of this method.
Uwe
Bookmarks