Pl Explain math in Dial qml example
Hi,
In Qt SDK 1.1 (Dial control example) Dial.qml the angle of needle is represented by
angle: Math.min(Math.max(-130, root.value*2.6 – 130), 133)
where did the -130,130,133 value come from? Why is a factor of 2.6 used?
3 replies
Seems to make sense now. The ‘dial control’ code shows the x position has been multiplied by a factor of 100, so to offset that dial code has been scaled down by roughly 100 but the dial has value up 0 to 120 – so they are off by 20 degree ? To offset slider which is 34 px in width, 30 px has been subtracted from slider container width. Why would they complicate the code unnecessarily is beyond me.
You must log in to post a reply. Not a member yet? Register here!
