I want to discount the value of a spinBox in the other spinBox
Moved
Unsolved
General and Desktop
-
hi, I would like to know how a value is deducted from a spinBox and I add it to the other simultaneously, so I want the user X number to use in the intellect spinBox so it will deduct from the total spinBox and add it to the intellect spinBox, as I do this action.
-
@milhao I'm not sure what you really mean, please rephrase.
In general you're going to use signals/slots: connect a slot to https://doc.qt.io/qt-6/qspinbox.html#valueChanged and then set the value in the other spin box using https://doc.qt.io/qt-6/qspinbox.html#value-prop. If you want to add the value from the first spin box to the value of the second one then do it in the same way except you call:// value is the value from the first spin box coming via the valueChanged signal ui->secondSpinBox->setValue(ui->secondSpinBox->value() + value);