Primitives like int do not have slots. All you need to do is connect the spinbox signal to a function that updates the value of rollangle:
connect(spinrotate, SIGNAL(valueChanged(int), this, SLOT(updateRollAngle(int));
...
void YourClass::updaterollAngle(int i)
{
rollangle = i;
}
connect(spinrotate, SIGNAL(valueChanged(int), this, SLOT(updateRollAngle(int));
...
void YourClass::updaterollAngle(int i)
{
rollangle = i;
}
To copy to clipboard, switch view to plain text mode
By the way, you are sort of correct with regards to
both signal and slot should be of the same type
They have to have the same parameters, or, failing that, the signal may have more parameters in which case the extra ones are ignored by the slot. However, even in that case the parameters that are not ignored by the slot must be the same as those in the slot.
Bookmarks