PDA

View Full Version : How to make text in label or TextEDit to flash?



qtlinuxnewbie
6th April 2010, 05:54
HI,

i want to make the text in label to flash(to appear and disappear which makes to look like flashing).
i tried to do like this

setting text in the label
usleep(for some interval)
clear text in the label
usleep for some intervel
run this in a loop for some iterations
But when i run this code i am not able to use other tools in my window until the loop completes.

Can any one suggest me any other way to achieve this task or any modifications for the existing .

Thnks in Advance.

wagmare
6th April 2010, 06:42
use QCoreApplication::processEvents () in the place where u editing the QString ... means update() pending events.

or use qApp->processEvents();

squidge
6th April 2010, 07:53
Use QTimer, that will keep your event loop running