[Qt-interest] Paint event problem
Bijay Panda
bijaykumar.mail at gmail.com
Mon Feb 8 05:42:52 CET 2010
Hi List,
I want to update an ellipse filled with colour as per the response recieved
from a device.
I m able to update the text for the same but the colour is not getting
updated.Some time if the device responds little late then colour is getting
update but if it responds quickly then colour is not updated accordingly.
Like..when device is ready then the text gets updated as "READY" and if it
testing then also to "TESTING" but the colour from green to Yellow is not
getting updated. Plz suggest something...
void paintEvent(QPaintEvent *ev)
{
QPainter testCircle (this);
/*setting brush pattern type*/
QBrush oBrush (ocClr, Qt::SolidPattern);
/*setting status*/
if(Server::cColourType != 0)
{
ocClr = (Qt::GlobalColor)Server::cColourType;
oBrush.setColor(ocClr);
}
if(7 == Server::cColourType)
{
testingTextLabel->setText("NO LINK");
}
else if(8 == Server::cColourType)
{
testingTextLabel->setText("READY");
}
else if(12 == Server::cColourType)
{
testingTextLabel->setText("TESTING");
}
}
//Called in timer function every 1000 ms
repaint();
--
Thanks & Regards
Bijay Kumar Panda
Mob-9739591816
bijaykumar.mail at gmail.com
bijaykumar_panda at yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100208/de8f6864/attachment.html
More information about the Qt-interest-old
mailing list