Форум вопросов и ответов

Форум вопросов и ответов (https://www.otvetnemail.ru/)
-   Новый архив 2 (https://www.otvetnemail.ru/novyj-arhiv-2-812/)
-   -   QPropertyAnimation не работает "rotation" (https://www.otvetnemail.ru/novyj-arhiv-2-812/qpropertyanimation-ne-rabotaet-rotation-209079/)

Guest 27.09.2011 12:36

QPropertyAnimation не работает "rotation"
 
Не крутится куллер не работает "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();}


Часовой пояс GMT, время: 09:28.


© www.otvetnemail.ru - Форум вопросов и ответов.