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

    r8127 r9383  
    4949};
    5050
    51 QwtLegendLayoutItem::QwtLegendLayoutItem( 
     51QwtLegendLayoutItem::QwtLegendLayoutItem(
    5252        const QwtPlotLegendItem *legendItem, const QwtPlotItem *plotItem ):
    5353    d_legendItem( legendItem ),
     
    167167};
    168168
    169 //! Constructor 
     169//! Constructor
    170170QwtPlotLegendItem::QwtPlotLegendItem():
    171171    QwtPlotItem( QwtText( "Legend" ) )
     
    194194
    195195  Alignment means the position of the legend relative
    196   to the geometry of the plot canvas. 
     196  to the geometry of the plot canvas.
    197197
    198198  \param alignment Alignment flags
     
    200200  \sa alignment(), setMaxColumns()
    201201
    202   \note To align a legend with many items horizontally 
     202  \note To align a legend with many items horizontally
    203203        the number of columns need to be limited
    204204 */
     
    262262    if ( margin != this->margin() )
    263263    {
    264         d_data->layout->setContentsMargins( 
     264        d_data->layout->setContentsMargins(
    265265            margin, margin, margin, margin );
    266266
     
    418418/*!
    419419  Set the radius for the border
    420  
     420
    421421  \param radius A value <= 0 defines a rectangular border
    422422  \sa borderRadius(), setBorderPen()
     
    495495  \brief Set the background mode
    496496
    497   Depending on the mode the complete legend or each item 
     497  Depending on the mode the complete legend or each item
    498498  might have an background.
    499499
     
    511511}
    512512
    513 /*! 
     513/*!
    514514  \return backgroundMode
    515515  \sa setBackgroundMode(), backgroundBrush(), drawBackground()
     
    568568    if ( d_data->backgroundMode == QwtPlotLegendItem::LegendBackground )
    569569        drawBackground( painter, d_data->layout->geometry() );
    570    
     570
    571571    for ( int i = 0; i <  d_data->layout->count(); i++ )
    572572    {
    573         const QwtLegendLayoutItem *layoutItem = 
     573        const QwtLegendLayoutItem *layoutItem =
    574574            static_cast<QwtLegendLayoutItem *>( d_data->layout->itemAt( i ) );
    575575
     
    595595      setBackgroundBrush(), setBackgroundMode()
    596596 */
    597 void QwtPlotLegendItem::drawBackground( 
     597void QwtPlotLegendItem::drawBackground(
    598598    QPainter *painter, const QRectF &rect ) const
    599599{
     
    602602    painter->setPen( d_data->borderPen );
    603603    painter->setBrush( d_data->backgroundBrush );
    604    
     604
    605605    const double radius = d_data->borderRadius;
    606606    painter->drawRoundedRect( rect, radius, radius );
    607    
     607
    608608    painter->restore();
    609609}
     
    624624    {
    625625        int x = qRound( canvasRect.center().x() );
    626         rect.moveCenter( QPoint( x, rect.center().y() ) ); 
     626        rect.moveCenter( QPoint( x, rect.center().y() ) );
    627627    }
    628628    else if ( d_data->alignment & Qt::AlignRight )
     
    630630        rect.moveRight( qFloor( canvasRect.right() - margin ) );
    631631    }
    632     else 
     632    else
    633633    {
    634634        rect.moveLeft( qCeil( canvasRect.left() + margin ) );
     
    644644        rect.moveBottom( qFloor( canvasRect.bottom() - margin ) );
    645645    }
    646     else 
    647     {
    648         rect.moveTop( qCeil( canvasRect.top() + margin ) ); 
     646    else
     647    {
     648        rect.moveTop( qCeil( canvasRect.top() + margin ) );
    649649    }
    650650
     
    653653
    654654/*!
    655   Update the legend items according to modifications of a 
     655  Update the legend items according to modifications of a
    656656  plot item
    657657
     
    667667    QList<QwtLegendLayoutItem *> layoutItems;
    668668
    669     QMap<const QwtPlotItem *, QList<QwtLegendLayoutItem *> >::iterator it = 
     669    QMap<const QwtPlotItem *, QList<QwtLegendLayoutItem *> >::iterator it =
    670670        d_data->map.find( plotItem );
    671671    if ( it != d_data->map.end() )
     
    692692            for ( int i = 0; i < data.size(); i++ )
    693693            {
    694                 QwtLegendLayoutItem *layoutItem = 
     694                QwtLegendLayoutItem *layoutItem =
    695695                    new QwtLegendLayoutItem( this, plotItem );
    696696                d_data->layout->addItem( layoutItem );
     
    741741 */
    742742void QwtPlotLegendItem::drawLegendData( QPainter *painter,
    743     const QwtPlotItem *plotItem, const QwtLegendData &data, 
     743    const QwtPlotItem *plotItem, const QwtLegendData &data,
    744744    const QRectF &rect ) const
    745745{
     
    758758        QRectF iconRect( r.topLeft(), graphic.defaultSize() );
    759759
    760         iconRect.moveCenter( 
     760        iconRect.moveCenter(
    761761            QPoint( iconRect.center().x(), rect.center().y() ) );
    762762
     
    822822  \param width Width
    823823*/
    824 int QwtPlotLegendItem::heightForWidth( 
     824int QwtPlotLegendItem::heightForWidth(
    825825    const QwtLegendData &data, int width ) const
    826826{
     
    842842}
    843843
    844 /*! 
     844/*!
    845845  \return All plot items with an entry on the legend
    846846  \note A plot item might have more than one entry on the legend
     
    855855  \note Usually a plot item has only one entry on the legend
    856856*/
    857 QList< QRect > QwtPlotLegendItem::legendGeometries( 
     857QList< QRect > QwtPlotLegendItem::legendGeometries(
    858858    const QwtPlotItem *plotItem ) const
    859859{
Note: See TracChangeset for help on using the changeset viewer.