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.
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.
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.
You can block signals temporarily meanwhile setting the value in code:
Qt Code:
spinBox->blockSignals(true); spinBox->setValue(...); spinBox->blockSignals(false);To copy to clipboard, switch view to plain text mode
J-P Nurmi
Bookmarks