PDA

View Full Version : Avoiding system signals



brevleq
7th January 2009, 01:52
I have a connection in a QSpinBox, but I need differentiate who emitted the signal, user or code, how can I do it??

The signal is valueChanged.

fanat9
7th January 2009, 14:59
Not really sure why you will need it, but the only way I see is to track of mouse/keyboard events for same SpinBox as well. So if valueChanged() emitted - check for previous mousePressEvent()/KeyboardPressEvent()/keyboardReleaseEvent() for that spinbox in your custom list of events, then clear that list for next iteration.

jpn
7th January 2009, 15:37
You can block signals temporarily meanwhile setting the value in code:


spinBox->blockSignals(true);
spinBox->setValue(...);
spinBox->blockSignals(false);