PDA

View Full Version : Replot() slows way down after switching from Qwt 6.1.0 to Qwt5



genau
27th February 2014, 10:31
I started my project with Qt 4.6.3 and qwt 6.1.0. But since debian squeeze forced me to use an earlier version of qwt (not sure which, since I'm still a linux noob. I just know that I installed libqwt5-qt4, meaning header files in /usr/include/qwt-qt4), I've been running into a couple of problems.

My plot shows a curve connecting dots. Each dot also has a qwtSymbol (a small 5x5px elipse) attached to it, since I needed to show with colors 3 different types of points. I've been working mostly with a set of data consisting of about 4k different points. With qwt 6.1.0 everything worked rather smoothly - and by that I mean that zoomer, panner or magnifier were fast. Now, after switching the version of qwt, it just works so slow... e.g. after selecting the zoomer rectangle the plot just freezes for about 5 seconds (or sometimes just hangs, or I lose my patience too quickly). I thought, maybe the replotting of that many symbols (actually markers with symbols) were the reason, but after commenting the symbol functionality out, it still is very slow.
When I tried with a data set of 20 points, everything works well.

Btw, after changing the qwt version I checked the virtual functions in classes inheriting from qwt classes to make sure the variables and names were appropriate (checked with qwt 5.2.1 documentation), so that should work fine.

Any ideas? suggestions? (oh, and I am not using any antialiasing or setting any other render hints)

This is some of my code (2 functions from plot constructor):

void MyPlot::setupAxes(){
setAxisTitle(QwtPlot::xBottom, QString(UNIT));
setAxisTitle(QwtPlot::yLeft, QString("Process ID"));
zoomOutToBase();

//createScaleDividerForY_axis();
discreteScaleDraw= new DiscreteScaleDraw(dataFromSources);
timeScaleDraw= new TimeScaleDraw;
setAxisScaleDraw(QwtPlot::yLeft, discreteScaleDraw);
setAxisScaleDraw(QwtPlot::xBottom, timeScaleDraw);

//disable minor ticks for y axis
setAxisMaxMinor(QwtPlot::yLeft,0);
}


void MyPlot::addPoints(){
QPolygonF points=dataFromSources->getPoints();

curve->setData(points);
curve->attach(this);
// dotManager=new DotManager(this);
// dotManager->addDotsToPlot(dataFromSources->tracedPoints);
}

PS. I case you want to see how the plot looks like, it's sth like this:
http://tinypic.com/view.php?pic=2znph7s&s=8#.UvNkDoZhauY

Uwe
28th February 2014, 07:15
qwt 5.2.1 has been released 2009 - and the only reason why it is popular nowadays is because of legacy code and its python bindings. Doing a backport of running code because of not being able to install a current Qwt version , hmmm ...
Beside that I don't see a general reason why a replot of the same plot should take 5 seconds with Qwt 5.x, while it runs fast with Qwt 6.x. What the specific reason iin your case is, is hard to say without having the application running.

IMHO it is a valid consideration if you want to go with Qt5 or Qt4, when starting a new project - but when going with Qt4 it doesn't make much sense with a version < Qt 4.8.

Uwe