Re: A flickering case
Brought to you by:
rathmann
From: Uwe R. <Uwe...@ti...> - 2005-04-12 16:49:59
|
Hi Kamran, Don't want to comment your efforts in detail, but all what you are doing is to slow down painting by useless pixmap copies. 1 second should be long enough to paint a lot of stuff, so you should spend some time on finding out what the reason for your flickering is. Flickering means that you have too many visual changes. Try to set breakpoints between the changes, or add sleeps in your code, to identify what changes between them. One thing you could try is to paint the background of the canvas yourself. It has the effect, that in case of some repaints the canvas is not erased with its background, while the application is busy with painting to the canvas cache. 1) plot->canvas()->setBackgroundMode(Qt::NoBackground); 2) void YourPlot::drawCanvas(QPainter *painter) { const QColorGroup::ColorRole role = QPalette::backgroundRoleFromMode(backgroundMode()); painter->setPen(Qt::NoPen); painter->setBrush(colorGroup().color(role)); painter->drawRect(contentsRect()); QwtPlot::drawCanvas(painter); } Uwe |