Logo Search packages:      
Sourcecode: qtodo version File versions  Download package

void QTodoTimeEdit::stepDown (  )  [protected, virtual]

Implements QTodoDateTimeEditBase.

Definition at line 2423 of file qtodo_datetimeedit.cpp.

References maxValue, minValue, outOfRange(), setHour(), and valueChanged().

Referenced by init().

{
      if (minValue() > maxValue())
      {
            return;
      }

      int sec = d->ed->mapSection( d->ed->focusSection() );
      bool accepted = TRUE;
      switch( sec )
      {
      case 0:
            do
            {
                  if (--d->h < 0)
                        d->h = 23;
            }
            while (outOfRange(d->h, d->m, d->s));
            break;
      case 1:
            do
            {
                  if (--d->m < 0)
                        d->m = 59;
            }
            while (outOfRange(d->h, d->m, d->s));
            break;
      case 2:
            do
            {
                  if (--d->s < 0)
                        d->s = 59;
            }
            while (outOfRange(d->h, d->m, d->s));
            break;
      case 3:
            if ( d->h > 11 )
                  setHour( d->h-12 );
            else
                  setHour( d->h+12 );
            break;
      default:
            accepted = FALSE;
#ifdef QT_CHECK_RANGE
            qWarning( "QTodoTimeEdit::stepDown: Focus section out of range!" );
#endif
            break;
      }
      if ( accepted )
      {
            d->changed = TRUE;
            emit valueChanged( time() );
      }
      d->ed->repaint( d->ed->rect(), FALSE );
}


Generated by  Doxygen 1.6.0   Back to index