Well here is the full code. You have to rerun qmake:
#include <QtGui>
{
Q_OBJECT
Q_PROPERTY (qreal rotation READ rotation WRITE setRotation)
};
int main(int argc, char **argv)
{
MyPixmap *it = new MyPixmap();
QPropertyAnimation* anim = new QPropertyAnimation(it, "rotation");
qWarning() << anim->propertyName();
delete anim;
delete it;
return 0;
}
#include "main.moc"
#include <QtGui>
class MyPixmap : public QObject, public QGraphicsPixmapItem
{
Q_OBJECT
Q_PROPERTY (qreal rotation READ rotation WRITE setRotation)
};
int main(int argc, char **argv)
{
QApplication app(argc, argv);
MyPixmap *it = new MyPixmap();
QPropertyAnimation* anim = new QPropertyAnimation(it, "rotation");
qWarning() << anim->propertyName();
delete anim;
delete it;
return 0;
}
#include "main.moc"
To copy to clipboard, switch view to plain text mode
Bookmarks