Changeset 9383 in ntrip for trunk/BNC/qwt/qwt_date.cpp


Ignore:
Timestamp:
Mar 19, 2021, 9:15:03 AM (3 years ago)
Author:
stoecker
Message:

update to qwt verion 6.1.1 to fix build with newer Qt5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/qwt/qwt_date.cpp

    r8127 r9383  
    3232#endif
    3333
    34 static QString qwtExpandedFormat( const QString & format, 
     34static QString qwtExpandedFormat( const QString & format,
    3535    const QDateTime &dateTime, QwtDate::Week0Type week0Type )
    3636{
     
    195195}
    196196
    197 static inline void qwtFloorTime( 
     197static inline void qwtFloorTime(
    198198    QwtDate::IntervalType intervalType, QDateTime &dt )
    199199{
     
    224224            dt.setTime( QTime( t.hour(), 0, 0 ) );
    225225            break;
    226         }   
     226        }
    227227        default:
    228228            break;
     
    233233}
    234234
    235 static inline QDateTime qwtToTimeSpec( 
     235static inline QDateTime qwtToTimeSpec(
    236236    const QDateTime &dt, Qt::TimeSpec spec )
    237237{
     
    255255}
    256256
     257#if 0
     258
    257259static inline double qwtToJulianDay( int year, int month, int day )
    258260{
     
    280282    if ( a < 0 )
    281283        a -= b - 1;
    282        
     284
    283285    return a / b;
    284 }   
     286}
     287
     288#endif
    285289
    286290static inline QDate qwtToDate( int year, int month = 1, int day = 1 )
     
    319323  Translate from double to QDateTime
    320324
    321   \param value Number of milliseconds since the epoch, 
     325  \param value Number of milliseconds since the epoch,
    322326               1970-01-01T00:00:00 UTC
    323327  \param timeSpec Time specification
     
    373377
    374378    const QTime time = dt.time();
    375     const double secs = 3600.0 * time.hour() + 
     379    const double secs = 3600.0 * time.hour() +
    376380        60.0 * time.minute() + time.second();
    377381
     
    383387
    384388  \param dateTime Datetime value
    385   \param intervalType Interval type, how to ceil. 
     389  \param intervalType Interval type, how to ceil.
    386390                      F.e. when intervalType = QwtDate::Months, the result
    387391                      will be ceiled to the next beginning of a month
     
    451455        {
    452456            dt.setTime( QTime( 0, 0 ) );
    453             dt.setDate( qwtToDate( dateTime.date().year(), 
     457            dt.setDate( qwtToDate( dateTime.date().year(),
    454458                dateTime.date().month() ) );
    455459
     
    484488
    485489  \param dateTime Datetime value
    486   \param intervalType Interval type, how to ceil. 
     490  \param intervalType Interval type, how to ceil.
    487491                      F.e. when intervalType = QwtDate::Months,
    488                       the result will be ceiled to the next 
     492                      the result will be ceiled to the next
    489493                      beginning of a month
    490494  \return Floored datetime
    491495  \sa floor()
    492496 */
    493 QDateTime QwtDate::floor( const QDateTime &dateTime, 
     497QDateTime QwtDate::floor( const QDateTime &dateTime,
    494498    IntervalType intervalType )
    495499{
     
    533537            dt.setTime( QTime( 0, 0 ) );
    534538
    535             const QDate date = qwtToDate( dt.date().year(), 
     539            const QDate date = qwtToDate( dt.date().year(),
    536540                dt.date().month() );
    537541            dt.setDate( date );
     
    556560  Minimum for the supported date range
    557561
    558   The range of valid dates depends on how QDate stores the 
     562  The range of valid dates depends on how QDate stores the
    559563  Julian day internally.
    560564
     
    577581  Maximum for the supported date range
    578582
    579   The range of valid dates depends on how QDate stores the 
     583  The range of valid dates depends on how QDate stores the
    580584  Julian day internally.
    581585
     
    600604
    601605  The first day of a week depends on the current locale
    602   ( QLocale::firstDayOfWeek() ). 
     606  ( QLocale::firstDayOfWeek() ).
    603607
    604608  \param year Year
     
    607611
    608612  \sa QLocale::firstDayOfWeek(), weekNumber()
    609  */ 
     613 */
    610614QDate QwtDate::dateOfWeek0( int year, Week0Type type )
    611615{
     
    624628    {
    625629        // according to ISO 8601 the first week is defined
    626         // by the first thursday. 
     630        // by the first thursday.
    627631
    628632        int d = Qt::Thursday - firstDayOfWeek;
     
    641645
    642646  - QwtDate::FirstThursday\n
    643     Corresponding to ISO 8601 ( see QDate::weekNumber() ). 
     647    Corresponding to ISO 8601 ( see QDate::weekNumber() ).
    644648
    645649  - QwtDate::FirstDay\n
     
    737741    week number with a leading zero ( 01 - 53 )
    738742
    739   As week 1 usually starts in the previous year a special rule 
     743  As week 1 usually starts in the previous year a special rule
    740744  is applied for formats, where the year is expected to match the
    741745  week number - even if the date belongs to the previous year.
Note: See TracChangeset for help on using the changeset viewer.