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

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

Implements QTodoDateTimeEditBase.

Definition at line 2366 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
            {
                  d->h = (d->h + 1) % 24;
            }
            while (outOfRange(d->h, d->m, d->s));
            break;
      case 1:
            do
            {
                  d->m = (d->m + 1) % 60;
            }
            while (outOfRange(d->h, d->m, d->s));
            break;
      case 2:
            do
            {
                  d->s = (d->s + 1) % 60;
            }
            while (outOfRange(d->h, d->m, d->s));
            break;
      case 3:
            if ( d->h < 12 )
                  setHour( d->h+12 );
            else
                  setHour( d->h-12 );
            break;
      default:
            accepted = FALSE;
#ifdef QT_CHECK_RANGE
            qWarning( "QTodoTimeEdit::stepUp: 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