Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Dont move center on onZoomLevelChanged

Dont move center on onZoomLevelChanged

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 413 Views
  • 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.
  • T Offline
    T Offline
    Tomzy97
    wrote on last edited by Tomzy97
    #1

    Does map have a property, so it doesn't move center if I move mouse cursor on random place on map and try to change zoom level with mouse wheel? Because on default, map zooms towards mouse cursor location. I just need it to zoom straight up from designated center of map, regardless of mouse cursor location.

    GrecKoG 1 Reply Last reply
    0
    • T Tomzy97

      Does map have a property, so it doesn't move center if I move mouse cursor on random place on map and try to change zoom level with mouse wheel? Because on default, map zooms towards mouse cursor location. I just need it to zoom straight up from designated center of map, regardless of mouse cursor location.

      GrecKoG Offline
      GrecKoG Offline
      GrecKo
      Qt Champions 2018
      wrote on last edited by
      #2

      Maybe you could try ovelapping a MouseArea on it. Ignoring all events except the wheel ones :

      Map {
          id: map
          MouseArea {
              anchors.fill: parent
              onPressed: event.accepted = false
              onWheel: map.zoomLevel += wheel.angleDelta.y / 120 // tweak this, I have no idea if this works
          }
      }
      
      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