David Douard | 5 Sep 16:58

Zooming can be *very* slow

Hi,

I use Qwt by the mean of PyQwt.
I a plotting some time series step curves, with do plot fine, as long as I do 
not zoom too much. 

Digging in the C++ code, I have noticed that it is the  
QwtPainter::drawPolyline that is in cause. 
There is already a hack to encounter a serious pb in Qt, but I have played a 
bit with this hack. The hack is to split the polyline in parts if [some 
condition]. I  forced it to split the polyline, and now it behave OK whatever 
the zooming ratio.
So I suggest that, as long as Trolltech has not fixed this (serious) bug, the 
condition test should be removed.

Something like

--- ../../../qwt/src/qwt_painter.cpp	2008-09-05 14:07:34.000000000 +0200
+++ ./qwt_painter.cpp	2008-09-05 16:55:48.000000000 +0200
@@ -496,36 +495,21 @@
     QwtPolygon cpa = d_metricsMap.layoutToDevice(pa);
     if ( deviceClipping )
         cpa = clip(cpa);
-
+    
 #if QT_VERSION >= 0x040000
     bool doSplit = false;
-    if ( painter->paintEngine()->type() == QPaintEngine::Raster &&
-        painter->pen().width() >= 2 )
-    {
(Continue reading)

Uwe Rathmann | 11 Sep 09:31

Re: Zooming can be *very* slow

On Friday 05 September 2008 17:00, David Douard wrote:

> I use Qwt by the mean of PyQwt.
> I a plotting some time series step curves, with do plot fine, as long as I
> do not zoom too much.

Try to use polygon clipping:

curve->setPaintAttribute(QwtPlotCurve::ClipPolygons);

Uwe

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

Gmane