PDA

View Full Version : timerEvent for each QGraphicsItem



tts80
18th January 2007, 00:36
Hi all,

as suggested by others on the forum, I tried using timerEvent for my traffic simulation system. I looked at the mouse example and added a timerEvent for each of the vehicle in the simulation. The system seems slow though when I have more than 50 vehicles moving around. Is that generally a bad idea to have the timerEvent for each moving object? I have a scene class that contains all the vehicles (not a subclass of QGraphicsScene, just a normal class). Would it be better to have the scene class to response to timerEvent and update all vehicles at once?

Hope someone can advice on this. Thanks.

Thuan Seah Tan
QT newbie

wysota
18th January 2007, 09:33
Would it be better to have the scene class to response to timerEvent and update all vehicles at once?

Yes, it would be better this way.