View Full Version : QDial disabling key scroll and mouse wheel scroll

2nd June 2010, 23:20
I have GUI that interfaces with a piece of hardware. I'm using QDials to send commands to the hardware. The problem is that the hardware can't react fast enough to the constant valueChanged signals being sent from the dial. So what I want to do is just update the hardware when the sliderReleased signal is sent. But the dials values can be changed by using the mouse scroll wheel or the left and right keyboard arrows without sending a sliderReleased signal. So my question: How can I make my dials ignore the key arrows and mouse scroll wheel so that the only way to change the dial is click it and drag it? Thanks in advance!

2nd June 2010, 23:34
See the tracking property of the QDial class. If you still need to ignore keyboard events, extend the QDial class and re-implement the keyEvent handler, or install an event filter that ignores them.

3rd June 2010, 00:05
Hey, thanks a lot for the reply. Setting the tracking property to false won't work because I'm using the valueChanged signal to update a display that shows the current value of the dial. But re-implementing the necessary events looks like it will work!