PDA

View Full Version : Strange visual problem in a graphics scene



jano_alex_es
13th December 2009, 20:06
I'm having a strange problem... something I can't understand.

I have a graphicsscene, graphicsView and a graphicsItem, when the key "O" is pressed it has to move few pixels to its left.

The first time I do it, it works. Releasing the button should stop it, right.

But the next time I want to move it, first, it moves few pixels to its right. Something weird; I write its position on the console and it's alright, all the scenePos() are the expected values but graphically I see a weird first movement to its right(before continuing moving to its left, as desired).



I attach you the small compilable example. (http://www.mediafire.com/file/onhe2zw5myq/testMovement.rar)

thanks

franz
13th December 2009, 20:46
I've tried it, but don't see such behaviour. For what it's worth, I'm on 4.6.0.

jano_alex_es
13th December 2009, 21:33
Maybe I explained it wrong.

Just press O button, the rectangle will move to its left and then release the key. Press again and it should move to its right a little bit (maybe 20 pixels) before continue to its left.

By the way, I'm with 4.5.0