Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Tracking mouse in case of zoom in & zoom out
Qt 6.11 is out! See what's new in the release blog

Tracking mouse in case of zoom in & zoom out

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 631 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mehrdad
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved