在 Qt 编辑器中执行这段代码:
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();
我收到错误信息的弹出窗口:
最佳答案
您应该始终在堆上创建 QWidget,否则您确实会遇到各种错误:
QPushButton* button = new QPushButton("Animated Button");
关于c++ - 来自 Qt 的 Bizzare 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7051036/