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_plot_tradingcurve.cpp

    r8127 r9383  
    135135/*!
    136136  Assign a series of samples
    137    
     137
    138138  setSamples() is just a wrapper for setData() without any additional
    139139  value - beside that it is easier to find for the developer.
    140    
     140
    141141  \param data Data
    142142  \warning The item takes ownership of the data object, deleting
    143            it when its not used anymore. 
     143           it when its not used anymore.
    144144*/
    145145void QwtPlotTradingCurve::setSamples(
     
    147147{
    148148    setData( data );
    149 }   
     149}
    150150
    151151/*!
     
    177177}
    178178
    179 /*! 
     179/*!
    180180  Build and assign the symbol pen
    181    
     181
    182182  In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it
    183183  non cosmetic ( see QPen::isCosmetic() ). This method has been introduced
    184184  to hide this incompatibility.
    185    
     185
    186186  \param color Pen color
    187187  \param width Pen width
    188188  \param style Pen style
    189    
     189
    190190  \sa pen(), brush()
    191  */ 
    192 void QwtPlotTradingCurve::setSymbolPen( 
     191 */
     192void QwtPlotTradingCurve::setSymbolPen(
    193193    const QColor &color, qreal width, Qt::PenStyle style )
    194 {   
     194{
    195195    setSymbolPen( QPen( color, width, style ) );
    196196}
     
    236236    Direction direction, const QBrush &brush )
    237237{
    238     if ( direction < 0 || direction >= 2 )
     238    // silencing -Wtautological-constant-out-of-range-compare
     239    const int index = static_cast< int >( direction );
     240    if ( index < 0 || index >= 2 )
    239241        return;
    240242
    241     if ( brush != d_data->symbolBrush[ direction ] )
    242     {
    243         d_data->symbolBrush[ direction ] = brush;
     243    if ( brush != d_data->symbolBrush[ index ] )
     244    {
     245        d_data->symbolBrush[ index ] = brush;
    244246
    245247        legendChanged();
     
    257259QBrush QwtPlotTradingCurve::symbolBrush( Direction direction ) const
    258260{
    259     if ( direction < 0 || direction >= 2 )
     261    const int index = static_cast< int >( direction );
     262    if ( index < 0 || index >= 2 )
    260263        return QBrush();
    261264
    262     return d_data->symbolBrush[ direction ];
     265    return d_data->symbolBrush[ index ];
    263266}
    264267
     
    273276  \param extent Symbol width in scale coordinates
    274277
    275   \sa symbolExtent(), scaledSymbolWidth(), 
     278  \sa symbolExtent(), scaledSymbolWidth(),
    276279      setMinSymbolWidth(), setMaxSymbolWidth()
    277280*/
     
    338341    {
    339342        d_data->maxSymbolWidth = width;
    340    
     343
    341344        legendChanged();
    342345        itemChanged();
     
    360363{
    361364    QRectF rect = QwtPlotSeriesItem::boundingRect();
    362     if ( rect.isValid() && orientation() == Qt::Vertical )
     365    if ( orientation() == Qt::Vertical )
    363366        rect.setRect( rect.y(), rect.x(), rect.height(), rect.width() );
    364367
     
    487490                case Bar:
    488491                {
    489                     drawBar( painter, translatedSample, 
     492                    drawBar( painter, translatedSample,
    490493                        orient, inverted, symbolWidth );
    491494                    break;
     
    494497                {
    495498                    painter->setBrush( d_data->symbolBrush[ brushIndex ] );
    496                     drawCandleStick( painter, translatedSample, 
     499                    drawCandleStick( painter, translatedSample,
    497500                        orient, symbolWidth );
    498501                    break;
     
    521524  \param sample Samples already translated into paint device coordinates
    522525  \param orientation Vertical or horizontal
    523   \param inverted True, when the opposite scale 
     526  \param inverted True, when the opposite scale
    524527                  ( Qt::Vertical: x, Qt::Horizontal: y ) is increasing
    525528                  in the opposite direction as QPainter coordinates.
     
    555558*/
    556559void QwtPlotTradingCurve::drawBar( QPainter *painter,
    557     const QwtOHLCSample &sample, Qt::Orientation orientation, 
     560    const QwtOHLCSample &sample, Qt::Orientation orientation,
    558561    bool inverted, double width ) const
    559562{
     
    594597*/
    595598void QwtPlotTradingCurve::drawCandleStick( QPainter *painter,
    596     const QwtOHLCSample &sample, Qt::Orientation orientation, 
     599    const QwtOHLCSample &sample, Qt::Orientation orientation,
    597600    double width ) const
    598601{
     
    628631  \return A rectangle filled with the color of the symbol pen
    629632
    630   \param index Index of the legend entry 
     633  \param index Index of the legend entry
    631634                ( usually there is only one )
    632635  \param size Icon size
     
    671674        ( orientation() == Qt::Vertical ) ? &xMap : &yMap;
    672675
    673     const double pos = map->transform( map->s1() + d_data->symbolExtent ); 
     676    const double pos = map->transform( map->s1() + d_data->symbolExtent );
    674677
    675678    double width = qAbs( pos - map->p1() );
Note: See TracChangeset for help on using the changeset viewer.