PDA

View Full Version : How to make an object blink in Qt?



thirupathiuppu007
22nd February 2008, 08:49
Hi,

I have drawn a rectangle and filled it with some color. Now my task is to make the rectangle blink for every 1 second. How to make it possible in Qt? I have been trying with QTimer but it is just changing color from one to another but not blinking. I have one doubt, Is QTimer called only once or continuously? How to make it called continuously? Plese help me as I am really disturbed with this task.

With Regards
Thirupathi Uppu

vasanth
22nd February 2008, 08:58
try this


QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(your_Change_Color_function()));
timer->start(1000);

ashukla
22nd February 2008, 10:30
See the link below;
http://www.qtcentre.org/forum/f-qt-programming-2/t-blinking-qgraphicstextitem-text-in-qgraphicsview-widget-11106.html