Не крутится куллер не работает "rotation", почему то пишет QPropertyAnimation: you're trying to animate a non-existing property rotation of your QObjectА кнопочка нормально выпадает. Почему так?#include "widget.h"Widget::Widget(QWidget *parent) : QWidget(parent){lbl = new QLabel(this);lbl->setGeometry(5,5,373,373);lbl->setPixmap(QPixmap(":/cooller.png"));btn = new QPushButton("ROTATE",this);btn->setGeometry(180,-40,100,40);m_ani = new QPropertyAnimation(btn,"pos",this);m_ani 2 = new QPropertyAnimation(lbl,"rotation",this); connect(btn,SIGNAL(clicked()),this,SLOT( chengeAngle()));this->setFixedSize(400,400);}Widget::~Widget( ){}void Widget::mousePressEvent(QMouseEvent *e){ m_ani->setDuration(500); if (btn->y()==-40){ m_ani->setEndValue(QPoint(180,50)); m_ani->setEasingCurve(QEasingCurve::InBack); } else { m_ani->setEndValue(QPoint(180,-40)); m_ani->setEasingCurve(QEasingCurve::InBack); }m_ani->start();}void Widget::chengeAngle(){m_ani2->setStartValue(qreal(0));m_ani2->setEndValue(qreal(-360));//m_ani2->setEasingCurve(QEasingCurve::InBack);m_ ani2->start();}
|