Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

The dropdownlists in QGIS form has an advanced action behaviour i.e. the items in a dropdownlist are getting scrolled while we scroll the mouse wheel by focusing over the control.

I don't want this behaviour and I need to disable this. Is there any existing plug-in to achieve this? or give me suggestions on this.

Thanks.

share|improve this question
    
please consider marking the solution as answered if it resolved your issue.. –  vinayan Aug 3 '12 at 15:19
add comment

1 Answer 1

up vote 1 down vote accepted

I believe the behavior you are referring to is when you are scrolling a long form layout that contains certain widgets, e.g. combo boxes, with the mouse wheel and when the mouse hovers over those widgets the scroll wheel changes its value instead of continuing to scroll the layout.

QGIS uses the Qt GUI toolkit and this behavior is a 'feature' on some platforms and considered a 'bug' on others. Specially, it is very much non-standard Mac OS X GUI behavior:

https://bugreports.qt-project.org/browse/QTBUG-8428
https://bugreports.qt-project.org/browse/QTBUG-20182

If you are creating your own form for a PyQGIS plugin, you can fix this by subclassing the Qt widget and reimplementing its wheelEvent:

http://stackoverflow.com/questions/3241830/qt-how-to-disable-mouse-scrolling-of-qcombobox

Just setting the focus for the widget to something non-wheel does not fix the issue. Installing an event filter on the widget will also work, but may slow down the responsiveness of your GUI.

As far as the widgets in QGIS go, every one of them that exhibits the behavior would need to be subclassed to take care of this Qt-specific issue, which will probably not be happening anytime soon. The issue really needs to be addressed by the Qt project and for particular platforms where it is non-standard behavior.

share|improve this answer
    
Thanks Larry!! The scenario which you said in the answer is exact issue what I am facing. Brillant. –  Vasudevan Periasamy Aug 3 '12 at 11:49
    
Your detailed answer makes me very comfortable and I am getting that we can create a python QGIS plug-in to resolve the issue. But I am new to QGIS and never worked on QGIS customization. It would be very helpful to me if someone provide a plug-in which has the required functionality available. Thanks. –  Vasudevan Periasamy Aug 3 '12 at 12:00
1  
You could create a custom form if you want more control over the layout woostuff.wordpress.com/2011/09/05/… –  Nathan W Aug 3 '12 at 13:23
1  
Vasu, you can create a custom feature-editing form, like Nathan suggested, or your own plugin and have control over the wheel events of the widgets used in your Qt form layouts. However, I doubt creating a plugin that affects all of QGIS's form widgets is a reasonable approach (unless it's just a small number). One would have to install many event filters, which would not be prudent. The fix for QGIS's widgets should come from Qt. Otherwise, one would have to edit the C++ source of QGIS and subclass every type of widget that exhibits the problem, which I doubt any developers would do. –  dakcarto Aug 3 '12 at 18:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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