I’m trying to move a sprite in a QGraphicsView. I use :
connect(timer, SIGNAL(timeout()), scene, SLOT(advance()));
timer->start(1000/33);
But my sprite is not repainted. I’ve to do alt-tab to update the view.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The docs imply that this is an animation notification tool for scene items, it says nothing about actually updating the view. You probably need to connect your
QTimer::timeout()signal to theQGraphicsScene::update()slot.