Tracking mouse in case of zoom in & zoom out



  • Hi,
    i write a graphic program that use changing scale of my world item(parent of all object and light blue rectangle in picture) for emulate zoom in & zoom out...and i use this code for this purpose...
    @
    onWheel: {
    zoomPad.opacity=0.6
    scaleShow.start()
    if (wheel.modifiers & Qt.ControlModifier) {
    world.rotation -= wheel.angleDelta.y / 120 * 5;
    if (Math.abs(world.rotation) < 4)
    world.rotation = 0;
    } else {
    world.rotation += wheel.angleDelta.x / 120;
    if (Math.abs(world.rotation) < 0.6)
    world.rotation = 0;
    if(world.scale>200)world.scale=200;
    if(world.scale<200 && world.scale>0.0003)world.scale += world.scale * wheel.angleDelta.y / 120 / 10;
    else if((world.scale>0.0003 && wheel.angleDelta.y<0) ||(world.scale<200 && wheel.angleDelta.y>0))world.scale
    += world.scale * wheel.angleDelta.y / 120 / 10;
    }
    }@
    !http://i58.tinypic.com/iwou14.png(pl-illustrator)!

    but if you saw before...in this kind of programs(for example Qt designer) page track mouse in zooming...
    how i can achieve this feature?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.