I'm using a QSlider and I've sub classed it and implemented the keyPressEvent.

I'm not entirely sure of the sequence of things, but, I can see with print statements that the keyReleaseEvent fire, then keyPressEvent, and subsequently the valueChanged signal gets fired.

In this case, the up/down arrow key is of interest and is handled in the keyPressed event.

Depending on other states in the program I need to decide if, in the valueChanged code, whether to update the associated data and send udp output or just update the data.

Since the value changed code is in the main window and the keyRelease code in in the slider class how do I communicate between them to let the valueChange code make the decisions.

Also, is it good practice to do a lot of work in the keyRelease that calls code in the main window code? For instance calling methods in children of the main window and/or setting values in the mainWindow.