Qt:QPropertyAnimation&QEasingCurve 淩亂°似流年 2023-01-12 11:47 54阅读 0赞 QPushButton *btn = new QPushButton("Button", this); btn->setGeometry(10, 10, 100, 30); QPropertyAnimation *animation; animation = new QPropertyAnimation(btn, "geometry", this); animation->setDuration(3000);//从起始坐标到结束坐标的时长[单位ms]3s,默认250ms animation->setStartValue(QRect(10, 10, 100, 30)); //设置起始坐标 animation->setEndValue(QRect(200, 150, 100, 30)); //结束坐标,当坐标值改变时,会发生valueChanged信号事件 animation->start(); ![c73568319146a4af19c975b90a77a85d.png][] ![92fb5cdcf9c2e21cdd0d7ed9c993569c984.jpg][] ![65d0a51f758e1e771a54b945a977e4e9.png][] [c73568319146a4af19c975b90a77a85d.png]: /images/20221119/0636ec5d170249ccae5589fe650357ca.png [92fb5cdcf9c2e21cdd0d7ed9c993569c984.jpg]: /images/20221119/5bfcafab8bb64a81b2dd20037d8374ca.png [65d0a51f758e1e771a54b945a977e4e9.png]: /images/20221119/dbf504de44ed4995857412ec6096dff5.png
还没有评论,来说两句吧...