What he meant is:
use spinbox signal valueChanged(int);
That way each time value change You will get value in your slot. Then do something like was posted earlier, i.e. check if value is < 20 if true set spinbox value to 1, if false don't do anything or set the value Yourself. That way you can do almost anything with spinbox, i.e. setting different singleStep depending on the actual value range.

Qt Code:
  1. if( a == 2) ui->spinBox->setValue( 20 );
  2. if( a == 19) ui->spinBox->setValue( 1 );
To copy to clipboard, switch view to plain text mode 
These code do the trick, paste it in slot connected to signal valueChanged(int );, a is int slot value, and ui->spinBox is a spinbox placed on a form. Range is 0,1,20-30... (by default spinbox settings)