[PyQt] Curious behaviour of slider/spin when controlled by keyboard
Vincent Vande Vyvre
vincent.vandevyvre at swing.be
Mon Oct 1 07:07:32 BST 2012
Le 01/10/12 06:02, Shriramana Sharma a écrit :
> Hello. With my work on a simple Cubic Bezier investigation application
> in PyQt (attached, obviously under GPL), I ran into a curious
> behaviour of the slider/spin (for the time along the curve) when
> controlled by the keyboard.
> 1. Let the focus be either on the slider (on the left) or the spin
> (below it). (The default slider/spin value is 0.50.)
> 3. Press up-arrow key to increase the slider/spin value.
> The value will not increase past 0.56.
> 4. Press down-arrow key to decrease the slider/spin value until 0.30.
> 5. Press down-arrow once more.
> The value jumps down from 0.30 to 0.28 even though the precision is set at 0.01.
> 6. Press up-arrow.
> The value will now not rise above 0.28.
> 7. Adjust the slider position using the mouse.
> The value can change to any value in its full range from 0.00 to 1.00.
> 8. Adjust the slider using the mouse to go beyond 0.60.
> 9. Press down-arrow to decrease the value until 0.59.
> 10. Press down-arrow once more.
> 11. The value jumps down to 0.56.
> 12. It will no longer go above 0.56 using the keyboard (as before).
> My sliderMoved, spinChanged slots are straightforward, and just
> convert the integer slider value to the spin and update the bezier
> widget accordingly. In which case, I do not understand what it is I am
> doing wrong in my programming. However, I wrote a minimal test where
> the behaviour is not seen. Any guidance is appreciated.
> PyQt mailing list PyQt at riverbankcomputing.com
Seems an integer division question.
and that's works
Oqapy <https://launchpad.net/oqapy> . Qarte
<https://launchpad.net/qarte> . PaQager <https://launchpad.net/paqager>
More information about the PyQt