5

I'm using QGIS 2.16.x and the mouse wheel preference to disable zooming does not seem to be available. I've tried locking the scale but when the magnifier function is enabled, the zoom function still responds to the mouse wheel.

Is there any way to disable mouse wheel zooming in QGIS?

  • 2
    Just confirming mouse wheel action is missing in 2.16 - Map Tools - Panning and zooming. You might need to add this as new issue into hub.qgis.org if you want this functionality. – Miro Oct 25 '16 at 1:50
8

In QGIS 2.14.7 LTR there is an option to completely disable zooming using the mouse wheel from Settings -> Options -> Map Tools -> Panning and Zooming, you need to change Mouse wheel action to Nothing as you can see below:

enter image description here

However, the same option is not available in QGIS 2.16.3. But there is a new option called Magnification. When you lock the scale in QGIS and zoom using mouse wheel, the zooming here is not actually zoom but magnify the view of the screen.

I recommend to install QGIS 2.14.7 LTR to disable the mouse wheel completely, if you need this option.

  • Unfortunately 2.18.9 is missing the the ability to disable the mouse wheel on the mac. Makes the entire thing unusable IMHO. – user59365 Jul 11 '17 at 0:01
  • @swa66 You can use QGIS 2.14.16 LTR which still has this option. – ahmadhanb Jul 11 '17 at 5:33
6

Yes, I guess the mouse wheel action has become a default setting in QGIS 2.16.x. If you go to Settings > Options > Map Tools > Zoom factor, you will see the minimum value possible is 1.1. Makes sense since a factor of 1 for a given value will remain the same. So let's change the zoom factor to 1 using Python!

Paste the following in the Python Console:

from PyQt4.QtCore import QSettings
QSettings().setValue("/Qgis/zoom_factor", 1)

For QGIS 3.x:

from PyQt5.QtCore import QSettings
QSettings().setValue("/Qgis/zoom_factor", 1)

Restart QGIS and now your mouse wheel has become 'disabled'.


Note that the zoom factor will always be shown as 1.1 as that is the minimum value allowed to be shown in the widget. Also, if you go back to the Options menu and you click OK, the zoom factor will be reset to 1.1. So you will need to use the code and restart QGIS again.

  • 1
    I'm trying to do this, but without results. Paste the code, restart, but again mouse wheel zoom over the map. Thanks for help. – Pedro Martín Oct 26 '16 at 21:11
  • Apologies for the late reply. I'm using QGIS 2.16.1 on Windows 7 64-bit. Works fine for me so not sure what's going on in your end. But thanks for adding that as a feature request =) – Joseph Nov 7 '16 at 10:10
  • 1
    Doesn't work on Qgis 2.18.15 on macOS. It's not that I'd have to have it be disabled, but it's is far too reactive the smallest touch on a mouse surface that's not 100% unmoving results in the map wildly scrolling way in or way out. I guess with old fashioned mice that have clicking scroll wheels this might work, but the sensitve stuff we mac users tend to use is FAR too accelerated in Qgis. Instead of accelerating it, it needs to be slowed down by a factor of 10 or more IMHO. – user59365 Feb 15 '18 at 0:50
  • @swa66 - You should probably submit a ticket for this, they could hopefully provide a fix for this in their next iteration :) – Joseph Feb 15 '18 at 11:28
  • 1
    @JayCummins - Thank you for adding the solution for QGIS 3.x :) – Joseph Sep 27 '18 at 9:25
1

I think the correct spelling would be qgis rather than Qgis:

from PyQt4.QtCore import QSettings
QSettings().setValue("/qgis/zoom_factor", 1)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.