QtPropertyAnimation Magnify ToolButton

  • I have a ToolButton on my ToolBar. I am trying to hover over a ToolButton and magnify it (animate it). I have tried the following but it does not work. Can anyone please advise?

    @QPropertyAnimation animation(&button, "geometry");
    animation.setStartValue(QRect(this->x(), this->y(). 200, 200)); //start size
    animation.setEndValue(QRect(this->x(), this->y(), 500, 500)); //end size

  • Moderators

    Isn't that you should pass the button's geometry instead of this ?

  • I replaced with button.x() and button.y(). However, the button still remains the same.

  • My mistake. I have declared fixed size for my button earlier, which fixed the size of the button throughout.

    It is working now.


Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.