I'm using Qt to make a gui application for my beagleboard.
I'm trying to make a QLabel blink with a custom image.
QTimer::connect(timer, SIGNAL(timeout()), this, SLOT(blink()));
timer->start(1000);
I'm thinking to use QTimer to call the blink() function every second, but I do not have a clue what the code should be in blink() function. I hope someone can help, since i have struggle with this problem in a while now.
The easiest way is to hide and show it again.
This approach is good because you don't need to set your image again and again, just show/hide it(set empty pixmap or set image every second is not efficient approach).
If you use layout, then it can really break your layout, so you can use
QStackedWidget
with imageLabel and empty label and change it every second. I think that it will be still better than set empty pixmap or set image every second. Choose the best for you.http://qt-project.org/doc/qt-4.8/qstackedwidget.html