degreeField=new QLineEdit(this);degreeLabel=new QLabel(this);minuteField=new QLineEdit(this);minuteLabel=new QLabel(this);secondField=new QLineEdit(this);secondLabel=new QLabel(this);degreeValidator=new QIntValidator(0, 360, degreeField);degreeField->setValidator(degreeValidator);minuteValidator=new QIntValidator(0, 60, minuteField);minuteField->setValidator(minuteValidator);secondValidator=new QDoubleValidator(0.0, 60.0, 5, secondField);secondField->setValidator(secondValidator);
... long entered = input.toLong( &ok ); if ( !ok || (entered < 0 && b >= 0) ) { return Invalid; } else if ( entered >= b && entered <= t ) { return Acceptable; } else { if ( entered >= 0 ) return ( entered > t ) ? Invalid : Intermediate; else return ( entered < b ) ? Invalid : Intermediate; }
... if ( entered < b || entered > t ) return Intermediate; else return Acceptable;