实现动画效果
1、同一份代码,Qt5.14.2版本出现卡顿现象,难道Qt的新版本可能对操作系统、图形驱动或硬件要求有所变化。Qt 5.14.2可能需要更高的硬件性能或特定的图形加速支持,而Qt 5.7.1版本可能对较老的硬件或驱动兼容性更好。
2、上代码
int x = 0;
int y = 0;
QScreen * screen = QGuiApplication::primaryScreen();
if (screen) {
const QRect desk_rect = screen->availableGeometry();
x = desk_rect.width() - width();
y = desk_rect.height();
}
QPropertyAnimation *animation = new QPropertyAnimation(this, "geometry");
animation->setDuration(3000);
animation->setStartValue(QRect(x, y, width(), height()));
animation->setEndValue(QRect(x, y - height(), width(), height()));
animation->start();
求解惑????