Important: Please read the Qt Code of Conduct -

QPropertyAnimations too big cpu usage for hover effects

  • Hi,

    I have some widgets column with 2,3, or 4 QLabel on each, and when the mouse enter on the area, the QLabel are fade to another color using QPropertyAnimation, and back to the original color when the mouse quit the area (enter/leave events).

    The problem is if i fly over quickly each items very fast with my mouse, the cpu up to 10-15% (i7 6 cores) and after some seconds the program is a bit laggy.

    I need to remake a fade animation just like CSS3 do it (or like jquery animations do it), nicely and without any bugs.

    In the case of Qt, he don't support animations in his stylesheets (on a website we can do it with CSS3).

    So, how can i do it properly?

    Note: I'm using Qt 5 (C++).