Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_plot_marker.cpp


Ignore:
Timestamp:
Nov 3, 2026, 10:53:35 AM (3 weeks ago)
Author:
stuerze
Message:

deprecated functions exchanged libs updated

File:
1 edited

Legend:

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

    r9383 r11158  
    1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
     1/******************************************************************************
    22 * Qwt Widget Library
    33 * Copyright (C) 1997   Josef Wilgen
    … …  
    1313#include "qwt_symbol.h"
    1414#include "qwt_text.h"
     15#include "qwt_graphic.h"
    1516#include "qwt_math.h"
     17
    1618#include <qpainter.h>
    1719
    1820class QwtPlotMarker::PrivateData
    1921{
    20 public:
    21     PrivateData():
    22         labelAlignment( Qt::AlignCenter ),
    23         labelOrientation( Qt::Horizontal ),
    24         spacing( 2 ),
    25         symbol( NULL ),
    26         style( QwtPlotMarker::NoLine ),
    27         xValue( 0.0 ),
    28         yValue( 0.0 )
     22  public:
     23    PrivateData()
     24        : labelAlignment( Qt::AlignCenter )
     25        , labelOrientation( Qt::Horizontal )
     26        , spacing( 2 )
     27        , symbol( NULL )
     28        , style( QwtPlotMarker::NoLine )
     29        , xValue( 0.0 )
     30        , yValue( 0.0 )
    2931    {
    3032    }
    … …  
    4143
    4244    QPen pen;
    43     const QwtSymbol *symbol;
     45    const QwtSymbol* symbol;
    4446    LineStyle style;
    4547
    … …  
    4951
    5052//! Sets alignment to Qt::AlignCenter, and style to QwtPlotMarker::NoLine
    51 QwtPlotMarker::QwtPlotMarker( const QString &title ):
    52     QwtPlotItem( QwtText( title ) )
    53 {
    54     d_data = new PrivateData;
     53QwtPlotMarker::QwtPlotMarker()
     54{
     55    m_data = new PrivateData;
    5556    setZ( 30.0 );
    5657}
    5758
    5859//! Sets alignment to Qt::AlignCenter, and style to QwtPlotMarker::NoLine
    59 QwtPlotMarker::QwtPlotMarker( const QwtText &title ):
    60     QwtPlotItem( title )
    61 {
    62     d_data = new PrivateData;
     60QwtPlotMarker::QwtPlotMarker( const QString& title )
     61    : QwtPlotItem( QwtText( title ) )
     62{
     63    m_data = new PrivateData;
     64    setZ( 30.0 );
     65}
     66
     67//! Sets alignment to Qt::AlignCenter, and style to QwtPlotMarker::NoLine
     68QwtPlotMarker::QwtPlotMarker( const QwtText& title )
     69    : QwtPlotItem( title )
     70{
     71    m_data = new PrivateData;
    6372    setZ( 30.0 );
    6473}
    … …  
    6776QwtPlotMarker::~QwtPlotMarker()
    6877{
    69     delete d_data;
     78    delete m_data;
    7079}
    7180
    … …  
    7988QPointF QwtPlotMarker::value() const
    8089{
    81     return QPointF( d_data->xValue, d_data->yValue );
     90    return QPointF( m_data->xValue, m_data->yValue );
    8291}
    8392
    … …  
    8594double QwtPlotMarker::xValue() const
    8695{
    87     return d_data->xValue;
     96    return m_data->xValue;
    8897}
    8998
    … …  
    91100double QwtPlotMarker::yValue() const
    92101{
    93     return d_data->yValue;
     102    return m_data->yValue;
    94103}
    95104
    … …  
    103112void QwtPlotMarker::setValue( double x, double y )
    104113{
    105     if ( x != d_data->xValue || y != d_data->yValue )
    106     {
    107         d_data->xValue = x;
    108         d_data->yValue = y;
     114    if ( x != m_data->xValue || y != m_data->yValue )
     115    {
     116        m_data->xValue = x;
     117        m_data->yValue = y;
    109118        itemChanged();
    110119    }
    … …  
    114123void QwtPlotMarker::setXValue( double x )
    115124{
    116     setValue( x, d_data->yValue );
     125    setValue( x, m_data->yValue );
    117126}
    118127
    … …  
    120129void QwtPlotMarker::setYValue( double y )
    121130{
    122     setValue( d_data->xValue, y );
    123 }
    124 
    125 /*!
    126   Draw the marker
    127 
    128   \param painter Painter
    129   \param xMap x Scale Map
    130   \param yMap y Scale Map
    131   \param canvasRect Contents rectangle of the canvas in painter coordinates
    132 */
    133 void QwtPlotMarker::draw( QPainter *painter,
    134     const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    135     const QRectF &canvasRect ) const
    136 {
    137     const QPointF pos( xMap.transform( d_data->xValue ),
    138         yMap.transform( d_data->yValue ) );
    139 
    140     // draw lines
     131    setValue( m_data->xValue, y );
     132}
     133
     134/*!
     135   Draw the marker
     136
     137   \param painter Painter
     138   \param xMap x Scale Map
     139   \param yMap y Scale Map
     140   \param canvasRect Contents rectangle of the canvas in painter coordinates
     141 */
     142void QwtPlotMarker::draw( QPainter* painter,
     143    const QwtScaleMap& xMap, const QwtScaleMap& yMap,
     144    const QRectF& canvasRect ) const
     145{
     146    const QPointF pos( xMap.transform( m_data->xValue ),
     147        yMap.transform( m_data->yValue ) );
    141148
    142149    drawLines( painter, canvasRect, pos );
    143 
    144     // draw symbol
    145     if ( d_data->symbol &&
    146         ( d_data->symbol->style() != QwtSymbol::NoSymbol ) )
    147     {
    148         const QSizeF sz = d_data->symbol->size();
    149 
    150         const QRectF clipRect = canvasRect.adjusted(
    151             -sz.width(), -sz.height(), sz.width(), sz.height() );
    152 
    153         if ( clipRect.contains( pos ) )
    154             d_data->symbol->drawSymbol( painter, pos );
    155     }
    156 
     150    drawSymbol( painter, canvasRect, pos );
    157151    drawLabel( painter, canvasRect, pos );
    158152}
    159153
    160154/*!
    161   Draw the lines marker
    162 
    163   \param painter Painter
    164   \param canvasRect Contents rectangle of the canvas in painter coordinates
    165   \param pos Position of the marker, translated into widget coordinates
    166 
    167   \sa drawLabel(), QwtSymbol::drawSymbol()
    168 */
    169 void QwtPlotMarker::drawLines( QPainter *painter,
    170     const QRectF &canvasRect, const QPointF &pos ) const
    171 {
    172     if ( d_data->style == NoLine )
     155   Draw the lines marker
     156
     157   \param painter Painter
     158   \param canvasRect Contents rectangle of the canvas in painter coordinates
     159   \param pos Position of the marker, translated into widget coordinates
     160
     161   \sa drawLabel(), drawSymbol()
     162 */
     163void QwtPlotMarker::drawLines( QPainter* painter,
     164    const QRectF& canvasRect, const QPointF& pos ) const
     165{
     166    if ( m_data->style == NoLine )
    173167        return;
    174168
    175169    const bool doAlign = QwtPainter::roundingAlignment( painter );
    176170
    177     painter->setPen( d_data->pen );
    178     if ( d_data->style == QwtPlotMarker::HLine ||
    179         d_data->style == QwtPlotMarker::Cross )
     171    painter->setPen( m_data->pen );
     172    if ( m_data->style == QwtPlotMarker::HLine ||
     173        m_data->style == QwtPlotMarker::Cross )
    180174    {
    181175        double y = pos.y();
    … …  
    186180            y, canvasRect.right() - 1.0, y );
    187181    }
    188     if ( d_data->style == QwtPlotMarker::VLine ||
    189         d_data->style == QwtPlotMarker::Cross )
     182    if ( m_data->style == QwtPlotMarker::VLine ||
     183        m_data->style == QwtPlotMarker::Cross )
    190184    {
    191185        double x = pos.x();
    … …  
    199193
    200194/*!
    201   Align and draw the text label of the marker
    202 
    203   \param painter Painter
    204   \param canvasRect Contents rectangle of the canvas in painter coordinates
    205   \param pos Position of the marker, translated into widget coordinates
    206 
    207   \sa drawLabel(), QwtSymbol::drawSymbol()
    208 */
    209 void QwtPlotMarker::drawLabel( QPainter *painter,
    210     const QRectF &canvasRect, const QPointF &pos ) const
    211 {
    212     if ( d_data->label.isEmpty() )
     195   Draw the symbol of the marker
     196
     197   \param painter Painter
     198   \param canvasRect Contents rectangle of the canvas in painter coordinates
     199   \param pos Position of the marker, translated into widget coordinates
     200
     201   \sa drawLabel(), QwtSymbol::drawSymbol()
     202 */
     203void QwtPlotMarker::drawSymbol( QPainter* painter,
     204    const QRectF& canvasRect, const QPointF& pos ) const
     205{
     206    if ( m_data->symbol == NULL )
    213207        return;
    214208
    215     Qt::Alignment align = d_data->labelAlignment;
     209    const QwtSymbol& symbol = *m_data->symbol;
     210
     211    if ( symbol.style() != QwtSymbol::NoSymbol )
     212    {
     213        const QSizeF sz = symbol.size();
     214
     215        const QRectF clipRect = canvasRect.adjusted(
     216            -sz.width(), -sz.height(), sz.width(), sz.height() );
     217
     218        if ( clipRect.contains( pos ) )
     219            symbol.drawSymbol( painter, pos );
     220    }
     221}
     222
     223/*!
     224   Align and draw the text label of the marker
     225
     226   \param painter Painter
     227   \param canvasRect Contents rectangle of the canvas in painter coordinates
     228   \param pos Position of the marker, translated into widget coordinates
     229
     230   \sa drawLabel(), drawSymbol()
     231 */
     232void QwtPlotMarker::drawLabel( QPainter* painter,
     233    const QRectF& canvasRect, const QPointF& pos ) const
     234{
     235    if ( m_data->label.isEmpty() )
     236        return;
     237
     238    Qt::Alignment align = m_data->labelAlignment;
    216239    QPointF alignPos = pos;
    217240
    218241    QSizeF symbolOff( 0, 0 );
    219242
    220     switch ( d_data->style )
     243    switch ( m_data->style )
    221244    {
    222245        case QwtPlotMarker::VLine:
    … …  
    225248            // the alignment flags are relative to the canvas
    226249
    227             if ( d_data->labelAlignment & Qt::AlignTop )
     250            if ( m_data->labelAlignment & Qt::AlignTop )
    228251            {
    229252                alignPos.setY( canvasRect.top() );
    … …  
    231254                align |= Qt::AlignBottom;
    232255            }
    233             else if ( d_data->labelAlignment & Qt::AlignBottom )
     256            else if ( m_data->labelAlignment & Qt::AlignBottom )
    234257            {
    235258                // In HLine-style the x-position is pointless and
    … …  
    248271        case QwtPlotMarker::HLine:
    249272        {
    250             if ( d_data->labelAlignment & Qt::AlignLeft )
     273            if ( m_data->labelAlignment & Qt::AlignLeft )
    251274            {
    252275                alignPos.setX( canvasRect.left() );
    … …  
    254277                align |= Qt::AlignRight;
    255278            }
    256             else if ( d_data->labelAlignment & Qt::AlignRight )
     279            else if ( m_data->labelAlignment & Qt::AlignRight )
    257280            {
    258281                alignPos.setX( canvasRect.right() - 1 );
    … …  
    268291        default:
    269292        {
    270             if ( d_data->symbol &&
    271                 ( d_data->symbol->style() != QwtSymbol::NoSymbol ) )
     293            if ( m_data->symbol &&
     294                ( m_data->symbol->style() != QwtSymbol::NoSymbol ) )
    272295            {
    273                 symbolOff = d_data->symbol->size() + QSizeF( 1, 1 );
     296                symbolOff = m_data->symbol->size() + QSizeF( 1, 1 );
    274297                symbolOff /= 2;
    275298            }
    … …  
    277300    }
    278301
    279     qreal pw2 = d_data->pen.widthF() / 2.0;
     302    qreal pw2 = m_data->pen.widthF() / 2.0;
    280303    if ( pw2 == 0.0 )
    281304        pw2 = 0.5;
    282305
    283     const int spacing = d_data->spacing;
    284 
    285     const qreal xOff = qMax( pw2, symbolOff.width() );
    286     const qreal yOff = qMax( pw2, symbolOff.height() );
    287 
    288     const QSizeF textSize = d_data->label.textSize( painter->font() );
     306    const int spacing = m_data->spacing;
     307
     308    const qreal xOff = qwtMaxF( pw2, symbolOff.width() );
     309    const qreal yOff = qwtMaxF( pw2, symbolOff.height() );
     310
     311    const QSizeF textSize = m_data->label.textSize( painter->font() );
    289312
    290313    if ( align & Qt::AlignLeft )
    291314    {
    292315        alignPos.rx() -= xOff + spacing;
    293         if ( d_data->labelOrientation == Qt::Vertical )
     316        if ( m_data->labelOrientation == Qt::Vertical )
    294317            alignPos.rx() -= textSize.height();
    295318        else
    … …  
    302325    else
    303326    {
    304         if ( d_data->labelOrientation == Qt::Vertical )
     327        if ( m_data->labelOrientation == Qt::Vertical )
    305328            alignPos.rx() -= textSize.height() / 2;
    306329        else
    … …  
    311334    {
    312335        alignPos.ry() -= yOff + spacing;
    313         if ( d_data->labelOrientation != Qt::Vertical )
     336        if ( m_data->labelOrientation != Qt::Vertical )
    314337            alignPos.ry() -= textSize.height();
    315338    }
    … …  
    317340    {
    318341        alignPos.ry() += yOff + spacing;
    319         if ( d_data->labelOrientation == Qt::Vertical )
     342        if ( m_data->labelOrientation == Qt::Vertical )
    320343            alignPos.ry() += textSize.width();
    321344    }
    322345    else
    323346    {
    324         if ( d_data->labelOrientation == Qt::Vertical )
     347        if ( m_data->labelOrientation == Qt::Vertical )
    325348            alignPos.ry() += textSize.width() / 2;
    326349        else
    … …  
    329352
    330353    painter->translate( alignPos.x(), alignPos.y() );
    331     if ( d_data->labelOrientation == Qt::Vertical )
     354    if ( m_data->labelOrientation == Qt::Vertical )
    332355        painter->rotate( -90.0 );
    333356
    334357    const QRectF textRect( 0, 0, textSize.width(), textSize.height() );
    335     d_data->label.draw( painter, textRect );
    336 }
    337 
    338 /*!
    339   \brief Set the line style
    340   \param style Line style.
    341   \sa lineStyle()
    342 */
     358    m_data->label.draw( painter, textRect );
     359}
     360
     361/*!
     362   \brief Set the line style
     363   \param style Line style.
     364   \sa lineStyle()
     365 */
    343366void QwtPlotMarker::setLineStyle( LineStyle style )
    344367{
    345     if ( style != d_data->style )
    346     {
    347         d_data->style = style;
     368    if ( style != m_data->style )
     369    {
     370        m_data->style = style;
    348371
    349372        legendChanged();
    … …  
    353376
    354377/*!
    355   \return the line style
    356   \sa setLineStyle()
    357 */
     378   \return the line style
     379   \sa setLineStyle()
     380 */
    358381QwtPlotMarker::LineStyle QwtPlotMarker::lineStyle() const
    359382{
    360     return d_data->style;
    361 }
    362 
    363 /*!
    364   \brief Assign a symbol
    365   \param symbol New symbol
    366   \sa symbol()
    367 */
    368 void QwtPlotMarker::setSymbol( const QwtSymbol *symbol )
    369 {
    370     if ( symbol != d_data->symbol )
    371     {
    372         delete d_data->symbol;
    373         d_data->symbol = symbol;
     383    return m_data->style;
     384}
     385
     386/*!
     387   \brief Assign a symbol
     388   \param symbol New symbol
     389   \sa symbol()
     390 */
     391void QwtPlotMarker::setSymbol( const QwtSymbol* symbol )
     392{
     393    if ( symbol != m_data->symbol )
     394    {
     395        delete m_data->symbol;
     396        m_data->symbol = symbol;
    374397
    375398        if ( symbol )
    … …  
    382405
    383406/*!
    384   \return the symbol
    385   \sa setSymbol(), QwtSymbol
    386 */
    387 const QwtSymbol *QwtPlotMarker::symbol() const
    388 {
    389     return d_data->symbol;
    390 }
    391 
    392 /*!
    393   \brief Set the label
    394   \param label Label text
    395   \sa label()
    396 */
     407   \return the symbol
     408   \sa setSymbol(), QwtSymbol
     409 */
     410const QwtSymbol* QwtPlotMarker::symbol() const
     411{
     412    return m_data->symbol;
     413}
     414
     415/*!
     416   \brief Set the label
     417   \param label Label text
     418   \sa label()
     419 */
    397420void QwtPlotMarker::setLabel( const QwtText& label )
    398421{
    399     if ( label != d_data->label )
    400     {
    401         d_data->label = label;
     422    if ( label != m_data->label )
     423    {
     424        m_data->label = label;
    402425        itemChanged();
    403426    }
    … …  
    405428
    406429/*!
    407   \return the label
    408   \sa setLabel()
    409 */
     430   \return the label
     431   \sa setLabel()
     432 */
    410433QwtText QwtPlotMarker::label() const
    411434{
    412     return d_data->label;
    413 }
    414 
    415 /*!
    416   \brief Set the alignment of the label
    417 
    418   In case of QwtPlotMarker::HLine the alignment is relative to the
    419   y position of the marker, but the horizontal flags correspond to the
    420   canvas rectangle. In case of QwtPlotMarker::VLine the alignment is
    421   relative to the x position of the marker, but the vertical flags
    422   correspond to the canvas rectangle.
    423 
    424   In all other styles the alignment is relative to the marker's position.
    425 
    426   \param align Alignment.
    427   \sa labelAlignment(), labelOrientation()
    428 */
     435    return m_data->label;
     436}
     437
     438/*!
     439   \brief Set the alignment of the label
     440
     441   In case of QwtPlotMarker::HLine the alignment is relative to the
     442   y position of the marker, but the horizontal flags correspond to the
     443   canvas rectangle. In case of QwtPlotMarker::VLine the alignment is
     444   relative to the x position of the marker, but the vertical flags
     445   correspond to the canvas rectangle.
     446
     447   In all other styles the alignment is relative to the marker's position.
     448
     449   \param align Alignment.
     450   \sa labelAlignment(), labelOrientation()
     451 */
    429452void QwtPlotMarker::setLabelAlignment( Qt::Alignment align )
    430453{
    431     if ( align != d_data->labelAlignment )
    432     {
    433         d_data->labelAlignment = align;
     454    if ( align != m_data->labelAlignment )
     455    {
     456        m_data->labelAlignment = align;
    434457        itemChanged();
    435458    }
    … …  
    437460
    438461/*!
    439   \return the label alignment
    440   \sa setLabelAlignment(), setLabelOrientation()
    441 */
     462   \return the label alignment
     463   \sa setLabelAlignment(), setLabelOrientation()
     464 */
    442465Qt::Alignment QwtPlotMarker::labelAlignment() const
    443466{
    444     return d_data->labelAlignment;
    445 }
    446 
    447 /*!
    448   \brief Set the orientation of the label
    449 
    450   When orientation is Qt::Vertical the label is rotated by 90.0 degrees
    451   ( from bottom to top ).
    452 
    453   \param orientation Orientation of the label
    454 
    455   \sa labelOrientation(), setLabelAlignment()
    456 */
     467    return m_data->labelAlignment;
     468}
     469
     470/*!
     471   \brief Set the orientation of the label
     472
     473   When orientation is Qt::Vertical the label is rotated by 90.0 degrees
     474   ( from bottom to top ).
     475
     476   \param orientation Orientation of the label
     477
     478   \sa labelOrientation(), setLabelAlignment()
     479 */
    457480void QwtPlotMarker::setLabelOrientation( Qt::Orientation orientation )
    458481{
    459     if ( orientation != d_data->labelOrientation )
    460     {
    461         d_data->labelOrientation = orientation;
     482    if ( orientation != m_data->labelOrientation )
     483    {
     484        m_data->labelOrientation = orientation;
    462485        itemChanged();
    463486    }
    … …  
    465488
    466489/*!
    467   \return the label orientation
    468   \sa setLabelOrientation(), labelAlignment()
    469 */
     490   \return the label orientation
     491   \sa setLabelOrientation(), labelAlignment()
     492 */
    470493Qt::Orientation QwtPlotMarker::labelOrientation() const
    471494{
    472     return d_data->labelOrientation;
    473 }
    474 
    475 /*!
    476   \brief Set the spacing
    477 
    478   When the label is not centered on the marker position, the spacing
    479   is the distance between the position and the label.
    480 
    481   \param spacing Spacing
    482   \sa spacing(), setLabelAlignment()
    483 */
     495    return m_data->labelOrientation;
     496}
     497
     498/*!
     499   \brief Set the spacing
     500
     501   When the label is not centered on the marker position, the spacing
     502   is the distance between the position and the label.
     503
     504   \param spacing Spacing
     505   \sa spacing(), setLabelAlignment()
     506 */
    484507void QwtPlotMarker::setSpacing( int spacing )
    485508{
    … …  
    487510        spacing = 0;
    488511
    489     if ( spacing == d_data->spacing )
     512    if ( spacing == m_data->spacing )
    490513        return;
    491514
    492     d_data->spacing = spacing;
     515    m_data->spacing = spacing;
    493516    itemChanged();
    494517}
    495518
    496519/*!
    497   \return the spacing
    498   \sa setSpacing()
    499 */
     520   \return the spacing
     521   \sa setSpacing()
     522 */
    500523int QwtPlotMarker::spacing() const
    501524{
    502     return d_data->spacing;
    503 }
    504 
    505 /*!
    506   Build and assign a line pen
    507 
    508   In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it
    509   non cosmetic ( see QPen::isCosmetic() ). This method has been introduced
    510   to hide this incompatibility.
    511 
    512   \param color Pen color
    513   \param width Pen width
    514   \param style Pen style
    515 
    516   \sa pen(), brush()
    517  */
    518 void QwtPlotMarker::setLinePen( const QColor &color, qreal width, Qt::PenStyle style )
     525    return m_data->spacing;
     526}
     527
     528/*!
     529   Build and assign a line pen
     530
     531   In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it
     532   non cosmetic ( see QPen::isCosmetic() ). This method has been introduced
     533   to hide this incompatibility.
     534
     535   \param color Pen color
     536   \param width Pen width
     537   \param style Pen style
     538
     539   \sa pen(), brush()
     540 */
     541void QwtPlotMarker::setLinePen( const QColor& color, qreal width, Qt::PenStyle style )
    519542{
    520543    setLinePen( QPen( color, width, style ) );
    … …  
    522545
    523546/*!
    524   Specify a pen for the line.
    525 
    526   \param pen New pen
    527   \sa linePen()
    528 */
    529 void QwtPlotMarker::setLinePen( const QPen &pen )
    530 {
    531     if ( pen != d_data->pen )
    532     {
    533         d_data->pen = pen;
     547   Specify a pen for the line.
     548
     549   \param pen New pen
     550   \sa linePen()
     551 */
     552void QwtPlotMarker::setLinePen( const QPen& pen )
     553{
     554    if ( pen != m_data->pen )
     555    {
     556        m_data->pen = pen;
    534557
    535558        legendChanged();
    … …  
    539562
    540563/*!
    541   \return the line pen
    542   \sa setLinePen()
    543 */
    544 const QPen &QwtPlotMarker::linePen() const
    545 {
    546     return d_data->pen;
     564   \return the line pen
     565   \sa setLinePen()
     566 */
     567const QPen& QwtPlotMarker::linePen() const
     568{
     569    return m_data->pen;
    547570}
    548571
    … …  
    551574    // width/height of -1 does not affect the autoscale calculation
    552575
    553     switch (d_data->style)
     576    switch (m_data->style)
    554577    {
    555578        case QwtPlotMarker::HLine:
    556             return QRectF( d_data->xValue, d_data->yValue, -1.0, 0.0 );
     579            return QRectF( m_data->xValue, m_data->yValue, -1.0, 0.0 );
    557580
    558581        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 );
     582            return QRectF( m_data->xValue, m_data->yValue, 0.0, -1.0 );
     583
     584        default:
     585            return QRectF( m_data->xValue, m_data->yValue, 0.0, 0.0 );
    563586    }
    564587}
    … …  
    572595
    573596   \sa setLegendIconSize(), legendData()
    574 */
    575 QwtGraphic QwtPlotMarker::legendIcon( int index,
    576     const QSizeF &size ) const
     597 */
     598QwtGraphic QwtPlotMarker::legendIcon( int index, const QSizeF& size ) const
    577599{
    578600    Q_UNUSED( index );
    … …  
    589611        testRenderHint( QwtPlotItem::RenderAntialiased ) );
    590612
    591     if ( d_data->style != QwtPlotMarker::NoLine )
    592     {
    593         painter.setPen( d_data->pen );
    594 
    595         if ( d_data->style == QwtPlotMarker::HLine ||
    596             d_data->style == QwtPlotMarker::Cross )
     613    if ( m_data->style != QwtPlotMarker::NoLine )
     614    {
     615        painter.setPen( m_data->pen );
     616
     617        if ( m_data->style == QwtPlotMarker::HLine ||
     618            m_data->style == QwtPlotMarker::Cross )
    597619        {
    598620            const double y = 0.5 * size.height();
    … …  
    602624        }
    603625
    604         if ( d_data->style == QwtPlotMarker::VLine ||
    605             d_data->style == QwtPlotMarker::Cross )
     626        if ( m_data->style == QwtPlotMarker::VLine ||
     627            m_data->style == QwtPlotMarker::Cross )
    606628        {
    607629            const double x = 0.5 * size.width();
    … …  
    612634    }
    613635
    614     if ( d_data->symbol )
     636    if ( m_data->symbol )
    615637    {
    616638        const QRect r( 0.0, 0.0, size.width(), size.height() );
    617         d_data->symbol->drawSymbol( &painter, r );
     639        m_data->symbol->drawSymbol( &painter, r );
    618640    }
    619641
Note: See TracChangeset for help on using the changeset viewer.