void Node::ChangeColor()
{
QPalette pal;
pal.setColor( lbl->backgroundRole(), QColor(255,0,0) ); // change the color
lbl->setPalette(pal);
lbl->setAutoFillBackground(true);
lbl->repaint();
QThread::sleep(1);
pal.setColor( lbl->backgroundRole(), QColor(255,255,0) ); // change it back
lbl->setPalette(pal);
lbl->setAutoFillBackground(true);
lbl->repaint();
}
by changing updates to repaint methods of labels i solved the problem.