PDA

View Full Version : Blinking/Flickering Image



soumyadeep_pan
7th March 2009, 12:25
I have an application, which is updating status of few (Almost 90) QLabels. The updation is done through a RT_TASK. The RT_TASK will post an QTimer timeout event of 0 to a main class slot and the updation is done from the slot. The RT_TASK will post the timer event in every 500 milisecond. I am updating the status Green or Red, which are images and each time I am loading the images before updating to the QLabel. But after executing the application of approx 3hr, the status (images) are blinking/flickering. How to solve that?
Tahe sample code for loading the images is as -

TL_3096Mod2Sts->setPixmap(QPixmap(DP_VS_ImagePath("Sucess_Green.png")));

DP_VS_ImagePath - this function will determine the path of the image.

Thanks in advance ....

soumyadeep_pan
23rd March 2009, 14:38
I found that double buffering will help a lot regarding flickering problem ....

But my application behaves in different way .... When I am starting the application there is no flickering, but after a few hours the flickering starts with X Errors like - BadDrawable, BadMatch, RenderBadPicture. I even check the memory usage, chached size is increasing very fast and after a certain limit of free space it is creating the problem .... I am not using any continuous dynamic allocation or anything related to memory usage... Only I doubt the pixmaps I am using.... I can not post the code here (As it is huge) .... I am giving the design architecture of my application


RT_TASK {
While (1) // This execute in every 500 milisecond
{
qApp->lock();
timerobject->start(); // signal to my display Slot
qApp->unlock();

} /*End of while*/
}

MyMainApplicationClass :: DisplaySlot()
{
<QPushButton>->setPixmap(QPixmap("anyimage.png"))
......
/* A lot of updation */
<QPushButton>->setPixmap(QPixmap("anyimage.png"))

}

Here I do not create any object for the pixmap, but why my application using memory in incrementing order or creating the X Error ... Anything I am doing wrong in that ???? or What way I can solve the flickering ????

I am also attaching an partial image window of my application where CH, SH .. are QPush buttons and I am also updating .png for those buttons for every 500ms.

Thanks in advance ....................