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

QString QTodoTimeEdit::sectionText ( int  sec  )  [private]

For internal use only.

Returns the text of section sec.

Definition at line 2577 of file qtodo_datetimeedit.cpp.

Referenced by sectionFormattedText(), and setFocusSection().

{
      sec = d->ed->mapSection( sec );

      QString txt;
      switch( sec )
      {
      case 0:
            if ( !(d->display & AMPM) || ( d->h < 13 && d->h ) )
            {    // I wished the day stared at 0:00 for everybody
                  txt = QString::number( d->h );
            }
            else
            {
                  if ( d->h )
                        txt = QString::number( d->h - 12 );
                  else
                        txt = "12";
            }
            break;
      case 1:
            txt = QString::number( d->m );
            break;
      case 2:
            txt = QString::number( d->s );
            break;
      case 3:
            if ( d->h < 12 )
            {
                  if ( lAM )
                        txt = *lAM;
                  else
                        txt = QString::fromLatin1( "AM" );
            }
            else
            {
                  if ( lPM )
                        txt = *lPM;
                  else
                        txt = QString::fromLatin1( "PM" );
            }
            break;
      default:
            break;
      }
      return txt;
}


Generated by  Doxygen 1.6.0   Back to index