Ignore:
Timestamp:
May 10, 2017, 3:20:54 PM (7 years ago)
Author:
stoecker
Message:

update qwt and qwtpolar, many QT5 fixes (unfinished)

File:
1 edited

Legend:

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

    r4271 r8127  
    1515#if QT_VERSION < 0x040601
    1616#define qAtan2(y, x) ::atan2(y, x)
     17#define qFastSin(x) qSin(x)
     18#define qFastCos(x) qCos(x)
    1719#endif
    1820
     
    149151{
    150152    return d_data->brush;
     153}
     154
     155/*!
     156  Build and assign a pen
     157   
     158  In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it
     159  non cosmetic ( see QPen::isCosmetic() ). This method has been introduced
     160  to hide this incompatibility.
     161
     162  \param color Pen color
     163  \param width Pen width
     164  \param style Pen style
     165   
     166  \sa pen(), brush()
     167 */
     168void QwtIntervalSymbol::setPen( const QColor &color,
     169    qreal width, Qt::PenStyle style )
     170{   
     171    setPen( QPen( color, width, style ) );
    151172}
    152173
     
    232253                    double dw2 = sw / 2.0;
    233254
    234                     const double cx = qCos( angle ) * dw2;
    235                     const double sy = qSin( angle ) * dw2;
     255                    const double cx = qFastCos( angle ) * dw2;
     256                    const double sy = qFastSin( angle ) * dw2;
    236257
    237258                    QwtPainter::drawLine( painter,
     
    280301                    double dw2 = sw / 2.0;
    281302
    282                     const int cx = qCos( angle ) * dw2;
    283                     const int sy = qSin( angle ) * dw2;
     303                    const double cx = qFastCos( angle ) * dw2;
     304                    const double sy = qFastSin( angle ) * dw2;
    284305
    285306                    QPolygonF polygon;
Note: See TracChangeset for help on using the changeset viewer.