Well, it must be in your definition of the class. Following works fine on my system:
{
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;
}
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;
}
To copy to clipboard, switch view to plain text mode
Bookmarks