[bt-devel] Search Analysis
Gary Holmlund
gary.holmlund at gmail.com
Sun Nov 30 18:01:58 MST 2008
Martin Gruner wrote:
> Hi Gary,
>
> thank you so much for your work! It looks good.
>
> I noticed that when I'm moving the mouse over the analysis, one CPU is being
> used at 100%. I guess that there are too many events being fired of which all
> result in some calculation being done. Can you try to improve that, maybe with
> some QTimers which make sure that updates are only performed once in a while?
>
> mg
>
I looked and found it happens without the mouse being over the dialog.
It also happened in the Qt3 BibleTime. I found the issue in the paint()
function of CSearchAnalysisItem and CSearchAnalysisLegendItem. I found
lines like the following in each:
setPen( QPen(Qt::black,2) );
setBrush( QBrush(Qt::white) );
Notice that these are not setting the pen or brush for the QPainter
object, but for the widget. So the paint event was modifying the widget
which causes a repaint to be scheduled. This was happening continuously
so that the dialog was always repainting.
The lines were serving no useful purpose. After I deleted these lines
the problem was gone.
Gary
More information about the bt-devel
mailing list