QDoubleSpinBox: valueChanged only by the user
-
Hi all,
I have a QDoubleSpinBox that can be modified both by the user and programmatically and a slot associated to the signal valueChanged. But I would like this slot to be called ONLY if the change has been made by the user.
I would like to avoid an ugly attribute like @bool MainWindow::value_changed_programmatically;@
Is there any Qt-only way to do this?
Example:
@ void MainWindow::refreshView() {
_ui.doublebox->setValue(someValue); // this should not call the slot
}void MainWindow::on_doublebox_valueChanged(double d) { // take the new value into account ONLY if the user did the change }@
Thanks
-
Hi,
IIRC editingFinished might be what you need.
Hope it helps
-
Yes thanks! Sorry for the late reply :)
-
Yes thanks! Sorry for the late reply :)
-
You're welcome ! No problem, it happens to all of us ;)
-
You're welcome ! No problem, it happens to all of us ;)