Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_symbol.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_symbol.cpp

    r9383 r11158  
    1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
     1/******************************************************************************
    22 * Qwt Widget Library
    33 * Copyright (C) 1997   Josef Wilgen
    … …  
    1111#include "qwt_painter.h"
    1212#include "qwt_graphic.h"
    13 #include <qapplication.h>
     13#include "qwt_math.h"
     14
    1415#include <qpainter.h>
    1516#include <qpainterpath.h>
    1617#include <qpixmap.h>
    1718#include <qpaintengine.h>
    18 #include <qmath.h>
    1919#ifndef QWT_NO_SVG
    2020#include <qsvgrenderer.h>
    … …  
    3232}
    3333
    34 static QwtGraphic qwtPathGraphic( const QPainterPath &path,
    35     const QPen &pen, const QBrush& brush )
     34static QwtGraphic qwtPathGraphic( const QPainterPath& path,
     35    const QPen& pen, const QBrush& brush )
    3636{
    3737    QwtGraphic graphic;
    … …  
    4848
    4949static inline QRectF qwtScaledBoundingRect(
    50     const QwtGraphic &graphic, const QSizeF size )
     50    const QwtGraphic& graphic, const QSizeF size )
    5151{
    5252    QSizeF scaledSize = size;
    … …  
    6767}
    6868
    69 static inline void qwtDrawPixmapSymbols( QPainter *painter,
    70     const QPointF *points, int numPoints, const QwtSymbol &symbol )
     69static inline void qwtDrawPixmapSymbols( QPainter* painter,
     70    const QPointF* points, int numPoints, const QwtSymbol& symbol )
    7171{
    7272    QSize size = symbol.size();
    … …  
    102102#ifndef QWT_NO_SVG
    103103
    104 static inline void qwtDrawSvgSymbols( QPainter *painter,
    105     const QPointF *points, int numPoints,
    106     QSvgRenderer *renderer, const QwtSymbol &symbol )
     104static inline void qwtDrawSvgSymbols( QPainter* painter,
     105    const QPointF* points, int numPoints,
     106    QSvgRenderer* renderer, const QwtSymbol& symbol )
    107107{
    108108    if ( renderer == NULL || !renderer->isValid() )
    … …  
    139139#endif
    140140
    141 static inline void qwtDrawGraphicSymbols( QPainter *painter,
    142     const QPointF *points, int numPoints, const QwtGraphic &graphic,
    143     const QwtSymbol &symbol )
     141static inline void qwtDrawGraphicSymbols( QPainter* painter,
     142    const QPointF* points, int numPoints, const QwtGraphic& graphic,
     143    const QwtSymbol& symbol )
    144144{
    145145    const QRectF pointRect = graphic.controlPointRect();
    … …  
    178178}
    179179
    180 static inline void qwtDrawEllipseSymbols( QPainter *painter,
    181     const QPointF *points, int numPoints, const QwtSymbol &symbol )
     180static inline void qwtDrawEllipseSymbols( QPainter* painter,
     181    const QPointF* points, int numPoints, const QwtSymbol& symbol )
    182182{
    183183    painter->setBrush( symbol.brush() );
    … …  
    220220}
    221221
    222 static inline void qwtDrawRectSymbols( QPainter *painter,
    223     const QPointF *points, int numPoints, const QwtSymbol &symbol )
     222static inline void qwtDrawRectSymbols( QPainter* painter,
     223    const QPointF* points, int numPoints, const QwtSymbol& symbol )
    224224{
    225225    const QSize size = symbol.size();
    … …  
    265265}
    266266
    267 static inline void qwtDrawDiamondSymbols( QPainter *painter,
    268     const QPointF *points, int numPoints, const QwtSymbol &symbol )
     267static inline void qwtDrawDiamondSymbols( QPainter* painter,
     268    const QPointF* points, int numPoints, const QwtSymbol& symbol )
    269269{
    270270    const QSize size = symbol.size();
    … …  
    300300        for ( int i = 0; i < numPoints; i++ )
    301301        {
    302             const QPointF &pos = points[i];
     302            const QPointF& pos = points[i];
    303303
    304304            const double x1 = pos.x() - 0.5 * size.width();
    … …  
    319319
    320320static inline void qwtDrawTriangleSymbols(
    321     QPainter *painter, QwtTriangle::Type type,
    322     const QPointF *points, int numPoints,
    323     const QwtSymbol &symbol )
     321    QPainter* painter, QwtTriangle::Type type,
     322    const QPointF* points, int numPoints,
     323    const QwtSymbol& symbol )
    324324{
    325325    const QSize size = symbol.size();
    … …  
    338338    if ( doAlign )
    339339    {
    340         sw2 = qFloor( sw2 );
    341         sh2 = qFloor( sh2 );
     340        sw2 = std::floor( sw2 );
     341        sh2 = std::floor( sh2 );
    342342    }
    343343
    344344    QPolygonF triangle( 3 );
    345     QPointF *trianglePoints = triangle.data();
     345    QPointF* trianglePoints = triangle.data();
    346346
    347347    for ( int i = 0; i < numPoints; i++ )
    348348    {
    349         const QPointF &pos = points[i];
     349        const QPointF& pos = points[i];
    350350
    351351        double x = pos.x();
    … …  
    423423
    424424static inline void qwtDrawLineSymbols(
    425     QPainter *painter, int orientations,
    426     const QPointF *points, int numPoints, const QwtSymbol &symbol )
     425    QPainter* painter, int orientations,
     426    const QPointF* points, int numPoints, const QwtSymbol& symbol )
    427427{
    428428    const QSize size = symbol.size();
    … …  
    442442    if ( QwtPainter::roundingAlignment( painter ) )
    443443    {
    444         const int sw = qFloor( size.width() );
    445         const int sh = qFloor( size.height() );
     444        const int sw = qwtFloor( size.width() );
     445        const int sh = qwtFloor( size.height() );
    446446        const int sw2 = size.width() / 2;
    447447        const int sh2 = size.height() / 2;
    … …  
    492492}
    493493
    494 static inline void qwtDrawXCrossSymbols( QPainter *painter,
    495     const QPointF *points, int numPoints, const QwtSymbol &symbol )
     494static inline void qwtDrawXCrossSymbols( QPainter* painter,
     495    const QPointF* points, int numPoints, const QwtSymbol& symbol )
    496496{
    497497    const QSize size = symbol.size();
    … …  
    516516        for ( int i = 0; i < numPoints; i++ )
    517517        {
    518             const QPointF &pos = points[i];
     518            const QPointF& pos = points[i];
    519519
    520520            const int x = qRound( pos.x() );
    … …  
    539539        for ( int i = 0; i < numPoints; i++ )
    540540        {
    541             const QPointF &pos = points[i];
     541            const QPointF& pos = points[i];
    542542
    543543            const double x1 = pos.x() - sw2;
    … …  
    552552}
    553553
    554 static inline void qwtDrawStar1Symbols( QPainter *painter,
    555     const QPointF *points, int numPoints, const QwtSymbol &symbol )
     554static inline void qwtDrawStar1Symbols( QPainter* painter,
     555    const QPointF* points, int numPoints, const QwtSymbol& symbol )
    556556{
    557557    const QSize size = symbol.size();
    … …  
    575575            QwtPainter::drawLine( painter,
    576576                qRound( r.left() + d1 ), qRound( r.bottom() - d1 ),
    577                 qRound( r .right() - d1), qRound( r.top() + d1 ) );
     577                qRound( r.right() - d1), qRound( r.top() + d1 ) );
    578578
    579579            const QPoint c = r.center();
    … …  
    596596
    597597            const QPointF c = r.center();
    598             const double d1  = r.width() / 2.0 * ( 1.0 - sqrt1_2 );
     598            const double d1 = r.width() / 2.0 * ( 1.0 - sqrt1_2 );
    599599
    600600            QwtPainter::drawLine( painter,
    … …  
    614614}
    615615
    616 static inline void qwtDrawStar2Symbols( QPainter *painter,
    617     const QPointF *points, int numPoints, const QwtSymbol &symbol )
     616static inline void qwtDrawStar2Symbols( QPainter* painter,
     617    const QPointF* points, int numPoints, const QwtSymbol& symbol )
    618618{
    619619    QPen pen = symbol.pen();
    … …  
    631631
    632632    QPolygonF star( 12 );
    633     QPointF *starPoints = star.data();
     633    QPointF* starPoints = star.data();
    634634
    635635    const bool doAlign = QwtPainter::roundingAlignment( painter );
    … …  
    705705}
    706706
    707 static inline void qwtDrawHexagonSymbols( QPainter *painter,
    708     const QPointF *points, int numPoints, const QwtSymbol &symbol )
     707static inline void qwtDrawHexagonSymbols( QPainter* painter,
     708    const QPointF* points, int numPoints, const QwtSymbol& symbol )
    709709{
    710710    painter->setBrush( symbol.brush() );
    … …  
    717717
    718718    QPolygonF hexaPolygon( 6 );
    719     QPointF *hexaPoints = hexaPolygon.data();
     719    QPointF* hexaPoints = hexaPolygon.data();
    720720
    721721    const bool doAlign = QwtPainter::roundingAlignment( painter );
    … …  
    735735        if ( doAlign )
    736736        {
    737             x1 = qCeil( x1 );
    738             y1 = qCeil( y1 );
     737            x1 = std::ceil( x1 );
     738            y1 = std::ceil( y1 );
    739739        }
    740740
    … …  
    770770class QwtSymbol::PrivateData
    771771{
    772 public:
    773     PrivateData( QwtSymbol::Style st, const QBrush &br,
    774             const QPen &pn, const QSize &sz ):
    775         style( st ),
    776         size( sz ),
    777         brush( br ),
    778         pen( pn ),
    779         isPinPointEnabled( false )
     772  public:
     773    PrivateData( QwtSymbol::Style st, const QBrush& br,
     774            const QPen& pn, const QSize& sz )
     775        : style( st )
     776        , size( sz )
     777        , brush( br )
     778        , pen( pn )
     779        , isPinPointEnabled( false )
    780780    {
    781781        cache.policy = QwtSymbol::AutoCache;
    … …  
    822822    struct SVG
    823823    {
    824         QSvgRenderer *renderer;
     824        QSvgRenderer* renderer;
    825825    } svg;
    826826#endif
    … …  
    835835
    836836/*!
    837   Default Constructor
    838   \param style Symbol Style
    839 
    840   The symbol is constructed with gray interior,
    841   black outline with zero width, no size and style 'NoSymbol'.
    842 */
     837   Default Constructor
     838   \param style Symbol Style
     839
     840   The symbol is constructed with gray interior,
     841   black outline with zero width, no size and style 'NoSymbol'.
     842 */
    843843QwtSymbol::QwtSymbol( Style style )
    844844{
    845     d_data = new PrivateData( style, QBrush( Qt::gray ),
     845    m_data = new PrivateData( style, QBrush( Qt::gray ),
    846846        QPen( Qt::black, 0 ), QSize() );
    847847}
    848848
    849849/*!
    850   \brief Constructor
    851   \param style Symbol Style
    852   \param brush brush to fill the interior
    853   \param pen outline pen
    854   \param size size
    855 
    856   \sa setStyle(), setBrush(), setPen(), setSize()
    857 */
    858 QwtSymbol::QwtSymbol( QwtSymbol::Style style, const QBrush &brush,
    859     const QPen &pen, const QSize &size )
    860 {
    861     d_data = new PrivateData( style, brush, pen, size );
    862 }
    863 
    864 /*!
    865   \brief Constructor
    866 
    867   The symbol gets initialized by a painter path. The style is
    868   set to QwtSymbol::Path, the size is set to empty ( the path
    869   is displayed unscaled ).
    870 
    871   \param path painter path
    872   \param brush brush to fill the interior
    873   \param pen outline pen
    874 
    875   \sa setPath(), setBrush(), setPen(), setSize()
    876 */
    877 
    878 QwtSymbol::QwtSymbol( const QPainterPath &path,
    879     const QBrush &brush, const QPen &pen )
    880 {
    881     d_data = new PrivateData( QwtSymbol::Path, brush, pen, QSize() );
     850   \brief Constructor
     851   \param style Symbol Style
     852   \param brush brush to fill the interior
     853   \param pen outline pen
     854   \param size size
     855
     856   \sa setStyle(), setBrush(), setPen(), setSize()
     857 */
     858QwtSymbol::QwtSymbol( QwtSymbol::Style style, const QBrush& brush,
     859    const QPen& pen, const QSize& size )
     860{
     861    m_data = new PrivateData( style, brush, pen, size );
     862}
     863
     864/*!
     865   \brief Constructor
     866
     867   The symbol gets initialized by a painter path. The style is
     868   set to QwtSymbol::Path, the size is set to empty ( the path
     869   is displayed unscaled ).
     870
     871   \param path painter path
     872   \param brush brush to fill the interior
     873   \param pen outline pen
     874
     875   \sa setPath(), setBrush(), setPen(), setSize()
     876 */
     877
     878QwtSymbol::QwtSymbol( const QPainterPath& path,
     879    const QBrush& brush, const QPen& pen )
     880{
     881    m_data = new PrivateData( QwtSymbol::Path, brush, pen, QSize() );
    882882    setPath( path );
    883883}
    … …  
    886886QwtSymbol::~QwtSymbol()
    887887{
    888     delete d_data;
    889 }
    890 
    891 /*!
    892   Change the cache policy
    893 
    894   The default policy is AutoCache
    895 
    896   \param policy Cache policy
    897   \sa CachePolicy, cachePolicy()
    898 */
     888    delete m_data;
     889}
     890
     891/*!
     892   Change the cache policy
     893
     894   The default policy is AutoCache
     895
     896   \param policy Cache policy
     897   \sa CachePolicy, cachePolicy()
     898 */
    899899void QwtSymbol::setCachePolicy(
    900900    QwtSymbol::CachePolicy policy )
    901901{
    902     if ( d_data->cache.policy != policy )
    903     {
    904         d_data->cache.policy = policy;
     902    if ( m_data->cache.policy != policy )
     903    {
     904        m_data->cache.policy = policy;
    905905        invalidateCache();
    906906    }
    … …  
    908908
    909909/*!
    910   \return Cache policy
    911   \sa CachePolicy, setCachePolicy()
    912 */
     910   \return Cache policy
     911   \sa CachePolicy, setCachePolicy()
     912 */
    913913QwtSymbol::CachePolicy QwtSymbol::cachePolicy() const
    914914{
    915     return d_data->cache.policy;
    916 }
    917 
    918 /*!
    919   \brief Set a painter path as symbol
    920 
    921   The symbol is represented by a painter path, where the
    922   origin ( 0, 0 ) of the path coordinate system is mapped to
    923   the position of the symbol.
    924 
    925   When the symbol has valid size the painter path gets scaled
    926   to fit into the size. Otherwise the symbol size depends on
    927   the bounding rectangle of the path.
    928 
    929   \par Example
     915    return m_data->cache.policy;
     916}
     917
     918/*!
     919   \brief Set a painter path as symbol
     920
     921   The symbol is represented by a painter path, where the
     922   origin ( 0, 0 ) of the path coordinate system is mapped to
     923   the position of the symbol.
     924
     925   When the symbol has valid size the painter path gets scaled
     926   to fit into the size. Otherwise the symbol size depends on
     927   the bounding rectangle of the path.
     928
     929   \par Example
    930930    The following code defines a symbol drawing an arrow:
    931931
    932932    \code
    933       #include <qwt_symbol.h>
     933 #include <qwt_symbol.h>
    934934
    935935      QwtSymbol *symbol = new QwtSymbol();
    … …  
    958958      setSize( 10, 14 );
    959959    \endcode
    960   \endpar
    961 
    962   \param path Painter path
    963 
    964   \note The style is implicitely set to QwtSymbol::Path.
    965   \sa path(), setSize()
    966  */
    967 void QwtSymbol::setPath( const QPainterPath &path )
    968 {
    969     d_data->style = QwtSymbol::Path;
    970     d_data->path.path = path;
    971     d_data->path.graphic.reset();
     960
     961   \param path Painter path
     962
     963   \note The style is implicitly set to QwtSymbol::Path.
     964   \sa path(), setSize()
     965 */
     966void QwtSymbol::setPath( const QPainterPath& path )
     967{
     968    m_data->style = QwtSymbol::Path;
     969    m_data->path.path = path;
     970    m_data->path.graphic.reset();
    972971}
    973972
    … …  
    975974   \return Painter path for displaying the symbol
    976975   \sa setPath()
    977 */
    978 const QPainterPath &QwtSymbol::path() const
    979 {
    980     return d_data->path.path;
    981 }
    982 
    983 /*!
    984   Set a pixmap as symbol
    985 
    986   \param pixmap Pixmap
    987 
    988   \sa pixmap(), setGraphic()
    989 
    990   \note the style() is set to QwtSymbol::Pixmap
    991   \note brush() and pen() have no effect
    992  */
    993 void QwtSymbol::setPixmap( const QPixmap &pixmap )
    994 {
    995     d_data->style = QwtSymbol::Pixmap;
    996     d_data->pixmap.pixmap = pixmap;
    997 }
    998 
    999 /*!
    1000   \return Assigned pixmap
    1001   \sa setPixmap()
    1002  */
    1003 const QPixmap &QwtSymbol::pixmap() const
    1004 {
    1005     return d_data->pixmap.pixmap;
    1006 }
    1007 
    1008 /*!
    1009   Set a graphic as symbol
    1010 
    1011   \param graphic Graphic
    1012 
    1013   \sa graphic(), setPixmap()
    1014 
    1015   \note the style() is set to QwtSymbol::Graphic
    1016   \note brush() and pen() have no effect
    1017  */
    1018 void QwtSymbol::setGraphic( const QwtGraphic &graphic )
    1019 {
    1020     d_data->style = QwtSymbol::Graphic;
    1021     d_data->graphic.graphic = graphic;
    1022 }
    1023 
    1024 /*!
    1025   \return Assigned graphic
    1026   \sa setGraphic()
    1027  */
    1028 const QwtGraphic &QwtSymbol::graphic() const
    1029 {
    1030     return d_data->graphic.graphic;
     976 */
     977const QPainterPath& QwtSymbol::path() const
     978{
     979    return m_data->path.path;
     980}
     981
     982/*!
     983   Set a pixmap as symbol
     984
     985   \param pixmap Pixmap
     986
     987   \sa pixmap(), setGraphic()
     988
     989   \note the style() is set to QwtSymbol::Pixmap
     990   \note brush() and pen() have no effect
     991 */
     992void QwtSymbol::setPixmap( const QPixmap& pixmap )
     993{
     994    m_data->style = QwtSymbol::Pixmap;
     995    m_data->pixmap.pixmap = pixmap;
     996}
     997
     998/*!
     999   \return Assigned pixmap
     1000   \sa setPixmap()
     1001 */
     1002const QPixmap& QwtSymbol::pixmap() const
     1003{
     1004    return m_data->pixmap.pixmap;
     1005}
     1006
     1007/*!
     1008   Set a graphic as symbol
     1009
     1010   \param graphic Graphic
     1011
     1012   \sa graphic(), setPixmap()
     1013
     1014   \note the style() is set to QwtSymbol::Graphic
     1015   \note brush() and pen() have no effect
     1016 */
     1017void QwtSymbol::setGraphic( const QwtGraphic& graphic )
     1018{
     1019    m_data->style = QwtSymbol::Graphic;
     1020    m_data->graphic.graphic = graphic;
     1021}
     1022
     1023/*!
     1024   \return Assigned graphic
     1025   \sa setGraphic()
     1026 */
     1027const QwtGraphic& QwtSymbol::graphic() const
     1028{
     1029    return m_data->graphic.graphic;
    10311030}
    10321031
    … …  
    10341033
    10351034/*!
    1036   Set a SVG icon as symbol
    1037 
    1038   \param svgDocument SVG icon
    1039 
    1040   \sa setGraphic(), setPixmap()
    1041 
    1042   \note the style() is set to QwtSymbol::SvgDocument
    1043   \note brush() and pen() have no effect
    1044  */
    1045 void QwtSymbol::setSvgDocument( const QByteArray &svgDocument )
    1046 {
    1047     d_data->style = QwtSymbol::SvgDocument;
    1048     if ( d_data->svg.renderer == NULL )
    1049         d_data->svg.renderer = new QSvgRenderer();
    1050 
    1051     d_data->svg.renderer->load( svgDocument );
     1035   Set a SVG icon as symbol
     1036
     1037   \param svgDocument SVG icon
     1038
     1039   \sa setGraphic(), setPixmap()
     1040
     1041   \note the style() is set to QwtSymbol::SvgDocument
     1042   \note brush() and pen() have no effect
     1043 */
     1044void QwtSymbol::setSvgDocument( const QByteArray& svgDocument )
     1045{
     1046    m_data->style = QwtSymbol::SvgDocument;
     1047    if ( m_data->svg.renderer == NULL )
     1048        m_data->svg.renderer = new QSvgRenderer();
     1049
     1050    m_data->svg.renderer->load( svgDocument );
    10521051}
    10531052
    … …  
    10551054
    10561055/*!
    1057   \brief Specify the symbol's size
    1058 
    1059   If the 'h' parameter is left out or less than 0,
    1060   and the 'w' parameter is greater than or equal to 0,
    1061   the symbol size will be set to (w,w).
    1062 
    1063   \param width Width
    1064   \param height Height (defaults to -1)
    1065 
    1066   \sa size()
    1067 */
     1056   \brief Specify the symbol's size
     1057
     1058   If the 'h' parameter is left out or less than 0,
     1059   and the 'w' parameter is greater than or equal to 0,
     1060   the symbol size will be set to (w,w).
     1061
     1062   \param width Width
     1063   \param height Height (defaults to -1)
     1064
     1065   \sa size()
     1066 */
    10681067void QwtSymbol::setSize( int width, int height )
    10691068{
    … …  
    10791078
    10801079   \sa size()
    1081 */
    1082 void QwtSymbol::setSize( const QSize &size )
    1083 {
    1084     if ( size.isValid() && size != d_data->size )
    1085     {
    1086         d_data->size = size;
     1080 */
     1081void QwtSymbol::setSize( const QSize& size )
     1082{
     1083    if ( size.isValid() && size != m_data->size )
     1084    {
     1085        m_data->size = size;
    10871086        invalidateCache();
    10881087    }
    … …  
    10921091   \return Size
    10931092   \sa setSize()
    1094 */
     1093 */
    10951094const QSize& QwtSymbol::size() const
    10961095{
    1097     return d_data->size;
    1098 }
    1099 
    1100 /*!
    1101   \brief Assign a brush
    1102 
    1103   The brush is used to draw the interior of the symbol.
    1104   \param brush Brush
    1105 
    1106   \sa brush()
    1107 */
    1108 void QwtSymbol::setBrush( const QBrush &brush )
    1109 {
    1110     if ( brush != d_data->brush )
    1111     {
    1112         d_data->brush = brush;
     1096    return m_data->size;
     1097}
     1098
     1099/*!
     1100   \brief Assign a brush
     1101
     1102   The brush is used to draw the interior of the symbol.
     1103   \param brush Brush
     1104
     1105   \sa brush()
     1106 */
     1107void QwtSymbol::setBrush( const QBrush& brush )
     1108{
     1109    if ( brush != m_data->brush )
     1110    {
     1111        m_data->brush = brush;
    11131112        invalidateCache();
    11141113
    1115         if ( d_data->style == QwtSymbol::Path )
    1116             d_data->path.graphic.reset();
    1117     }
    1118 }
    1119 
    1120 /*!
    1121   \return Brush
    1122   \sa setBrush()
    1123 */
     1114        if ( m_data->style == QwtSymbol::Path )
     1115            m_data->path.graphic.reset();
     1116    }
     1117}
     1118
     1119/*!
     1120   \return Brush
     1121   \sa setBrush()
     1122 */
    11241123const QBrush& QwtSymbol::brush() const
    11251124{
    1126     return d_data->brush;
    1127 }
    1128 
    1129 /*!
    1130   Build and assign a pen
    1131 
    1132   In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 )
    1133   what makes it non cosmetic ( see QPen::isCosmetic() ).
    1134   This method has been introduced to hide this incompatibility.
    1135 
    1136   \param color Pen color
    1137   \param width Pen width
    1138   \param style Pen style
    1139 
    1140   \sa pen(), brush()
    1141  */
    1142 void QwtSymbol::setPen( const QColor &color,
     1125    return m_data->brush;
     1126}
     1127
     1128/*!
     1129   Build and assign a pen
     1130
     1131   In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 )
     1132   what makes it non cosmetic ( see QPen::isCosmetic() ).
     1133   This method has been introduced to hide this incompatibility.
     1134
     1135   \param color Pen color
     1136   \param width Pen width
     1137   \param style Pen style
     1138
     1139   \sa pen(), brush()
     1140 */
     1141void QwtSymbol::setPen( const QColor& color,
    11431142    qreal width, Qt::PenStyle style )
    11441143{
    … …  
    11471146
    11481147/*!
    1149   Assign a pen
    1150 
    1151   The pen is used to draw the symbol's outline.
    1152 
    1153   \param pen Pen
    1154   \sa pen(), setBrush()
    1155 */
    1156 void QwtSymbol::setPen( const QPen &pen )
    1157 {
    1158     if ( pen != d_data->pen )
    1159     {
    1160         d_data->pen = pen;
     1148   Assign a pen
     1149
     1150   The pen is used to draw the symbol's outline.
     1151
     1152   \param pen Pen
     1153   \sa pen(), setBrush()
     1154 */
     1155void QwtSymbol::setPen( const QPen& pen )
     1156{
     1157    if ( pen != m_data->pen )
     1158    {
     1159        m_data->pen = pen;
    11611160        invalidateCache();
    11621161
    1163         if ( d_data->style == QwtSymbol::Path )
    1164             d_data->path.graphic.reset();
    1165     }
    1166 }
    1167 
    1168 /*!
    1169   \return Pen
    1170   \sa setPen(), brush()
    1171 */
     1162        if ( m_data->style == QwtSymbol::Path )
     1163            m_data->path.graphic.reset();
     1164    }
     1165}
     1166
     1167/*!
     1168   \return Pen
     1169   \sa setPen(), brush()
     1170 */
    11721171const QPen& QwtSymbol::pen() const
    11731172{
    1174     return d_data->pen;
    1175 }
    1176 
    1177 /*!
    1178   \brief Set the color of the symbol
    1179 
    1180   Change the color of the brush for symbol types with a filled area.
    1181   For all other symbol types the color will be assigned to the pen.
    1182 
    1183   \param color Color
    1184 
    1185   \sa setBrush(), setPen(), brush(), pen()
    1186 */
    1187 void QwtSymbol::setColor( const QColor &color )
    1188 {
    1189     switch ( d_data->style )
     1173    return m_data->pen;
     1174}
     1175
     1176/*!
     1177   \brief Set the color of the symbol
     1178
     1179   Change the color of the brush for symbol types with a filled area.
     1180   For all other symbol types the color will be assigned to the pen.
     1181
     1182   \param color Color
     1183
     1184   \sa setBrush(), setPen(), brush(), pen()
     1185 */
     1186void QwtSymbol::setColor( const QColor& color )
     1187{
     1188    switch ( m_data->style )
    11901189    {
    11911190        case QwtSymbol::Ellipse:
    … …  
    12001199        case QwtSymbol::Hexagon:
    12011200        {
    1202             if ( d_data->brush.color() != color )
     1201            if ( m_data->brush.color() != color )
    12031202            {
    1204                 d_data->brush.setColor( color );
     1203                m_data->brush.setColor( color );
    12051204                invalidateCache();
    12061205            }
    … …  
    12131212        case QwtSymbol::Star1:
    12141213        {
    1215             if ( d_data->pen.color() != color )
     1214            if ( m_data->pen.color() != color )
    12161215            {
    1217                 d_data->pen.setColor( color );
     1216                m_data->pen.setColor( color );
    12181217                invalidateCache();
    12191218            }
    … …  
    12221221        default:
    12231222        {
    1224             if ( d_data->brush.color() != color ||
    1225                 d_data->pen.color() != color )
     1223            if ( m_data->brush.color() != color ||
     1224                m_data->pen.color() != color )
    12261225            {
    12271226                invalidateCache();
    12281227            }
    12291228
    1230             d_data->brush.setColor( color );
    1231             d_data->pen.setColor( color );
    1232         }
    1233     }
    1234 }
    1235 
    1236 /*!
    1237   \brief Set and enable a pin point
    1238 
    1239   The position of a complex symbol is not always aligned to its center
    1240   ( f.e an arrow, where the peak points to a position ). The pin point
    1241   defines the position inside of a Pixmap, Graphic, SvgDocument
    1242   or PainterPath symbol where the represented point has to
    1243   be aligned to.
    1244 
    1245   \param pos Position
    1246   \param enable En/Disable the pin point alignment
    1247 
    1248   \sa pinPoint(), setPinPointEnabled()
    1249  */
    1250 void QwtSymbol::setPinPoint( const QPointF &pos, bool enable )
    1251 {
    1252     if ( d_data->pinPoint != pos )
    1253     {
    1254         d_data->pinPoint = pos;
    1255         if ( d_data->isPinPointEnabled )
     1229            m_data->brush.setColor( color );
     1230            m_data->pen.setColor( color );
     1231        }
     1232    }
     1233}
     1234
     1235/*!
     1236   \brief Set and enable a pin point
     1237
     1238   The position of a complex symbol is not always aligned to its center
     1239   ( f.e an arrow, where the peak points to a position ). The pin point
     1240   defines the position inside of a Pixmap, Graphic, SvgDocument
     1241   or PainterPath symbol where the represented point has to
     1242   be aligned to.
     1243
     1244   \param pos Position
     1245   \param enable En/Disable the pin point alignment
     1246
     1247   \sa pinPoint(), setPinPointEnabled()
     1248 */
     1249void QwtSymbol::setPinPoint( const QPointF& pos, bool enable )
     1250{
     1251    if ( m_data->pinPoint != pos )
     1252    {
     1253        m_data->pinPoint = pos;
     1254        if ( m_data->isPinPointEnabled )
    12561255        {
    12571256            invalidateCache();
    … …  
    12631262
    12641263/*!
    1265   \return Pin point
    1266   \sa setPinPoint(), setPinPointEnabled()
     1264   \return Pin point
     1265   \sa setPinPoint(), setPinPointEnabled()
    12671266 */
    12681267QPointF QwtSymbol::pinPoint() const
    12691268{
    1270     return d_data->pinPoint;
    1271 }
    1272 
    1273 /*!
    1274   En/Disable the pin point alignment
    1275 
    1276   \param on Enabled, when on is true
    1277   \sa setPinPoint(), isPinPointEnabled()
     1269    return m_data->pinPoint;
     1270}
     1271
     1272/*!
     1273   En/Disable the pin point alignment
     1274
     1275   \param on Enabled, when on is true
     1276   \sa setPinPoint(), isPinPointEnabled()
    12781277 */
    12791278void QwtSymbol::setPinPointEnabled( bool on )
    12801279{
    1281     if ( d_data->isPinPointEnabled != on )
    1282     {
    1283         d_data->isPinPointEnabled = on;
     1280    if ( m_data->isPinPointEnabled != on )
     1281    {
     1282        m_data->isPinPointEnabled = on;
    12841283        invalidateCache();
    12851284    }
    … …  
    12871286
    12881287/*!
    1289   \return True, when the pin point translation is enabled
    1290   \sa setPinPoint(), setPinPointEnabled()
     1288   \return True, when the pin point translation is enabled
     1289   \sa setPinPoint(), setPinPointEnabled()
    12911290 */
    12921291bool QwtSymbol::isPinPointEnabled() const
    12931292{
    1294     return d_data->isPinPointEnabled;
    1295 }
    1296 
    1297 /*!
    1298   Render an array of symbols
    1299 
    1300   Painting several symbols is more effective than drawing symbols
    1301   one by one, as a couple of layout calculations and setting of pen/brush
    1302   can be done once for the complete array.
    1303 
    1304   \param painter Painter
    1305   \param points Array of points
    1306   \param numPoints Number of points
    1307 */
    1308 void QwtSymbol::drawSymbols( QPainter *painter,
    1309     const QPointF *points, int numPoints ) const
     1293    return m_data->isPinPointEnabled;
     1294}
     1295
     1296/*!
     1297   Render an array of symbols
     1298
     1299   Painting several symbols is more effective than drawing symbols
     1300   one by one, as a couple of layout calculations and setting of pen/brush
     1301   can be done once for the complete array.
     1302
     1303   \param painter Painter
     1304   \param points Array of points
     1305   \param numPoints Number of points
     1306 */
     1307void QwtSymbol::drawSymbols( QPainter* painter,
     1308    const QPointF* points, int numPoints ) const
    13101309{
    13111310    if ( numPoints <= 0 )
    … …  
    13201319        !painter->transform().isScaling() )
    13211320    {
    1322         if ( d_data->cache.policy == QwtSymbol::Cache )
     1321        if ( m_data->cache.policy == QwtSymbol::Cache )
    13231322        {
    13241323            useCache = true;
    13251324        }
    1326         else if ( d_data->cache.policy == QwtSymbol::AutoCache )
    1327         {
    1328             if ( painter->paintEngine()->type() == QPaintEngine::Raster )
     1325        else if ( m_data->cache.policy == QwtSymbol::AutoCache )
     1326        {
     1327            switch( painter->paintEngine()->type() )
    13291328            {
    1330                 useCache = true;
    1331             }
    1332             else
    1333             {
    1334                 switch( d_data->style )
     1329                case QPaintEngine::OpenGL:
     1330                case QPaintEngine::OpenGL2:
    13351331                {
    1336                     case QwtSymbol::XCross:
    1337                     case QwtSymbol::HLine:
    1338                     case QwtSymbol::VLine:
    1339                     case QwtSymbol::Cross:
    1340                         break;
    1341 
    1342                     case QwtSymbol::Pixmap:
     1332                    // using a FBO as cache ?
     1333                    useCache = false;
     1334                    break;
     1335                }
     1336                case QPaintEngine::OpenVG:
     1337                case QPaintEngine::SVG:
     1338                case QPaintEngine::Pdf:
     1339                case QPaintEngine::Picture:
     1340                {
     1341                    // vector graphics
     1342                    useCache = false;
     1343                    break;
     1344                }
     1345                case QPaintEngine::X11:
     1346                {
     1347                    switch( m_data->style )
    13431348                    {
    1344                         if ( !d_data->size.isEmpty() &&
    1345                             d_data->size != d_data->pixmap.pixmap.size() )
     1349                        case QwtSymbol::XCross:
     1350                        case QwtSymbol::HLine:
     1351                        case QwtSymbol::VLine:
     1352                        case QwtSymbol::Cross:
    13461353                        {
    1347                             useCache = true;
     1354                            // for the very simple shapes using vector graphics is
     1355                            // usually faster.
     1356
     1357                            useCache = false;
     1358                            break;
    13481359                        }
    1349                         break;
     1360
     1361                        case QwtSymbol::Pixmap:
     1362                        {
     1363                            if ( m_data->size.isEmpty() ||
     1364                                m_data->size == m_data->pixmap.pixmap.size() )
     1365                            {
     1366                                // no need to have a pixmap cache for a pixmap
     1367                                // of the same size
     1368
     1369                                useCache = false;
     1370                            }
     1371                            break;
     1372                        }
     1373                        default:
     1374                            break;
    13501375                    }
    1351                     default:
    1352                         useCache = true;
     1376                    break;
     1377                }
     1378                default:
     1379                {
     1380                    useCache = true;
    13531381                }
    13541382            }
    … …  
    13601388        const QRect br = boundingRect();
    13611389
    1362         if ( d_data->cache.pixmap.isNull() )
    1363         {
    1364             d_data->cache.pixmap = QwtPainter::backingStore( NULL, br.size() );
    1365             d_data->cache.pixmap.fill( Qt::transparent );
    1366 
    1367             QPainter p( &d_data->cache.pixmap );
     1390        if ( m_data->cache.pixmap.isNull() )
     1391        {
     1392            m_data->cache.pixmap = QwtPainter::backingStore( NULL, br.size() );
     1393            m_data->cache.pixmap.fill( Qt::transparent );
     1394
     1395            QPainter p( &m_data->cache.pixmap );
    13681396            p.setRenderHints( painter->renderHints() );
    13691397            p.translate( -br.topLeft() );
    13701398
    1371             const QPointF pos;
     1399            const QPointF pos( 0.0, 0.0 );
    13721400            renderSymbols( &p, &pos, 1 );
    13731401        }
    … …  
    13811409            const int top = qRound( points[i].y() ) + dy;
    13821410
    1383             painter->drawPixmap( left, top, d_data->cache.pixmap );
     1411            painter->drawPixmap( left, top, m_data->cache.pixmap );
    13841412        }
    13851413    }
    … …  
    13931421
    13941422/*!
    1395   \brief Draw the symbol into a rectangle
    1396 
    1397   The symbol is painted centered and scaled into the target rectangle.
    1398   It is always painted uncached and the pin point is ignored.
    1399 
    1400   This method is primarily intended for drawing a symbol to
    1401   the legend.
    1402 
    1403   \param painter Painter
    1404   \param rect Target rectangle for the symbol
    1405 */
    1406 void QwtSymbol::drawSymbol( QPainter *painter, const QRectF &rect ) const
    1407 {
    1408     if ( d_data->style == QwtSymbol::NoSymbol )
     1423   \brief Draw the symbol into a rectangle
     1424
     1425   The symbol is painted centered and scaled into the target rectangle.
     1426   It is always painted uncached and the pin point is ignored.
     1427
     1428   This method is primarily intended for drawing a symbol to
     1429   the legend.
     1430
     1431   \param painter Painter
     1432   \param rect Target rectangle for the symbol
     1433 */
     1434void QwtSymbol::drawSymbol( QPainter* painter, const QRectF& rect ) const
     1435{
     1436    if ( m_data->style == QwtSymbol::NoSymbol )
    14091437        return;
    14101438
    1411     if ( d_data->style == QwtSymbol::Graphic )
    1412     {
    1413         d_data->graphic.graphic.render(
     1439    if ( m_data->style == QwtSymbol::Graphic )
     1440    {
     1441        m_data->graphic.graphic.render(
    14141442            painter, rect, Qt::KeepAspectRatio );
    14151443    }
    1416     else if ( d_data->style == QwtSymbol::Path )
    1417     {
    1418         if ( d_data->path.graphic.isNull() )
    1419         {
    1420             d_data->path.graphic = qwtPathGraphic(
    1421                 d_data->path.path, d_data->pen, d_data->brush );
    1422         }
    1423 
    1424         d_data->path.graphic.render(
     1444    else if ( m_data->style == QwtSymbol::Path )
     1445    {
     1446        if ( m_data->path.graphic.isNull() )
     1447        {
     1448            m_data->path.graphic = qwtPathGraphic(
     1449                m_data->path.path, m_data->pen, m_data->brush );
     1450        }
     1451
     1452        m_data->path.graphic.render(
    14251453            painter, rect, Qt::KeepAspectRatio );
    14261454        return;
    14271455    }
    1428     else if ( d_data->style == QwtSymbol::SvgDocument )
     1456    else if ( m_data->style == QwtSymbol::SvgDocument )
    14291457    {
    14301458#ifndef QWT_NO_SVG
    1431         if ( d_data->svg.renderer )
     1459        if ( m_data->svg.renderer )
    14321460        {
    14331461            QRectF scaledRect;
    14341462
    1435             QSizeF sz = d_data->svg.renderer->viewBoxF().size();
     1463            QSizeF sz = m_data->svg.renderer->viewBoxF().size();
    14361464            if ( !sz.isEmpty() )
    14371465            {
    … …  
    14451473            }
    14461474
    1447             d_data->svg.renderer->render(
     1475            m_data->svg.renderer->render(
    14481476                painter, scaledRect );
    14491477        }
    … …  
    14641492        painter->scale( ratio, ratio );
    14651493
    1466         const bool isPinPointEnabled = d_data->isPinPointEnabled;
    1467         d_data->isPinPointEnabled = false;
     1494        const bool isPinPointEnabled = m_data->isPinPointEnabled;
     1495        m_data->isPinPointEnabled = false;
    14681496
    14691497        const QPointF pos;
    14701498        renderSymbols( painter, &pos, 1 );
    14711499
    1472         d_data->isPinPointEnabled = isPinPointEnabled;
     1500        m_data->isPinPointEnabled = isPinPointEnabled;
    14731501
    14741502        painter->restore();
    … …  
    14771505
    14781506/*!
    1479   Render the symbol to series of points
    1480 
    1481   \param painter Qt painter
    1482   \param points Positions of the symbols
    1483   \param numPoints Number of points
    1484  */
    1485 void QwtSymbol::renderSymbols( QPainter *painter,
    1486     const QPointF *points, int numPoints ) const
    1487 {
    1488     switch ( d_data->style )
     1507   Render the symbol to series of points
     1508
     1509   \param painter Qt painter
     1510   \param points Positions of the symbols
     1511   \param numPoints Number of points
     1512 */
     1513void QwtSymbol::renderSymbols( QPainter* painter,
     1514    const QPointF* points, int numPoints ) const
     1515{
     1516    switch ( m_data->style )
    14891517    {
    14901518        case QwtSymbol::Ellipse:
    … …  
    15681596        case QwtSymbol::Path:
    15691597        {
    1570             if ( d_data->path.graphic.isNull() )
     1598            if ( m_data->path.graphic.isNull() )
    15711599            {
    1572                 d_data->path.graphic = qwtPathGraphic( d_data->path.path,
    1573                     d_data->pen, d_data->brush );
     1600                m_data->path.graphic = qwtPathGraphic( m_data->path.path,
     1601                    m_data->pen, m_data->brush );
    15741602            }
    15751603
    15761604            qwtDrawGraphicSymbols( painter, points, numPoints,
    1577                 d_data->path.graphic, *this );
     1605                m_data->path.graphic, *this );
    15781606            break;
    15791607        }
    … …  
    15861614        {
    15871615            qwtDrawGraphicSymbols( painter, points, numPoints,
    1588                 d_data->graphic.graphic, *this );
     1616                m_data->graphic.graphic, *this );
    15891617            break;
    15901618        }
    … …  
    15931621#ifndef QWT_NO_SVG
    15941622            qwtDrawSvgSymbols( painter, points, numPoints,
    1595                 d_data->svg.renderer, *this );
     1623                m_data->svg.renderer, *this );
    15961624#endif
    15971625            break;
    … …  
    16021630
    16031631/*!
    1604   Calculate the bounding rectangle for a symbol
    1605   at position (0,0).
    1606 
    1607   \return Bounding rectangle
     1632   Calculate the bounding rectangle for a symbol
     1633   at position (0,0).
     1634
     1635   \return Bounding rectangle
    16081636 */
    16091637QRect QwtSymbol::boundingRect() const
    … …  
    16131641    bool pinPointTranslation = false;
    16141642
    1615     switch ( d_data->style )
     1643    switch ( m_data->style )
    16161644    {
    16171645        case QwtSymbol::Ellipse:
    … …  
    16201648        {
    16211649            qreal pw = 0.0;
    1622             if ( d_data->pen.style() != Qt::NoPen )
    1623                 pw = qMax( d_data->pen.widthF(), qreal( 1.0 ) );
    1624 
    1625             rect.setSize( d_data->size + QSizeF( pw, pw ) );
     1650            if ( m_data->pen.style() != Qt::NoPen )
     1651                pw = QwtPainter::effectivePenWidth( m_data->pen );
     1652
     1653            rect.setSize( m_data->size + QSizeF( pw, pw ) );
    16261654            rect.moveCenter( QPointF( 0.0, 0.0 ) );
    16271655
    … …  
    16391667        {
    16401668            qreal pw = 0.0;
    1641             if ( d_data->pen.style() != Qt::NoPen )
    1642                 pw = qMax( d_data->pen.widthF(), qreal( 1.0 ) );
    1643 
    1644             rect.setSize( d_data->size + QSizeF( 2 * pw, 2 * pw ) );
     1669            if ( m_data->pen.style() != Qt::NoPen )
     1670                pw = QwtPainter::effectivePenWidth( m_data->pen );
     1671
     1672            rect.setSize( m_data->size + QSizeF( 2 * pw, 2 * pw ) );
    16451673            rect.moveCenter( QPointF( 0.0, 0.0 ) );
    16461674            break;
    … …  
    16481676        case QwtSymbol::Path:
    16491677        {
    1650             if ( d_data->path.graphic.isNull() )
     1678            if ( m_data->path.graphic.isNull() )
    16511679            {
    1652                 d_data->path.graphic = qwtPathGraphic(
    1653                     d_data->path.path, d_data->pen, d_data->brush );
     1680                m_data->path.graphic = qwtPathGraphic(
     1681                    m_data->path.path, m_data->pen, m_data->brush );
    16541682            }
    16551683
    16561684            rect = qwtScaledBoundingRect(
    1657                 d_data->path.graphic, d_data->size );
     1685                m_data->path.graphic, m_data->size );
    16581686            pinPointTranslation = true;
    16591687
    … …  
    16621690        case QwtSymbol::Pixmap:
    16631691        {
    1664             if ( d_data->size.isEmpty() )
    1665                 rect.setSize( d_data->pixmap.pixmap.size() );
     1692            if ( m_data->size.isEmpty() )
     1693                rect.setSize( m_data->pixmap.pixmap.size() );
    16661694            else
    1667                 rect.setSize( d_data->size );
     1695                rect.setSize( m_data->size );
    16681696
    16691697            pinPointTranslation = true;
    … …  
    16741702        {
    16751703            rect = qwtScaledBoundingRect(
    1676                 d_data->graphic.graphic, d_data->size );
     1704                m_data->graphic.graphic, m_data->size );
    16771705            pinPointTranslation = true;
    16781706
    … …  
    16821710        case QwtSymbol::SvgDocument:
    16831711        {
    1684             if ( d_data->svg.renderer )
    1685                 rect = d_data->svg.renderer->viewBoxF();
    1686 
    1687             if ( d_data->size.isValid() && !rect.isEmpty() )
     1712            if ( m_data->svg.renderer )
     1713                rect = m_data->svg.renderer->viewBoxF();
     1714
     1715            if ( m_data->size.isValid() && !rect.isEmpty() )
    16881716            {
    16891717                QSizeF sz = rect.size();
    16901718
    1691                 const double sx = d_data->size.width() / sz.width();
    1692                 const double sy = d_data->size.height() / sz.height();
     1719                const double sx = m_data->size.width() / sz.width();
     1720                const double sy = m_data->size.height() / sz.height();
    16931721
    16941722                QTransform transform;
    … …  
    17031731        default:
    17041732        {
    1705             rect.setSize( d_data->size );
     1733            rect.setSize( m_data->size );
    17061734            rect.moveCenter( QPointF( 0.0, 0.0 ) );
    17071735        }
    … …  
    17111739    {
    17121740        QPointF pinPoint( 0.0, 0.0 );
    1713         if ( d_data->isPinPointEnabled )
    1714             pinPoint = rect.center() - d_data->pinPoint;
     1741        if ( m_data->isPinPointEnabled )
     1742            pinPoint = rect.center() - m_data->pinPoint;
    17151743
    17161744        rect.moveCenter( pinPoint );
    … …  
    17181746
    17191747    QRect r;
    1720     r.setLeft( qFloor( rect.left() ) );
    1721     r.setTop( qFloor( rect.top() ) );
    1722     r.setRight( qCeil( rect.right() ) );
    1723     r.setBottom( qCeil( rect.bottom() ) );
    1724 
    1725     if ( d_data->style != QwtSymbol::Pixmap )
     1748    r.setLeft( qwtFloor( rect.left() ) );
     1749    r.setTop( qwtFloor( rect.top() ) );
     1750    r.setRight( qwtCeil( rect.right() ) );
     1751    r.setBottom( qwtCeil( rect.bottom() ) );
     1752
     1753    if ( m_data->style != QwtSymbol::Pixmap )
    17261754        r.adjust( -1, -1, 1, 1 ); // for antialiasing
    17271755
    … …  
    17301758
    17311759/*!
    1732   Invalidate the cached symbol pixmap
    1733 
    1734   The symbol invalidates its cache, whenever an attribute is changed
    1735   that has an effect ob how to display a symbol. In case of derived
    1736   classes with individual styles ( >= QwtSymbol::UserStyle ) it
    1737   might be necessary to call invalidateCache() for attributes
    1738   that are relevant for this style.
    1739 
    1740   \sa CachePolicy, setCachePolicy(), drawSymbols()
     1760   Invalidate the cached symbol pixmap
     1761
     1762   The symbol invalidates its cache, whenever an attribute is changed
     1763   that has an effect ob how to display a symbol. In case of derived
     1764   classes with individual styles ( >= QwtSymbol::UserStyle ) it
     1765   might be necessary to call invalidateCache() for attributes
     1766   that are relevant for this style.
     1767
     1768   \sa CachePolicy, setCachePolicy(), drawSymbols()
    17411769 */
    17421770void QwtSymbol::invalidateCache()
    17431771{
    1744     if ( !d_data->cache.pixmap.isNull() )
    1745         d_data->cache.pixmap = QPixmap();
    1746 }
    1747 
    1748 /*!
    1749   Specify the symbol style
    1750 
    1751   \param style Style
    1752   \sa style()
    1753 */
     1772    if ( !m_data->cache.pixmap.isNull() )
     1773        m_data->cache.pixmap = QPixmap();
     1774}
     1775
     1776/*!
     1777   Specify the symbol style
     1778
     1779   \param style Style
     1780   \sa style()
     1781 */
    17541782void QwtSymbol::setStyle( QwtSymbol::Style style )
    17551783{
    1756     if ( d_data->style != style )
    1757     {
    1758         d_data->style = style;
     1784    if ( m_data->style != style )
     1785    {
     1786        m_data->style = style;
    17591787        invalidateCache();
    17601788    }
    … …  
    17621790
    17631791/*!
    1764   \return Current symbol style
    1765   \sa setStyle()
    1766 */
     1792   \return Current symbol style
     1793   \sa setStyle()
     1794 */
    17671795QwtSymbol::Style QwtSymbol::style() const
    17681796{
    1769     return d_data->style;
    1770 }
     1797    return m_data->style;
     1798}
Note: See TracChangeset for help on using the changeset viewer.