I'm writing a program that contains a table of buttons, each button has the ability to blink, and if it's clicked, all buttons underneath the clicked button (in the same column) should be moved down.
Initially, I was able to do this if all buttons of one column are in the same QGraphicsView. However one blinking button requires re-painting of the whole view, which results in taking up ~17% CPU. So I changed my code to put one button in a QGraphicsView; then put all the ButtonViews in another QGraphicsView (i.e. the button itself is a graphics item for animation as well as a view). Now one blinking button only takes up 9% CPU, but the animation no longer works.
I'm guessing there must be something wrong with my design, and hoping the Qt experts could help me with a better one.
I've attached the code here. I use Qt 4.5.3 under Unix/X11
Bookmarks