tags:

views:

6

answers:

0

i am doing tutorial from trolltech

http://doc.trolltech.com/4.0/tutorial-t11.html - it is scorched earth-like "game". You can get ready files from links on the tutorial page.

They are using painter.save()/restore() methods - I checked the description of that methods courious what that does.... unfortunately it has only one line explanation.

And as curiosity suggest I have commented out painter.save() and painter.restore() from method CannonField::paintCannon(QPainter &painter) to see what will stop working :D

Strangely i commented out those methods in paintCannon() method, but it prevented paintShot() method from working correctly... o.O

so... i made one more change :

in method CannonField::paintEvent() i switched order of lines from : paintCannon(painter); if(autoShootTimer->isActive.....

to : if(autoShootTimer->isActive..... paintCannon(painter);

(You know curiosity killed a cat :)

so... after switching order of lines ... program WORKS corectly ... with still commented out painter.save()/restore() methods....

WHY ??? can anyone help :)