2 Star 58 Fork 0

fg/Game-superMary-superMario

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mypushbutton.cpp 1.09 KB
一键复制 编辑 原始数据 按行查看 历史
fg 提交于 2021-04-06 22:58 . project initialized
#include "mypushbutton.h"
MyPushButton::MyPushButton(QString normalImg) {
this->normalImgPath = normalImg;
QPixmap pix;
pix.load(normalImg);
this->setFixedSize(200, 100);
this->setStyleSheet("QPushButton{border:0px;}");
this->setIcon(pix);
this->setIconSize(QSize(200, 100));
}
void MyPushButton::zoom1() {
QPropertyAnimation *animation = new QPropertyAnimation(this, "geometry");
animation->setDuration(200);
animation->setStartValue(QRect(this->x(), this->y(), this->width(), this->height()));
animation->setEndValue(QRect(this->x(), this->y() + 10, this->width(), this->height()));
animation->setEasingCurve(QEasingCurve::OutBounce);
animation->start();
}
void MyPushButton::zoom2() {
QPropertyAnimation *animation = new QPropertyAnimation(this, "geometry");
animation->setDuration(200);
animation->setStartValue(QRect(this->x(), this->y() + 10, this->width(), this->height()));
animation->setEndValue(QRect(this->x(), this->y(), this->width(), this->height()));
animation->setEasingCurve(QEasingCurve::OutBounce);
animation->start();
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/wenyanghe/supermary.git
git@gitee.com:wenyanghe/supermary.git
wenyanghe
supermary
Game-superMary-superMario
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385