Reputation: 17100
Having this code executed in Qt editor:
QPushButton button("Animated Button");
button.show();
QPropertyAnimation animation(&button, "geometry");
animation.setDuration(3000);
animation.setStartValue(QRect(0, 0, 100, 30));
animation.setEndValue(QRect(250, 250, 100, 30));
animation.setEasingCurve(QEasingCurve::OutBounce);
animation.start();
I'm getting an pop up with error msg:
Upvotes: 0
Views: 96
Reputation: 90736
You should always create your QWidgets on the heap, otherwise you'll indeed get all sorts of errors:
QPushButton* button = new QPushButton("Animated Button");
Upvotes: 1