Re: qwt-plot with included zoom engine
Brought to you by:
rathmann
From: Uwe R. <Uwe...@ti...> - 2009-01-28 19:42:43
|
On Wednesday 28 January 2009 14:01, Matthias Reich wrote: > qwt_plot_zoomer reimplements the method move(double,double), but there > is no prototype in qwt_picker (the base class), however, qwt_picker (and > qwt_plot_picker) DO HAVE a move(QPoint&) method. QwtPicker offers rubberband suported selections on widgets. As the coordinates of a widget are integer based you have methods with integer geometries. QwtPlotPicker is tailored for selections on the plot canvas and adds an API dealing with plot coordinates ( doubles ). > Now CC complains that qwt_plot_zoomer's move method hides qwt_picker's > move method. You always get such a warning, when a derived class has a method with the same name as a method in the base class. Probably your compiler won't find out what is meant by "zoomer->move(QPoint(0,0))". Then you have to write "zoomer->QwtPlotPicker::move(QPoint(0, 0);" That's what the whole thing is about. ( As move() is a protected method you can't call it from outside, but I hope you got the point ). Obviously using the same name wasn't my best idea ever, but I was not aware of this problem when I wrote the code and changing the API (breaking working applications) later only because of a unrealistic use case or to avoid CC compiler warnings ... > On another page, since I'm now digging into qwt_zoomer quite a bit, it > would be possible for me to report bugs, if I find any. However, since > some of the methods have only very shallow documentation, I sometimes > fail to see the rationale behind certain things. Well the implementation of the pickers is no every day code. This has to do with the fact, that rubberband/tracker are overlay widgets, but also because the user interactions are implemented as mealy machine. If you don't know what this is you will probably fail to understand what the code is about. > If I don't know what a > method or parameter is supposed to do, I can't figure out, whether > there's a bug or not. All methods and parameters are explained. The explanations might be bad, but as long as you don't tell me more details, statements like above doesn't improve anything. Uwe |