I was testing on Signal and slot based on QGraphicsScene and also QPropertyAnimation.
Basically I was trying to create a continuous loop of animation using signal and slot.
I present my code in a simple pseudo code:

Qt Code:
  1. class PictureItem
  2. {
  3. void animate()
  4. {
  5. QPropertyAnimation ani = new QPropertyAnimation
  6. //animation settings eg. duration, setStartValue, setEndValue
  7. //destroys the animation QAbstractAnimation::DeleteWhenStopped
  8. connect(ani, SIGNAL(destroyed()),this, SLOT(deleteLater))
  9. }
  10. }
  11.  
  12. class Widget
  13. {
  14. constructor
  15. {
  16. sets the QGraphicsScene
  17. sets the QGraphicsView
  18. initPic()
  19. connect(item, SIGNAL(destroyed()),this,SLOT(ReCreate())
  20. }
  21. void initPic()
  22. {
  23. PictureItem item = new PictureItem(....)
  24. item->animate();
  25. }
  26. void ReCreate()
  27. {
  28. initPic()
  29. }
  30. }
To copy to clipboard, switch view to plain text mode 
So when i run it, the animation will play once which is based on my first initPic() and will play once more because of the signal and slot. However for the third time the animation doesn't play anymore. I perform a lot of qDebug testing and found out that the SIGNAL in the void animate() function doesn't emit anymore for the 2nd time. Is it because Qt signal can only be emitted once?