[Solved] disable mouse wheel event on ComboBox
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
[Solved] disable mouse wheel event on ComboBox
I have seen some thread complaining about mouse wheel event on ComboBox control.
https://forum.freecadweb.org/viewtopic.php?f=3&t=45144
Till recent FreeCAD build (0.19.21049/win64 Conda) , this issue has not been solved. I'm not coder, and cannot fully understand the difficulty of this issue, but found this issue has got solved elsewhere on the net.
https://bugreports.qt.io/browse/QTBUG-48620
https://stackoverflow.com/questions/330 ... 7#46742557
https://doc.qt.io/qt-5/qml-qtquick-cont ... abled-prop
https://stackoverflow.com/questions/324 ... -qcombobox
https://forum.freecadweb.org/viewtopic.php?f=3&t=45144
Till recent FreeCAD build (0.19.21049/win64 Conda) , this issue has not been solved. I'm not coder, and cannot fully understand the difficulty of this issue, but found this issue has got solved elsewhere on the net.
https://bugreports.qt.io/browse/QTBUG-48620
https://stackoverflow.com/questions/330 ... 7#46742557
https://doc.qt.io/qt-5/qml-qtquick-cont ... abled-prop
https://stackoverflow.com/questions/324 ... -qcombobox
Last edited by fc_tofu on Sat Jun 13, 2020 2:36 pm, edited 4 times in total.
Re: Qt Quick Controls 2 ComboBox disable mouse wheel event
FreeCAD doesn't use Qt Quick.
Re: Qt Quick Controls 2 ComboBox disable mouse wheel event
Code: Select all
from PySide2 import QtCore
from PySide2 import QtWidgets
class WheelEventFilter(QtCore.QObject):
def eventFilter(self, obj, ev):
if obj.inherits("QComboBox") and ev.type() == QtCore.QEvent.Wheel:
return True
return False
app = QtWidgets.QApplication.instance()
filter = WheelEventFilter()
app.installEventFilter(filter)
Re: Qt Quick Controls 2 ComboBox disable mouse wheel event
Thank you.
Is there a plan to merge this fix to main branch of FreeCAD?
Re: [Solved] Qt Quick Controls 2 ComboBox disable mouse wheel event
git commit c90db641881
In order to activate the filter you must create the boolean key ComboBoxWheelEventFilter in the group General and set it to true.
In order to activate the filter you must create the boolean key ComboBoxWheelEventFilter in the group General and set it to true.
Re: [Solved] Qt Quick Controls 2 ComboBox disable mouse wheel event
Good news!wmayer wrote: ↑Fri May 22, 2020 8:46 am git commit c90db641881
In order to activate the filter you must create the boolean key ComboBoxWheelEventFilter in the group General and set it to true.
Re: [Solved] Qt Quick Controls 2 ComboBox disable mouse wheel event
Thank you @wmayer, I just tested the latest build.wmayer wrote: ↑Fri May 22, 2020 8:46 am git commit c90db641881
In order to activate the filter you must create the boolean key ComboBoxWheelEventFilter in the group General and set it to true.
It seems your fix has already worked in ComboBox and ListBox(?).
With ListBox (I donnot know its exact name), I mean below.
https://forum.freecadweb.org/viewtopic.php?f=3&t=45144
Above all, manual added parameter “ComboBoxWheelEventFilter” is a must.
Congratulations!
Code: Select all
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21280 (Git)
Build type: Release
Branch: master
Hash: 6f3160db3e88733536c7eaf97ad7d6ebd21baccd
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: Chinese/China (zh_CN)
Last edited by fc_tofu on Wed Jun 03, 2020 7:26 am, edited 1 time in total.
Re: [Solved] Qt Quick Controls 2 ComboBox disable mouse wheel event
Newly introduced parameter is now documented in Fine-tuningwmayer wrote: ↑Fri May 22, 2020 8:46 am git commit c90db641881
In order to activate the filter you must create the boolean key ComboBoxWheelEventFilter in the group General and set it to true.
@wmayer : could you please extend the event filter to also return false on QAbstractSpinBox class ? Spin boxes suffer the same issue as combo boxes. Thx.