So I'm trying to use QPropertyAnimation on a QWidget that has been added to a QGraphicsScene and it's not working. I can't really copy and paste the code as it's intertwined with a somewhat complicated system but the summary is basically this:
A custom widget is created
CustomWidget widget;
Widget is added to a graphics scene
graphicsScene,addWidget(widget);
at some later point, one of the widget's member functions tries to create and start a QPropertyAnimation
QPropertyAnimation *anim = new QPropertyAnimation(this, "_opacity");
anim->setDuration(5000);
anim->setKeyValueAt(0, 0);
anim->setKeyValueAt(1, 1);
anim->start();
instead of a smooth animation, the property changes to the second value and stays there.
I've looked online at some related problems and their solutions, but none seem to match my situation. Does anyone know how to accomplish this?
EDIT: I discovered I just needed to make the WRITE function for _opacity call update()