-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmypushbotton.cpp
28 lines (23 loc) · 911 Bytes
/
mypushbotton.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "mypushbotton.h"
MyPushButton::MyPushButton()
{
//this->setStyleSheet("QPushButton{border:0px;}");
}
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()+5,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()+5,this->width(),this->height()));
animation->setEndValue(QRect(this->x(),this->y(),this->width(),this->height()));
animation->setEasingCurve(QEasingCurve::OutBounce);
animation->start();
}