A few bug fixes for snapshot 20020807
Brought to you by:
rathmann
From: <gve...@gr...> - 2002-10-01 06:55:19
|
Hi Uwe, I like to report a few bugs for Qwt-2002087 (patch included at the end of this message): (1) I have released a PyQwt based on Qwt-20020807 and received the following bug report from a Windows user: -- begin quote -- At runtime, it appears that all examples that don't redraw the QCanvas (i.e. the one with a draw-once static plot) have EMPTY canvases (even after resizing or minimizing). The axes, ticks and titels are all drawn, but the drawing area within the axis is in plain background color with no curvers, markers or gridlines.( In the BodeDemo.py one can choose another Damping Factor and then the interior gets redrawn and shows up fine on the sreen. The examples that get never redrawn (SimpleDemo.py, plot.py and BodeDemo.py at first startup) have empty axes interiors. Strangely, the CurveDemo1.py works fine (guess there are no axes per se). In the cmd window I get a sequence of messages : QPainter::begin: Another QPainter is already painting this device; A paint device can only be painted by one QPainter at a time -- end quote -- The C++ versions of the examples have the same problem. My workaround is to undef QWT_NO_BITBLT on Windows (I tried to fix it, but I failed; the user has Qt-3.0.5 professional, I have Qt-2.3.0-NC). (2) I discovered that the conversion from mouse event positions to axis coordinates has an off by 2 error in event position. A work around in the Python version of bode.cpp (C++ code has the same problem) follows: def plotMouseMoved(self, e): frequency = self.plot.invTransform(QwtPlot.xBottom, 2+e.pos().x()) amplitude = self.plot.invTransform(QwtPlot.yLeft, 2+e.pos().y()) phase = self.plot.invTransform(QwtPlot.yRight, 2+e.pos().y()) self.showInfo('Freq=%g, Ampl=%g, Phase=%g' % (frequency, amplitude, phase)) Note the 2+e.pos().x() or 2+e.pos().y(). The difference is VERY clear. Qwt-3.0 works MUCH better in this respect. Replacing 'contentsRect()' with 'frameRect()' in the mouse event functions in qwt_plot_canvas.cpp seems to solve it. (3) a (tiny) typo in the documentation. Regards - Gerard --- begin PATCH --- --- qwt-20020807/include/qwt_global.h.qwt Thu Sep 19 22:55:55 2002 +++ qwt-20020807/include/qwt_global.h Thu Sep 19 22:57:20 2002 @@ -77,6 +77,10 @@ // QPainter::drawPixmap instead. If you don't need grabbing // it's safe to remove the define below and save some overhead. +#if defined(Q_WS_WIN) +#undef QWT_NO_BITBLT +#else #define QWT_NO_BITBLT 1 +#endif #endif // QWT_GLOBAL_H --- qwt-20020807/src/qwt_dimap.cpp.qwt Tue May 14 13:52:41 2002 +++ qwt-20020807/src/qwt_dimap.cpp Sat Sep 28 12:35:44 2002 @@ -76,8 +76,8 @@ } /*! - \eturn TRUE if a value x lies inside or at the border of the - map's integer range + \return TRUE if a value x lies inside or at the border of the + map's integer range \param x value */ bool QwtDiMap::contains(int x) const --- qwt-20020807/src/qwt_plot_canvas.cpp.qwt Tue Oct 1 07:12:01 2002 +++ qwt-20020807/src/qwt_plot_canvas.cpp Tue Oct 1 07:13:06 2002 @@ -64,7 +64,7 @@ //! mousePressEvent void QwtPlotCanvas::mousePressEvent(QMouseEvent *e) { - const QRect &r = contentsRect(); + const QRect &r = frameRect(); QMouseEvent m(QEvent::MouseButtonDblClick, e->pos() - r.topLeft(), e->button(), e->state()); @@ -97,7 +97,7 @@ //! mouseReleaseEvent void QwtPlotCanvas::mouseReleaseEvent(QMouseEvent *e) { - const QRect &r = contentsRect(); + const QRect &r = frameRect(); QMouseEvent m(QEvent::MouseButtonDblClick, e->pos() - r.topLeft(), e->button(), e->state()); @@ -117,7 +117,7 @@ //! mouseMoveEvent void QwtPlotCanvas::mouseMoveEvent(QMouseEvent *e) { - const QRect &r = contentsRect(); + const QRect &r = frameRect(); QMouseEvent m(QEvent::MouseButtonDblClick, e->pos() - r.topLeft(), e->button(), e->state()); --- end PATCH --- ------------------------------------------------------------- This message was sent using HTTPS service from CNRS Grenoble. ---> https://grenoble.cnrs.fr <--- |