[REOPEN] [SOLVED] How to disable input value change with scroll wheel?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[REOPEN] [SOLVED] How to disable input value change with scroll wheel?
IMHO, it's a dangerous decision for an engineering application to let the user change a numerical input value with mouse scroll wheel, because a value might be accidentally changed while scrolling in the property window.
How can we disable the "scroll to change" behaviour for all inputs?
How can we disable the "scroll to change" behaviour for all inputs?
Last edited by ceremcem on Tue Sep 11, 2018 7:27 am, edited 1 time in total.
Assembly 3 notes: https://github.com/ceremcem/freecad-notes
Re: How to disable input value change with scroll wheel?
This has hapened to me several time, while I hardly use the scroll function. However, I'm afraid that this is some Qt standard inheritance.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
-
- Veteran
- Posts: 5505
- Joined: Thu Apr 05, 2018 1:53 am
Re: How to disable input value change with scroll wheel?
This was discussed by core developers in 2011: https://www.freecadweb.org/tracker/view.php?id=377
Re: How to disable input value change with scroll wheel?
I believe Qt would provide some mechanism to override this behavior (like this), so I guess this is totally a task of FreeCAD.TheMarkster wrote: ↑Fri Sep 07, 2018 6:10 pm This was discussed by core developers in 2011: https://www.freecadweb.org/tracker/view.php?id=377
I think this may lead even more serious issues since we are not able to use "git diff" like verification mechanism to detect any accidental data changes.
Assembly 3 notes: https://github.com/ceremcem/freecad-notes
-
- Veteran
- Posts: 5505
- Joined: Thu Apr 05, 2018 1:53 am
Re: How to disable input value change with scroll wheel?
I think there are ways provided by Qt. I searched for it after reading your post, and found something related to event filters and subclassing. I'm not sure about it being totally a task of FreeCAD. Generally, applications should not go about modifying the way system-wide components behave, absent some need unique to that application for doing so.
By the way, I also find the behavior to be both a blessing and a curse at different times. It's a very convenient way to change the value of a property, especially if the value you want falls on a whole number integer value, but it's annoying when it happens by accident. I think a better implementation would be to require shift+scroll (or similar) to change the contents.
Re: How to disable input value change with scroll wheel?
I was thinking exactly the same: I would define this behavior as "a controlled version of scroll to change the value", thus I thought Ctrl+scroll. But anything other than a simple scroll would suffice.TheMarkster wrote: ↑Fri Sep 07, 2018 8:38 pm I think a better implementation would be to require shift+scroll (or similar) to change the contents.
Assembly 3 notes: https://github.com/ceremcem/freecad-notes
Re: How to disable input value change with scroll wheel?
Not sure, but I think this is C++ http://doc.qt.io/archives/qt-4.8/qspinbox.html I don't think we use Qtquick.
Never said this before, but this should probably be moved or transition the discussion to the Developers sub-Forum.
"fight the good fight"
- wandererfan
- Veteran
- Posts: 6268
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: How to disable input value change with scroll wheel?
I'm in the curse camp, I'm afraid. I change values with the scroll wheel by accident far more often than on purpose.TheMarkster wrote: ↑Fri Sep 07, 2018 8:38 pm By the way, I also find the behavior to be both a blessing and a curse at different times. It's a very convenient way to change the value of a property, especially if the value you want falls on a whole number integer value, but it's annoying when it happens by accident. I think a better implementation would be to require shift+scroll (or similar) to change the contents.
<technobabble>
Gui::QuantitySpinBox and Gui::UIntSpinBox have FocusPolicy = Qt::WheelFocus by default. The problem can be partly solved by setting the FocusPolicy to Qt::StrongFocus instead. Here is a discussion from stackoverflow about handling this situation.
The code changes would be in /Gui/propertyeditor/PropertyItem.cpp, but I don't know the ramifications of setting StrongFocus everywhere.
</technobabble>
@wmayer or somebody else familiar with the property editor would have to pass judgement on this one.
Re: [SOLVED] How to disable input value change with scroll wheel?
@realthunder has solved the issue. Currently it seems it's safer to navigate in the property window.
Assembly 3 notes: https://github.com/ceremcem/freecad-notes
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am