I have two spinBoxes ( spinBox1
and spinBox2
) and I need one signal that sends the values of both of the spinboxes and I need it to be triggered when either one of the values of the spinboxes is changed. How can I do this?
I will connect this with C++ slots and do math with it in C++ later. I have sucessfully been able to do all those things with single argument signals that have a single trigger but this is a little more complicated.
Help is much needed and appreciated.
Connect your signal to a slot that takes 2 parameters.
Rectangle {
signal somethingChanged(double, double)
function exportSignals() {
somethingChanged(spinBox1.value, spinBox2.value)
}
SpinBox {
id: spinBox1
onValueChanged: exportSignals()
}
SpinBox {
id: spinBox2
onValueChanged: exportSignals()
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.