Spinbox increment event?
-
Hello,
I have the following layout:
This is the code for handling the events from the spinbox Max:
void Widget::on_dsbMax_valueChanged(double arg1)
{
m_xAxis->setMax(arg1);
}void Widget::on_dsbMax_editingFinished()
{
m_xAxis->setMax(ui->dsbMax->value());
}The issue I have is because of the valueChanged slot, the axis of the graph changes during typing a value on the keyboard. But I only want to update the axis when editing is finished.
I cannot remove the valueChanged slot because the axis must also be updated with a click on the up and down arrows in the spinbox.I could check if the value has changed about the increment step to secregate the 2 behaviours. But there is maybe a more elegant way to do it.
So if someone has a better idea it would be appreciated.
-
@Bert59
As @Christian-Ehrlicher has said. But, if you have not read it already, you also ought be aware of the behaviour in https://doc.qt.io/qt-5/qabstractspinbox.html#keyboardTracking-prop . -
-
@Bert59
As @Christian-Ehrlicher has said. But, if you have not read it already, you also ought be aware of the behaviour in https://doc.qt.io/qt-5/qabstractspinbox.html#keyboardTracking-prop . -
@JonB said in Spinbox increment event?:
@Bert59
As @Christian-Ehrlicher has said. But, if you have not read it already, you also ought be aware of the behaviour in https://doc.qt.io/qt-5/qabstractspinbox.html#keyboardTracking-prop . and from https://homework-writer.com/ siteThanks bert
was just lookign for that