Changeset 9383 in ntrip for trunk/BNC/qwt/qwt_plot_marker.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_plot_marker.cpp

    r8127 r9383  
    135135    const QRectF &canvasRect ) const
    136136{
    137     const QPointF pos( xMap.transform( d_data->xValue ), 
     137    const QPointF pos( xMap.transform( d_data->xValue ),
    138138        yMap.transform( d_data->yValue ) );
    139139
     
    148148        const QSizeF sz = d_data->symbol->size();
    149149
    150         const QRectF clipRect = canvasRect.adjusted( 
     150        const QRectF clipRect = canvasRect.adjusted(
    151151            -sz.width(), -sz.height(), sz.width(), sz.height() );
    152152
     
    338338/*!
    339339  \brief Set the line style
    340   \param style Line style. 
     340  \param style Line style.
    341341  \sa lineStyle()
    342342*/
     
    424424  In all other styles the alignment is relative to the marker's position.
    425425
    426   \param align Alignment. 
     426  \param align Alignment.
    427427  \sa labelAlignment(), labelOrientation()
    428428*/
     
    503503}
    504504
    505 /*! 
     505/*!
    506506  Build and assign a line pen
    507    
     507
    508508  In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it
    509509  non cosmetic ( see QPen::isCosmetic() ). This method has been introduced
    510510  to hide this incompatibility.
    511    
     511
    512512  \param color Pen color
    513513  \param width Pen width
    514514  \param style Pen style
    515    
     515
    516516  \sa pen(), brush()
    517  */ 
     517 */
    518518void QwtPlotMarker::setLinePen( const QColor &color, qreal width, Qt::PenStyle style )
    519 {   
     519{
    520520    setLinePen( QPen( color, width, style ) );
    521521}
     
    549549QRectF QwtPlotMarker::boundingRect() const
    550550{
    551     return QRectF( d_data->xValue, d_data->yValue, 0.0, 0.0 );
     551    // width/height of -1 does not affect the autoscale calculation
     552
     553    switch (d_data->style)
     554    {
     555        case QwtPlotMarker::HLine:
     556            return QRectF( d_data->xValue, d_data->yValue, -1.0, 0.0 );
     557
     558        case QwtPlotMarker::VLine:
     559            return QRectF( d_data->xValue, d_data->yValue, 0.0, -1.0 );
     560
     561        default :
     562            return QRectF( d_data->xValue, d_data->yValue, 0.0, 0.0 );
     563    }
    552564}
    553565
     
    555567   \return Icon representing the marker on the legend
    556568
    557    \param index Index of the legend entry 
     569   \param index Index of the legend entry
    558570                ( usually there is only one )
    559571   \param size Icon size
     
    586598            const double y = 0.5 * size.height();
    587599
    588             QwtPainter::drawLine( &painter, 
     600            QwtPainter::drawLine( &painter,
    589601                0.0, y, size.width(), y );
    590602        }
     
    595607            const double x = 0.5 * size.width();
    596608
    597             QwtPainter::drawLine( &painter, 
     609            QwtPainter::drawLine( &painter,
    598610                x, 0.0, x, size.height() );
    599611        }
Note: See TracChangeset for help on using the changeset viewer.