//创建动画对象
QPropertyAnimation *animation = new QPropertyAnimation(this, "geometry");
//设置时间间隔
animation->setDuration(500);
animation->setStartValue(QRect(this->x(), this->y(), this->width(), this->height()));
animation->setEndValue(QRect(this->x(), this->y()+40, this->width(), this->height()));
//设置曲线
animation->setEasingCurve(QEasingCurve::OutBounce);
animation->start();