QPropertyAnimation属性动画不运行,

QPropertyAnimation属性动画不动作
槽函数已经运行,但是属性动画就是没反应,系统也不报错
#include "mypushbutton.h"
#include
#include
//#include
#include
MyPushbutton::MyPushbutton(QWidget *parent)
    : QPushButton{parent}
{
}
void MyPushbutton::moveDown()
{
    //qdebug测试槽函数lambda已经成立,动画出了问题
    qDebug()<<"动画"<new QPropertyAnimation(this,"geometry",this);
    animation->setStartValue(this->geometry());
    animation->setEndValue(QRect(this->x(),(this->y()+10),this->width(),this->height()));
    animation->setDuration(100);
    animation->state();
}

运行debug内容输出,但是动画效果没有
刚开始以为connect出了问题,添加debug以后控制台可以输出,说明connect没问题。

还有就是在 animation->state(QAbstractAnimation::DeleteWhenStopped);给start加上这个结束后删除对象的内容后报错:
mypushbutton.cpp:25:22: Too many arguments to function call, expected 0, have 1
qabstractanimation.h:54:11: 'state' declared here

实在麻爪了,求指点!

望采纳!!点击该回答右侧的“采纳”按钮即可采纳!!我现在写给你