Changeset 9383 in ntrip


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

Location:
trunk/BNC
Files:
172 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/qwt/qwt_abstract_legend.h

    r8127 r9383  
    2222
    2323  Legends, that need to be under control of the QwtPlot layout system
    24   need to be derived from QwtAbstractLegend. 
     24  need to be derived from QwtAbstractLegend.
    2525
    2626  \note Other type of legends can be implemented by connecting to
     
    4545      \param painter Painter
    4646      \param rect Bounding rectangle
    47       \param fillBackground When true, fill rect with the widget background 
     47      \param fillBackground When true, fill rect with the widget background
    4848
    4949      \sa renderLegend() is used by QwtPlotRenderer
    5050    */
    51     virtual void renderLegend( QPainter *painter, 
     51    virtual void renderLegend( QPainter *painter,
    5252        const QRectF &rect, bool fillBackground ) const = 0;
    5353
     
    6565      \param data List of legend entry attributes for the  item
    6666     */
    67     virtual void updateLegend( const QVariant &itemInfo, 
     67    virtual void updateLegend( const QVariant &itemInfo,
    6868        const QList<QwtLegendData> &data ) = 0;
    6969};
    7070
    71 #endif 
     71#endif
  • trunk/BNC/qwt/qwt_abstract_scale.cpp

    r8127 r9383  
    7272
    7373  \sa lowerBound(), setScale(), setUpperBound()
    74   \note For inverted scales the lower bound 
     74  \note For inverted scales the lower bound
    7575        is greater than the upper bound
    7676*/
     
    9595
    9696  \sa upperBound(), setScale(), setLowerBound()
    97   \note For inverted scales the lower bound 
     97  \note For inverted scales the lower bound
    9898        is greater than the upper bound
    9999*/
     
    115115  \brief Specify a scale.
    116116
    117   Define a scale by an interval 
    118 
    119   The ticks are calculated using scaleMaxMinor(), 
     117  Define a scale by an interval
     118
     119  The ticks are calculated using scaleMaxMinor(),
    120120  scaleMaxMajor() and scaleStepSize().
    121121
     
    123123  \param upperBound upper limit of the scale interval
    124124
    125   \note For inverted scales the lower bound 
     125  \note For inverted scales the lower bound
    126126        is greater than the upper bound
    127127*/
     
    136136  Define a scale by an interval
    137137
    138   The ticks are calculated using scaleMaxMinor(), 
     138  The ticks are calculated using scaleMaxMinor(),
    139139  scaleMaxMajor() and scaleStepSize().
    140140
     
    343343
    344344  The scale division might have been assigned explicitly
    345   or calculated implicitly by rescale(). 
     345  or calculated implicitly by rescale().
    346346 */
    347347const QwtScaleDiv &QwtAbstractScale::scaleDiv() const
     
    361361  Translate a scale value into a widget coordinate
    362362
    363   \param value Scale value 
     363  \param value Scale value
    364364  \return Corresponding widget coordinate for value
    365365  \sa scaleMap(), invTransform()
     
    425425  \sa scaleChange()
    426426*/
    427 void QwtAbstractScale::rescale( 
     427void QwtAbstractScale::rescale(
    428428    double lowerBound, double upperBound, double stepSize )
    429429{
  • trunk/BNC/qwt/qwt_abstract_scale.h

    r8127 r9383  
    2828
    2929  The scale division might be assigned explicitly - but usually
    30   it is calculated from the boundaries using a QwtScaleEngine. 
     30  it is calculated from the boundaries using a QwtScaleEngine.
    3131
    32   The scale engine also decides the type of transformation of the scale 
     32  The scale engine also decides the type of transformation of the scale
    3333  ( linear, logarithmic ... ).
    3434*/
     
    8686
    8787protected:
    88     void rescale( double lowerBound, 
     88    void rescale( double lowerBound,
    8989        double upperBound, double stepSize );
    9090
  • trunk/BNC/qwt/qwt_abstract_scale_draw.cpp

    r8127 r9383  
    2626        minExtent( 0.0 )
    2727    {
    28         components = QwtAbstractScaleDraw::Backbone 
    29             | QwtAbstractScaleDraw::Ticks 
     28        components = QwtAbstractScaleDraw::Backbone
     29            | QwtAbstractScaleDraw::Ticks
    3030            | QwtAbstractScaleDraw::Labels;
    3131
     
    198198        painter->save();
    199199
    200         QPen pen = painter->pen();
     200        pen = painter->pen();
    201201        pen.setColor( palette.color( QPalette::WindowText ) );
    202202        pen.setCapStyle( Qt::FlatCap );
     
    227227        painter->save();
    228228
    229         QPen pen = painter->pen();
     229        pen = painter->pen();
    230230        pen.setColor( palette.color( QPalette::WindowText ) );
    231231        pen.setCapStyle( Qt::FlatCap );
     
    393393    const QFont &font, double value ) const
    394394{
    395     QMap<double, QwtText>::const_iterator it = d_data->labelCache.find( value );
    396     if ( it == d_data->labelCache.end() )
    397     {
    398         QwtText lbl = label( value );
    399         lbl.setRenderFlags( 0 );
    400         lbl.setLayoutAttribute( QwtText::MinimumLayout );
    401 
    402         ( void )lbl.textSize( font ); // initialize the internal cache
    403 
    404         it = d_data->labelCache.insert( value, lbl );
    405     }
    406 
    407     return ( *it );
     395    QMap<double, QwtText>::const_iterator it1 = d_data->labelCache.constFind( value );
     396    if ( it1 != d_data->labelCache.constEnd() )
     397        return *it1;
     398
     399    QwtText lbl = label( value );
     400    lbl.setRenderFlags( 0 );
     401    lbl.setLayoutAttribute( QwtText::MinimumLayout );
     402
     403    ( void )lbl.textSize( font ); // initialize the internal cache
     404
     405    QMap<double, QwtText>::iterator it2 = d_data->labelCache.insert( value, lbl );
     406    return *it2;
    408407}
    409408
  • trunk/BNC/qwt/qwt_abstract_scale_draw.h

    r8127 r9383  
    5555    virtual ~QwtAbstractScaleDraw();
    5656
    57     void setScaleDiv( const QwtScaleDiv &s );
     57    void setScaleDiv( const QwtScaleDiv & );
    5858    const QwtScaleDiv& scaleDiv() const;
    5959
     
    6969    double maxTickLength() const;
    7070
    71     void setSpacing( double margin );
     71    void setSpacing( double );
    7272    double spacing() const;
    7373
  • trunk/BNC/qwt/qwt_abstract_slider.cpp

    r8127 r9383  
    1818#endif
    1919
    20 static double qwtAlignToScaleDiv( 
     20static double qwtAlignToScaleDiv(
    2121    const QwtAbstractSlider *slider, double value )
    2222{
     
    2828        return sd.lowerBound();
    2929
    30     if ( tValue == slider->transform( sd.lowerBound() ) )
     30    if ( tValue == slider->transform( sd.upperBound() ) )
    3131        return sd.upperBound();
    3232
     
    107107}
    108108
    109 /*! 
     109/*!
    110110  Set the value to be valid/invalid
    111111
     
    122122
    123123        Q_EMIT valueChanged( d_data->value );
    124     }   
    125 }   
     124    }
     125}
    126126
    127127//! \return True, when the value is invalid
     
    129129{
    130130    return d_data->isValid;
    131 }   
     131}
    132132
    133133/*!
     
    168168  \brief Enables or disables tracking.
    169169
    170   If tracking is enabled, the slider emits the valueChanged() 
    171   signal while the movable part of the slider is being dragged. 
    172   If tracking is disabled, the slider emits the valueChanged() signal 
     170  If tracking is enabled, the slider emits the valueChanged()
     171  signal while the movable part of the slider is being dragged.
     172  If tracking is disabled, the slider emits the valueChanged() signal
    173173  only when the user releases the slider.
    174174
     
    288288   Wheel Event handler
    289289
    290    In/decreases the value by s number of steps. The direction 
     290   In/decreases the value by s number of steps. The direction
    291291   depends on the invertedControls() property.
    292292
     
    459459
    460460  The range of the slider is divided into a number of steps from
    461   which the value increments according to user inputs depend. 
     461  which the value increments according to user inputs depend.
    462462
    463463  The default setting is 100.
     
    485485
    486486  The range of the slider is divided into a number of steps from
    487   which the value increments according to user inputs depend. 
     487  which the value increments according to user inputs depend.
    488488
    489489  \param stepCount Number of steps
     
    495495{
    496496    d_data->singleSteps = stepCount;
    497 }   
     497}
    498498
    499499/*!
     
    504504{
    505505    return d_data->singleSteps;
    506 }   
    507 
    508 /*! 
     506}
     507
     508/*!
    509509  \brief Set the number of steps for a page increment
    510    
     510
    511511  The range of the slider is divided into a number of steps from
    512   which the value increments according to user inputs depend. 
     512  which the value increments according to user inputs depend.
    513513
    514514  \param stepCount Number of steps
     
    541541*/
    542542void QwtAbstractSlider::setStepAlignment( bool on )
    543 {   
     543{
    544544    if ( on != d_data->stepAlignment )
    545545    {
    546546        d_data->stepAlignment = on;
    547547    }
    548 }   
    549    
     548}
     549
    550550/*!
    551551  \return True, when step alignment is enabled
     
    586586
    587587/*!
    588   If wrapping is true stepping up from upperBound() value will 
    589   take you to the minimum() value and vice versa. 
     588  If wrapping is true stepping up from upperBound() value will
     589  take you to the minimum() value and vice versa.
    590590
    591591  \param on En/Disable wrapping
     
    595595{
    596596    d_data->wrapping = on;
    597 }   
     597}
    598598
    599599/*!
    600600  \return True, when wrapping is set
    601601  \sa setWrapping()
    602  */ 
     602 */
    603603bool QwtAbstractSlider::wrapping() const
    604604{
     
    609609  Invert wheel and key events
    610610
    611   Usually scrolling the mouse wheel "up" and using keys like page 
    612   up will increase the slider's value towards its maximum. 
     611  Usually scrolling the mouse wheel "up" and using keys like page
     612  up will increase the slider's value towards its maximum.
    613613  When invertedControls() is enabled the value is scrolled
    614614  towards its minimum.
     
    645645void QwtAbstractSlider::incrementValue( int stepCount )
    646646{
    647     const double value = incrementedValue( 
     647    const double value = incrementedValue(
    648648        d_data->value, stepCount );
    649649
     
    656656
    657657/*!
    658   Increment a value 
    659 
    660   \param value Value 
     658  Increment a value
     659
     660  \param value Value
    661661  \param stepCount Number of steps
    662662
    663663  \return Incremented value
    664664 */
    665 double QwtAbstractSlider::incrementedValue( 
     665double QwtAbstractSlider::incrementedValue(
    666666    double value, int stepCount ) const
    667667{
     
    684684        // we need equidant steps according to
    685685        // paint device coordinates
    686         const double range = transformation->transform( maximum() ) 
     686        const double range = transformation->transform( maximum() )
    687687            - transformation->transform( minimum() );
    688688
     
    691691        double v = transformation->transform( value );
    692692
    693         v = qRound( v / stepSize ) * stepSize; 
     693        v = qRound( v / stepSize ) * stepSize;
    694694        v += stepCount * range / d_data->totalSteps;
    695695
     
    757757        if ( stepSize > 0.0 )
    758758        {
    759             value = lowerBound() + 
     759            value = lowerBound() +
    760760                qRound( ( value - lowerBound() ) / stepSize ) * stepSize;
    761761        }
  • trunk/BNC/qwt/qwt_abstract_slider.h

    r8127 r9383  
    1818
    1919  A slider widget displays a value according to a scale.
    20   The class is designed as a common super class for widgets like 
     20  The class is designed as a common super class for widgets like
    2121  QwtKnob, QwtDial and QwtSlider.
    2222
    23   When the slider is nor readOnly() its value can be modified 
    24   by keyboard, mouse and wheel inputs. 
     23  When the slider is nor readOnly() its value can be modified
     24  by keyboard, mouse and wheel inputs.
    2525
    2626  The range of the slider is divided into a number of steps from
    27   which the value increments according to user inputs depend. 
     27  which the value increments according to user inputs depend.
    2828  Only for linear scales the number of steps correspond with
    2929  a fixed step size.
     
    6868    uint pageSteps() const;
    6969
    70     void setStepAlignment( bool ); 
     70    void setStepAlignment( bool );
    7171    bool stepAlignment() const;
    7272
     
    8181
    8282public Q_SLOTS:
    83     void setValue( double val );
     83    void setValue( double value );
    8484
    8585Q_SIGNALS:
     
    8888      \brief Notify a change of value.
    8989
    90       When tracking is enabled (default setting), 
    91       this signal will be emitted every time the value changes. 
     90      When tracking is enabled (default setting),
     91      this signal will be emitted every time the value changes.
    9292
    9393      \param value New value
     
    147147    virtual double scrolledTo( const QPoint &pos ) const = 0;
    148148
    149     void incrementValue( int numSteps );
     149    void incrementValue( int stepCount );
    150150
    151151    virtual void scaleChange();
     
    154154    virtual void sliderChange();
    155155
    156     double incrementedValue( 
     156    double incrementedValue(
    157157        double value, int stepCount ) const;
    158158
  • trunk/BNC/qwt/qwt_analog_clock.cpp

    r8127 r9383  
    5353    setTotalSteps( 60 );
    5454
    55     const int secondsPerHour = 60.0 * 60.0; 
     55    const int secondsPerHour = 60.0 * 60.0;
    5656
    5757    QList<double> majorTicks;
     
    7373
    7474    QColor knobColor = palette().color( QPalette::Active, QPalette::Text );
    75     knobColor = knobColor.dark( 120 );
     75    knobColor = knobColor.darker( 120 );
    7676
    7777    QColor handColor;
     
    8383        {
    8484            width = 2;
    85             handColor = knobColor.dark( 120 );
     85            handColor = knobColor.darker( 120 );
    8686        }
    8787        else
     
    201201    {
    202202        const double hours = value() / ( 60.0 * 60.0 );
    203         const double minutes = 
     203        const double minutes =
    204204            ( value() - qFloor(hours) * 60.0 * 60.0 ) / 60.0;
    205205        const double seconds = value() - qFloor(hours) * 60.0 * 60.0
     
    214214        {
    215215            const double d = 360.0 - angle[hand] - origin();
    216             drawHand( painter, static_cast<Hand>( hand ), 
     216            drawHand( painter, static_cast<Hand>( hand ),
    217217                center, radius, d, colorGroup );
    218218        }
  • trunk/BNC/qwt/qwt_analog_clock.h

    r8127 r9383  
    2222
    2323  \par Example
    24   \code 
     24  \code
    2525  #include <qwt_analog_clock.h>
    2626
  • trunk/BNC/qwt/qwt_arrow_button.h

    r8127 r9383  
    3636    virtual void paintEvent( QPaintEvent *event );
    3737
    38     virtual void drawButtonLabel( QPainter *p );
     38    virtual void drawButtonLabel( QPainter * );
    3939    virtual void drawArrow( QPainter *,
    4040        const QRect &, Qt::ArrowType ) const;
  • trunk/BNC/qwt/qwt_clipper.cpp

    r8127 r9383  
    151151    }
    152152
    153     inline void reset() 
    154     { 
    155         m_size = 0; 
    156     }
    157 
    158     inline int size() const 
    159     { 
    160         return m_size; 
    161     }
    162 
    163     inline Point *data() const 
    164     { 
    165         return m_buffer; 
    166     }
    167 
    168     inline Point &operator[]( int i ) 
    169     { 
    170         return m_buffer[i]; 
    171     }
    172 
    173     inline const Point &operator[]( int i ) const 
    174     { 
    175         return m_buffer[i]; 
     153    inline void reset()
     154    {
     155        m_size = 0;
     156    }
     157
     158    inline int size() const
     159    {
     160        return m_size;
     161    }
     162
     163    inline Point *data() const
     164    {
     165        return m_buffer;
     166    }
     167
     168    inline Point &operator[]( int i )
     169    {
     170        return m_buffer[i];
     171    }
     172
     173    inline const Point &operator[]( int i ) const
     174    {
     175        return m_buffer[i];
    176176    }
    177177
     
    193193            m_capacity *= 2;
    194194
    195         m_buffer = static_cast<Point *>( 
     195        m_buffer = static_cast<Point *>(
    196196            ::realloc( m_buffer, m_capacity * sizeof( Point ) ) );
    197197    }
  • trunk/BNC/qwt/qwt_clipper.h

    r8127 r9383  
    2626{
    2727public:
    28     static QPolygon clipPolygon( const QRect &, 
     28    static QPolygon clipPolygon( const QRect &,
    2929        const QPolygon &, bool closePolygon = false );
    30     static QPolygon clipPolygon( const QRectF &, 
     30    static QPolygon clipPolygon( const QRectF &,
    3131        const QPolygon &, bool closePolygon = false );
    3232
    33     static QPolygonF clipPolygonF( const QRectF &, 
     33    static QPolygonF clipPolygonF( const QRectF &,
    3434        const QPolygonF &, bool closePolygon = false );
    3535
  • trunk/BNC/qwt/qwt_color_map.cpp

    r8127 r9383  
    4747            a = qAlpha( rgb );
    4848
    49             /* 
    50                 when mapping a value to rgb we will have to calcualate: 
     49            /*
     50                when mapping a value to rgb we will have to calcualate:
    5151                   - const int v = int( ( s1.v0 + ratio * s1.vStep ) + 0.5 );
    5252
     
    346346QColor QwtLinearColorMap::color1() const
    347347{
    348     return QColor( d_data->colorStops.rgb( d_data->mode, 0.0 ) );
     348    return QColor::fromRgba( d_data->colorStops.rgb( d_data->mode, 0.0 ) );
    349349}
    350350
     
    355355QColor QwtLinearColorMap::color2() const
    356356{
    357     return QColor( d_data->colorStops.rgb( d_data->mode, 1.0 ) );
     357    return QColor::fromRgba( d_data->colorStops.rgb( d_data->mode, 1.0 ) );
    358358}
    359359
  • trunk/BNC/qwt/qwt_color_map.h

    r8127 r9383  
    107107
    108108    QwtLinearColorMap( QwtColorMap::Format = QwtColorMap::RGB );
    109     QwtLinearColorMap( const QColor &from, const QColor &to,
     109    QwtLinearColorMap( const QColor &color1, const QColor &color2,
    110110        QwtColorMap::Format = QwtColorMap::RGB );
    111111
     
    185185    {
    186186        const unsigned int index = colorIndex( interval, value );
    187         return colorTable( interval )[index]; // slow
     187
     188        const QVector<QRgb> rgbTable = colorTable( interval );
     189        return rgbTable[index]; // slow
    188190    }
    189191}
  • trunk/BNC/qwt/qwt_column_symbol.cpp

    r8127 r9383  
    115115        style( QwtColumnSymbol::Box ),
    116116        frameStyle( QwtColumnSymbol::Raised ),
     117        palette( Qt::gray ),
    117118        lineWidth( 2 )
    118119    {
    119         palette = QPalette( Qt::gray );
    120120    }
    121121
     
    288288        default:
    289289        {
    290             painter->fillRect( r, d_data->palette.window() );
    291         }
    292     }
    293 }
     290            painter->fillRect( r.adjusted( 0, 0, 1, 1 ), d_data->palette.window() );
     291        }
     292    }
     293}
  • trunk/BNC/qwt/qwt_column_symbol.h

    r8127 r9383  
    137137    virtual ~QwtColumnSymbol();
    138138
    139     void setFrameStyle( FrameStyle style );
     139    void setFrameStyle( FrameStyle );
    140140    FrameStyle frameStyle() const;
    141141
  • trunk/BNC/qwt/qwt_compass.cpp

    r8127 r9383  
    1818#include <qevent.h>
    1919
    20 /*! 
     20/*!
    2121  \brief Constructor
    2222
     
    4949}
    5050
    51 /*! 
     51/*!
    5252  \brief Constructor
    5353
     
    9696  or returns an null text.
    9797
    98   \return Label, or QString::null
     98  \return Label
    9999  \sa labelMap(), setLabelMap()
    100100*/
  • trunk/BNC/qwt/qwt_compass_rose.cpp

    r8127 r9383  
    1212#include "qwt_painter.h"
    1313#include <qpainter.h>
    14 
    15 static QPointF qwtIntersection(
     14#include <qpainterpath.h>
     15
     16static QPointF qwtIntersection(
    1617    QPointF p11, QPointF p12, QPointF p21, QPointF p22 )
    1718{
     
    213214}
    214215
    215 /*! 
     216/*!
    216217  \return Width of the rose
    217218  \sa setWidth()
  • trunk/BNC/qwt/qwt_compass_rose.h

    r8127 r9383  
    4646        \param colorGroup Color group
    4747     */
    48     virtual void draw( QPainter *painter, 
     48    virtual void draw( QPainter *painter,
    4949        const QPointF &center, double radius, double north,
    5050        QPalette::ColorGroup colorGroup = QPalette::Active ) const = 0;
     
    6363    virtual ~QwtSimpleCompassRose();
    6464
    65     void setWidth( double w );
     65    void setWidth( double );
    6666    double width() const;
    6767
    68     void setNumThorns( int count );
     68    void setNumThorns( int );
    6969    int numThorns() const;
    7070
    71     void setNumThornLevels( int count );
     71    void setNumThornLevels( int );
    7272    int numThornLevels() const;
    7373
     
    7979
    8080    static void drawRose( QPainter *, const QPalette &,
    81         const QPointF &center, double radius, double origin, double width,
     81        const QPointF &center, double radius, double north, double width,
    8282        int numThorns, int numThornLevels, double shrinkFactor );
    8383
     
    8787};
    8888
    89 #endif 
     89#endif
  • trunk/BNC/qwt/qwt_counter.cpp

    r8127 r9383  
    5151
    5252/*!
    53   The counter is initialized with a range is set to [0.0, 1.0] with 
     53  The counter is initialized with a range is set to [0.0, 1.0] with
    5454  0.01 as single step size. The value is invalid.
    5555
     
    8383        layout->addWidget( btn );
    8484
    85         connect( btn, SIGNAL( released() ), SLOT( btnReleased() ) );
    86         connect( btn, SIGNAL( clicked() ), SLOT( btnClicked() ) );
     85        connect( btn, SIGNAL(released()), SLOT(btnReleased()) );
     86        connect( btn, SIGNAL(clicked()), SLOT(btnClicked()) );
    8787
    8888        d_data->buttonDown[i] = btn;
     
    9494    layout->addWidget( d_data->valueEdit );
    9595
    96     connect( d_data->valueEdit, SIGNAL( editingFinished() ),
    97          SLOT( textChanged() ) );
     96    connect( d_data->valueEdit, SIGNAL(editingFinished()), SLOT(textChanged()) );
    9897
    9998    layout->setStretchFactor( d_data->valueEdit, 10 );
     
    107106        layout->addWidget( btn );
    108107
    109         connect( btn, SIGNAL( released() ), SLOT( btnReleased() ) );
    110         connect( btn, SIGNAL( clicked() ), SLOT( btnClicked() ) );
     108        connect( btn, SIGNAL(released()), SLOT(btnReleased()) );
     109        connect( btn, SIGNAL(clicked()), SLOT(btnClicked()) );
    111110
    112111        d_data->buttonUp[i] = btn;
     
    131130}
    132131
    133 /*! 
     132/*!
    134133  Set the counter to be in valid/invalid state
    135134
     
    137136  the buttons are disabled.
    138137
    139   \param on If true the counter will be set as valid 
     138  \param on If true the counter will be set as valid
    140139
    141140  \sa setValue(), isValid()
     
    156155        else
    157156        {
    158             d_data->valueEdit->setText( QString::null );
    159         }
    160     }   
    161 }   
    162 
    163 /*! 
     157            d_data->valueEdit->setText( QString() );
     158        }
     159    }
     160}
     161
     162/*!
    164163  \return True, if the value is valid
    165164  \sa setValid(), setValue()
     
    168167{
    169168    return d_data->isValid;
    170 }   
     169}
    171170
    172171/*!
     
    181180}
    182181
    183 /*! 
     182/*!
    184183   \return True, when the line line edit is read only. (default is no)
    185184  \sa setReadOnly()
     
    335334  \brief En/Disable wrapping
    336335
    337   If wrapping is true stepping up from maximum() value will take 
    338   you to the minimum() value and vice versa. 
     336  If wrapping is true stepping up from maximum() value will take
     337  you to the minimum() value and vice versa.
    339338
    340339  \param on En/Disable wrapping
  • trunk/BNC/qwt/qwt_counter.h

    r8127 r9383  
    2525  and a step size. When the wrapping property is set
    2626  the counter is circular.
    27  
    28   The number of steps by which a button increments or decrements the value 
    29   can be specified using setIncSteps(). The number of buttons can be 
     27
     28  The number of steps by which a button increments or decrements the value
     29  can be specified using setIncSteps(). The number of buttons can be
    3030  changed with setNumButtons().
    3131
     
    9292    void setReadOnly( bool );
    9393
    94     void setNumButtons( int n );
     94    void setNumButtons( int );
    9595    int numButtons() const;
    9696
    97     void setIncSteps( QwtCounter::Button btn, int nSteps );
    98     int incSteps( QwtCounter::Button btn ) const;
     97    void setIncSteps( QwtCounter::Button, int numSteps );
     98    int incSteps( QwtCounter::Button ) const;
    9999
    100100    virtual QSize sizeHint() const;
    101101
    102102    double singleStep() const;
    103     void setSingleStep( double s );
     103    void setSingleStep( double stepSize );
    104104
    105105    void setRange( double min, double max );
    106    
     106
    107107    double minimum() const;
    108     void setMinimum( double min );
     108    void setMinimum( double );
    109109
    110110    double maximum() const;
    111     void setMaximum( double max );
     111    void setMaximum( double );
    112112
    113113    void setStepButton1( int nSteps );
  • trunk/BNC/qwt/qwt_curve_fitter.cpp

    r8127 r9383  
    334334
    335335/*!
    336  
    337   \return Maximum for the number of points passed to a run
     336  \return Maximum for the number of points passed to a run
    338337          of the algorithm - or 0, when unlimited
    339338  \sa setChunkSize()
     
    350349QPolygonF QwtWeedingCurveFitter::fitCurve( const QPolygonF &points ) const
    351350{
     351    if ( points.isEmpty() )
     352        return points;
     353
    352354    QPolygonF fittedPoints;
    353 
    354355    if ( d_data->chunkSize == 0 )
    355356    {
  • trunk/BNC/qwt/qwt_curve_fitter.h

    r8127 r9383  
    7878    QwtSpline &spline();
    7979
    80     void setSplineSize( int size );
     80    void setSplineSize( int );
    8181    int splineSize() const;
    8282
  • trunk/BNC/qwt/qwt_date.cpp

    r8127 r9383  
    3232#endif
    3333
    34 static QString qwtExpandedFormat( const QString & format, 
     34static QString qwtExpandedFormat( const QString & format,
    3535    const QDateTime &dateTime, QwtDate::Week0Type week0Type )
    3636{
     
    195195}
    196196
    197 static inline void qwtFloorTime( 
     197static inline void qwtFloorTime(
    198198    QwtDate::IntervalType intervalType, QDateTime &dt )
    199199{
     
    224224            dt.setTime( QTime( t.hour(), 0, 0 ) );
    225225            break;
    226         }   
     226        }
    227227        default:
    228228            break;
     
    233233}
    234234
    235 static inline QDateTime qwtToTimeSpec( 
     235static inline QDateTime qwtToTimeSpec(
    236236    const QDateTime &dt, Qt::TimeSpec spec )
    237237{
     
    255255}
    256256
     257#if 0
     258
    257259static inline double qwtToJulianDay( int year, int month, int day )
    258260{
     
    280282    if ( a < 0 )
    281283        a -= b - 1;
    282        
     284
    283285    return a / b;
    284 }   
     286}
     287
     288#endif
    285289
    286290static inline QDate qwtToDate( int year, int month = 1, int day = 1 )
     
    319323  Translate from double to QDateTime
    320324
    321   \param value Number of milliseconds since the epoch, 
     325  \param value Number of milliseconds since the epoch,
    322326               1970-01-01T00:00:00 UTC
    323327  \param timeSpec Time specification
     
    373377
    374378    const QTime time = dt.time();
    375     const double secs = 3600.0 * time.hour() + 
     379    const double secs = 3600.0 * time.hour() +
    376380        60.0 * time.minute() + time.second();
    377381
     
    383387
    384388  \param dateTime Datetime value
    385   \param intervalType Interval type, how to ceil. 
     389  \param intervalType Interval type, how to ceil.
    386390                      F.e. when intervalType = QwtDate::Months, the result
    387391                      will be ceiled to the next beginning of a month
     
    451455        {
    452456            dt.setTime( QTime( 0, 0 ) );
    453             dt.setDate( qwtToDate( dateTime.date().year(), 
     457            dt.setDate( qwtToDate( dateTime.date().year(),
    454458                dateTime.date().month() ) );
    455459
     
    484488
    485489  \param dateTime Datetime value
    486   \param intervalType Interval type, how to ceil. 
     490  \param intervalType Interval type, how to ceil.
    487491                      F.e. when intervalType = QwtDate::Months,
    488                       the result will be ceiled to the next 
     492                      the result will be ceiled to the next
    489493                      beginning of a month
    490494  \return Floored datetime
    491495  \sa floor()
    492496 */
    493 QDateTime QwtDate::floor( const QDateTime &dateTime, 
     497QDateTime QwtDate::floor( const QDateTime &dateTime,
    494498    IntervalType intervalType )
    495499{
     
    533537            dt.setTime( QTime( 0, 0 ) );
    534538
    535             const QDate date = qwtToDate( dt.date().year(), 
     539            const QDate date = qwtToDate( dt.date().year(),
    536540                dt.date().month() );
    537541            dt.setDate( date );
     
    556560  Minimum for the supported date range
    557561
    558   The range of valid dates depends on how QDate stores the 
     562  The range of valid dates depends on how QDate stores the
    559563  Julian day internally.
    560564
     
    577581  Maximum for the supported date range
    578582
    579   The range of valid dates depends on how QDate stores the 
     583  The range of valid dates depends on how QDate stores the
    580584  Julian day internally.
    581585
     
    600604
    601605  The first day of a week depends on the current locale
    602   ( QLocale::firstDayOfWeek() ). 
     606  ( QLocale::firstDayOfWeek() ).
    603607
    604608  \param year Year
     
    607611
    608612  \sa QLocale::firstDayOfWeek(), weekNumber()
    609  */ 
     613 */
    610614QDate QwtDate::dateOfWeek0( int year, Week0Type type )
    611615{
     
    624628    {
    625629        // according to ISO 8601 the first week is defined
    626         // by the first thursday. 
     630        // by the first thursday.
    627631
    628632        int d = Qt::Thursday - firstDayOfWeek;
     
    641645
    642646  - QwtDate::FirstThursday\n
    643     Corresponding to ISO 8601 ( see QDate::weekNumber() ). 
     647    Corresponding to ISO 8601 ( see QDate::weekNumber() ).
    644648
    645649  - QwtDate::FirstDay\n
     
    737741    week number with a leading zero ( 01 - 53 )
    738742
    739   As week 1 usually starts in the previous year a special rule 
     743  As week 1 usually starts in the previous year a special rule
    740744  is applied for formats, where the year is expected to match the
    741745  week number - even if the date belongs to the previous year.
  • trunk/BNC/qwt/qwt_date.h

    r8127 r9383  
    2323  A double is interpreted as the number of milliseconds since
    2424  1970-01-01T00:00:00 Universal Coordinated Time - also known
    25   as "The Epoch". 
     25  as "The Epoch".
    2626
    27   While the range of the Julian day in Qt4 is limited to [0, MAX_INT], 
    28   Qt5 stores it as qint64 offering a huge range of valid dates. 
    29   As the significance of a double is below this ( assuming a 
    30   fraction of 52 bits ) the translation is not 
    31   bijective with rounding errors for dates very far from Epoch. 
    32   For a resolution of 1 ms those start to happen for dates above the 
    33   year 144683. 
     27  While the range of the Julian day in Qt4 is limited to [0, MAX_INT],
     28  Qt5 stores it as qint64 offering a huge range of valid dates.
     29  As the significance of a double is below this ( assuming a
     30  fraction of 52 bits ) the translation is not
     31  bijective with rounding errors for dates very far from Epoch.
     32  For a resolution of 1 ms those start to happen for dates above the
     33  year 144683.
    3434
    3535  An axis for a date/time interval is expected to be aligned
     
    4343{
    4444public:
    45     /*! 
     45    /*!
    4646       How to identify the first week of year differs between
    47        countries. 
     47       countries.
    4848     */
    4949    enum Week0Type
     
    6060        /*!
    6161            "The week with January 1.1 in it."
    62            
     62
    6363            In the U.S. this definition is more common than
    6464            FirstThursday.
     
    6767    };
    6868
    69     /*! 
     69    /*!
    7070      Classification of an time interval
    7171
     
    109109    static QDate maxDate();
    110110
    111     static QDateTime toDateTime( double value, 
     111    static QDateTime toDateTime( double value,
    112112        Qt::TimeSpec = Qt::UTC );
    113113
     
    122122    static int utcOffset( const QDateTime & );
    123123
    124     static QString toString( const QDateTime &, 
     124    static QString toString( const QDateTime &,
    125125        const QString & format, Week0Type );
    126126};
  • trunk/BNC/qwt/qwt_date_scale_draw.cpp

    r8127 r9383  
    3737  \brief Constructor
    3838
    39   The default setting is to display tick labels for the 
     39  The default setting is to display tick labels for the
    4040  given time specification. The first week of a year is defined like
    4141  for QwtDate::FirstThursday.
     
    110110  \sa week0Type().
    111111  \note week0Type has no effect beside for intervals classified as
    112         QwtDate::Week. 
     112        QwtDate::Week.
    113113 */
    114114void QwtDateScaleDraw::setWeek0Type( QwtDate::Week0Type week0Type )
     
    118118
    119119/*!
    120   \return Setting how to identify the first week of a year. 
     120  \return Setting how to identify the first week of a year.
    121121  \sa setWeek0Type()
    122122 */
     
    134134  \sa dateFormat(), dateFormatOfDate(), QwtDate::toString()
    135135 */
    136 void QwtDateScaleDraw::setDateFormat( 
     136void QwtDateScaleDraw::setDateFormat(
    137137    QwtDate::IntervalType intervalType, const QString &format )
    138138{
    139     if ( intervalType >= QwtDate::Millisecond && 
     139    if ( intervalType >= QwtDate::Millisecond &&
    140140        intervalType <= QwtDate::Year )
    141141    {
     
    149149  \sa setDateFormat(), dateFormatOfDate()
    150150 */
    151 QString QwtDateScaleDraw::dateFormat( 
     151QString QwtDateScaleDraw::dateFormat(
    152152    QwtDate::IntervalType intervalType ) const
    153153{
    154     if ( intervalType >= QwtDate::Millisecond && 
     154    if ( intervalType >= QwtDate::Millisecond &&
    155155        intervalType <= QwtDate::Year )
    156156    {
     
    158158    }
    159159
    160     return QString::null;
     160    return QString();
    161161}
    162162
     
    182182    Q_UNUSED( dateTime )
    183183
    184     if ( intervalType >= QwtDate::Millisecond && 
     184    if ( intervalType >= QwtDate::Millisecond &&
    185185        intervalType <= QwtDate::Year )
    186186    {
     
    205205{
    206206    const QDateTime dt = toDateTime( value );
    207     const QString fmt = dateFormatOfDate( 
     207    const QString fmt = dateFormatOfDate(
    208208        dt, intervalType( scaleDiv() ) );
    209209
     
    220220  \sa dateFormatOfDate()
    221221 */
    222 QwtDate::IntervalType QwtDateScaleDraw::intervalType( 
     222QwtDate::IntervalType QwtDateScaleDraw::intervalType(
    223223    const QwtScaleDiv &scaleDiv ) const
    224224{
     
    233233        for ( int j = QwtDate::Second; j <= intvType; j++ )
    234234        {
    235             const QDateTime dt0 = QwtDate::floor( dt, 
     235            const QDateTime dt0 = QwtDate::floor( dt,
    236236                static_cast<QwtDate::IntervalType>( j ) );
    237237
  • trunk/BNC/qwt/qwt_date_scale_draw.h

    r8127 r9383  
    7373
    7474protected:
    75     virtual QwtDate::IntervalType 
     75    virtual QwtDate::IntervalType
    7676        intervalType( const QwtScaleDiv & ) const;
    7777
  • trunk/BNC/qwt/qwt_date_scale_engine.cpp

    r8127 r9383  
    1414#include <limits.h>
    1515
    16 static inline double qwtMsecsForType( QwtDate::IntervalType type )
     16static inline double qwtMsecsForType( int type )
    1717{
    1818    static const double msecs[] =
     
    4444
    4545static double qwtIntervalWidth( const QDateTime &minDate,
    46     const QDateTime &maxDate, QwtDate::IntervalType intervalType ) 
     46    const QDateTime &maxDate, QwtDate::IntervalType intervalType )
    4747{
    4848    switch( intervalType )
     
    8080        case QwtDate::Month:
    8181        {
    82             const double years = 
     82            const double years =
    8383                double( maxDate.date().year() ) - minDate.date().year();
    8484
     
    9191        case QwtDate::Year:
    9292        {
    93             double years = 
     93            double years =
    9494                double( maxDate.date().year() ) - minDate.date().year();
    9595
     
    104104}
    105105
    106 static double qwtRoundedIntervalWidth( 
    107     const QDateTime &minDate, const QDateTime &maxDate, 
    108     QwtDate::IntervalType intervalType ) 
     106static double qwtRoundedIntervalWidth(
     107    const QDateTime &minDate, const QDateTime &maxDate,
     108    QwtDate::IntervalType intervalType )
    109109{
    110110    const QDateTime minD = QwtDate::floor( minDate, intervalType );
     
    131131}
    132132
    133 static int qwtStepSize( int intervalSize, int maxSteps, uint base ) 
     133static int qwtStepSize( int intervalSize, int maxSteps, uint base )
    134134{
    135135    if ( maxSteps <= 0 )
     
    162162}
    163163
    164 static int qwtDivideInterval( double intervalSize, int numSteps, 
     164static int qwtDivideInterval( double intervalSize, int numSteps,
    165165    const int limits[], size_t numLimits )
    166166{
     
    181181    if ( intervalType != QwtDate::Day )
    182182    {
    183         if ( ( intervalSize > numSteps ) && 
     183        if ( ( intervalSize > numSteps ) &&
    184184            ( intervalSize <= 2 * numSteps ) )
    185185        {
     
    196196        {
    197197            static int limits[] = { 1, 2, 5, 10, 15, 20, 30, 60 };
    198    
     198
    199199            stepSize = qwtDivideInterval( intervalSize, numSteps,
    200200                limits, sizeof( limits ) / sizeof( int ) );
     
    205205        {
    206206            static int limits[] = { 1, 2, 3, 4, 6, 12, 24 };
    207    
     207
    208208            stepSize = qwtDivideInterval( intervalSize, numSteps,
    209209                limits, sizeof( limits ) / sizeof( int ) );
     
    274274            if ( stepSize > maxMinSteps )
    275275            {
    276                 numSteps = qwtStepCount( stepSize, maxMinSteps, 
     276                numSteps = qwtStepCount( stepSize, maxMinSteps,
    277277                    limits, sizeof( limits ) / sizeof( int ) );
    278278
     
    280280            else
    281281            {
    282                 numSteps = qwtStepCount( stepSize * 60, maxMinSteps, 
     282                numSteps = qwtStepCount( stepSize * 60, maxMinSteps,
    283283                    limits, sizeof( limits ) / sizeof( int ) );
    284284            }
     
    359359                else
    360360                {
    361                     minStepSize = QwtScaleArithmetic::divideInterval( 
     361                    minStepSize = QwtScaleArithmetic::divideInterval(
    362362                        stepSizeInWeeks, maxMinSteps, 10 );
    363363                }
     
    401401                    minStepSize = double( stepSize ) / numSteps;
    402402            }
    403                
     403
    404404            break;
    405405        }
     
    445445}
    446446
    447 static QwtScaleDiv qwtDivideToSeconds( 
     447static QwtScaleDiv qwtDivideToSeconds(
    448448    const QDateTime &minDate, const QDateTime &maxDate,
    449449    double stepSize, int maxMinSteps,
    450     QwtDate::IntervalType intervalType ) 
     450    QwtDate::IntervalType intervalType )
    451451{
    452452    // calculate the min step size
    453453    double minStepSize = 0;
    454454
    455     if ( maxMinSteps > 1 ) 
    456     {
    457         minStepSize = qwtDivideMajorStep( stepSize, 
     455    if ( maxMinSteps > 1 )
     456    {
     457        minStepSize = qwtDivideMajorStep( stepSize,
    458458            maxMinSteps, intervalType );
    459459    }
     
    472472    const int secondsMajor = static_cast<int>( stepSize * s );
    473473    const double secondsMinor = minStepSize * s;
    474    
     474
    475475    // UTC excludes daylight savings. So from the difference
    476476    // of a date and its UTC counterpart we can find out
     
    484484    QList<double> minorTicks;
    485485
    486     for ( QDateTime dt = minDate; dt <= maxDate; 
     486    for ( QDateTime dt = minDate; dt <= maxDate;
    487487        dt = dt.addSecs( secondsMajor ) )
    488488    {
     
    501501                // we add some minor ticks for the DST hour,
    502502                // otherwise the ticks will be unaligned: 0, 2, 3, 5 ...
    503                 minorTicks += qwtDstTicks( 
     503                minorTicks += qwtDstTicks(
    504504                    dt, secondsMajor, qRound( secondsMinor ) );
    505505            }
     
    517517            for ( int i = 1; i < numMinorSteps; i++ )
    518518            {
    519                 const QDateTime mt = dt.addMSecs( 
     519                const QDateTime mt = dt.addMSecs(
    520520                    qRound64( i * secondsMinor * 1000 ) );
    521521
     
    529529                if ( minorTicks.isEmpty() || minorTicks.last() != minorValue )
    530530                {
    531                     const bool isMedium = ( numMinorSteps % 2 == 0 ) 
     531                    const bool isMedium = ( numMinorSteps % 2 == 0 )
    532532                        && ( i != 1 ) && ( i == numMinorSteps / 2 );
    533533
     
    553553}
    554554
    555 static QwtScaleDiv qwtDivideToMonths( 
     555static QwtScaleDiv qwtDivideToMonths(
    556556    QDateTime &minDate, const QDateTime &maxDate,
    557     double stepSize, int maxMinSteps ) 
    558 {
    559     // months are intervals with non 
    560     // equidistant ( in ms ) steps: we have to build the 
     557    double stepSize, int maxMinSteps )
     558{
     559    // months are intervals with non
     560    // equidistant ( in ms ) steps: we have to build the
    561561    // scale division manually
    562562
    563563    int minStepDays = 0;
    564     int minStepSize = 0.0; 
     564    int minStepSize = 0.0;
    565565
    566566    if ( maxMinSteps > 1 )
     
    579579        else
    580580        {
    581             minStepSize = qwtDivideMajorStep( 
     581            minStepSize = qwtDivideMajorStep(
    582582                stepSize, maxMinSteps, QwtDate::Month );
    583583        }
     
    588588    QList<double> minorTicks;
    589589
    590     for ( QDateTime dt = minDate; 
     590    for ( QDateTime dt = minDate;
    591591        dt <= maxDate; dt = dt.addMonths( stepSize ) )
    592592    {
     
    598598        if ( minStepDays > 0 )
    599599        {
    600             for ( int days = minStepDays; 
     600            for ( int days = minStepDays;
    601601                days < 30; days += minStepDays )
    602602            {
     
    637637}
    638638
    639 static QwtScaleDiv qwtDivideToYears( 
     639static QwtScaleDiv qwtDivideToYears(
    640640    const QDateTime &minDate, const QDateTime &maxDate,
    641     double stepSize, int maxMinSteps ) 
     641    double stepSize, int maxMinSteps )
    642642{
    643643    QList<double> majorTicks;
     
    649649    if ( maxMinSteps > 1 )
    650650    {
    651         minStepSize = qwtDivideMajorStep( 
     651        minStepSize = qwtDivideMajorStep(
    652652            stepSize, maxMinSteps, QwtDate::Year );
    653653    }
     
    702702            break;
    703703        }
    704     }   
     704    }
    705705
    706706    QwtScaleDiv scaleDiv;
     
    730730    QwtDate::Week0Type week0Type;
    731731    int maxWeeks;
    732 };     
     732};
    733733
    734734
     
    736736  \brief Constructor
    737737
    738   The engine is initialized to build scales for the 
     738  The engine is initialized to build scales for the
    739739  given time specification. It classifies intervals > 4 weeks
    740740  as >= Qt::Month. The first week of a year is defined like
     
    811811  \sa week0Type(), setMaxWeeks()
    812812  \note week0Type has no effect beside for intervals classified as
    813         QwtDate::Week. 
     813        QwtDate::Week.
    814814 */
    815815void QwtDateScaleEngine::setWeek0Type( QwtDate::Week0Type week0Type )
     
    819819
    820820/*!
    821   \return Setting how to identify the first week of a year. 
     821  \return Setting how to identify the first week of a year.
    822822  \sa setWeek0Type(), maxWeeks()
    823823 */
     
    835835  \param weeks Upper limit for the number of weeks
    836836
    837   \note In business charts a year is often devided
     837  \note In business charts a year is often divided
    838838        into weeks [1-52]
    839   \sa maxWeeks(), setWeek0Type() 
     839  \sa maxWeeks(), setWeek0Type()
    840840 */
    841841void QwtDateScaleEngine::setMaxWeeks( int weeks )
     
    863863  \return Interval classification
    864864 */
    865 QwtDate::IntervalType QwtDateScaleEngine::intervalType( 
    866     const QDateTime &minDate, const QDateTime &maxDate, 
     865QwtDate::IntervalType QwtDateScaleEngine::intervalType(
     866    const QDateTime &minDate, const QDateTime &maxDate,
    867867    int maxSteps ) const
    868868{
     
    910910  Align and divide an interval
    911911
    912   The algorithm aligns and divides the interval into steps. 
     912  The algorithm aligns and divides the interval into steps.
    913913
    914914  Datetime interval divisions are usually not equidistant and the
    915915  calculated stepSize can only be used as an approximation
    916   for the steps calculated by divideScale(). 
     916  for the steps calculated by divideScale().
    917917
    918918  \param maxNumSteps Max. number of steps
     
    951951            maxNumSteps = 1;
    952952
    953         const QwtDate::IntervalType intvType = 
     953        const QwtDate::IntervalType intvType =
    954954            intervalType( from, to, maxNumSteps );
    955955
     
    10151015    }
    10161016
    1017     const QwtDate::IntervalType intvType = 
     1017    const QwtDate::IntervalType intvType =
    10181018        intervalType( from, to, maxMajorSteps );
    10191019
     
    10311031        const QDateTime maxDate = QwtDate::ceil( to, intvType );
    10321032
    1033         scaleDiv = buildScaleDiv( minDate, maxDate, 
     1033        scaleDiv = buildScaleDiv( minDate, maxDate,
    10341034            maxMajorSteps, maxMinorSteps, intvType );
    10351035
     
    10461046}
    10471047
    1048 QwtScaleDiv QwtDateScaleEngine::buildScaleDiv( 
     1048QwtScaleDiv QwtDateScaleEngine::buildScaleDiv(
    10491049    const QDateTime &minDate, const QDateTime &maxDate,
    10501050    int maxMajorSteps, int maxMinorSteps,
     
    10521052{
    10531053    // calculate the step size
    1054     const double stepSize = qwtDivideScale( 
    1055         qwtIntervalWidth( minDate, maxDate, intervalType ), 
     1054    const double stepSize = qwtDivideScale(
     1055        qwtIntervalWidth( minDate, maxDate, intervalType ),
    10561056        maxMajorSteps, intervalType );
    10571057
     
    10601060    if ( !dt0.isValid() )
    10611061    {
    1062         // the floored date is out of the range of a 
     1062        // the floored date is out of the range of a
    10631063        // QDateTime - we ceil instead.
    10641064        dt0 = alignDate( minDate, stepSize, intervalType, true );
     
    10691069    if ( intervalType <= QwtDate::Week )
    10701070    {
    1071         scaleDiv = qwtDivideToSeconds( dt0, maxDate, 
     1071        scaleDiv = qwtDivideToSeconds( dt0, maxDate,
    10721072            stepSize, maxMinorSteps, intervalType );
    10731073    }
     
    10941094
    10951095  For Qt::Day alignments there is no "natural day 0" -
    1096   instead the first day of the year is used to avoid jumping 
     1096  instead the first day of the year is used to avoid jumping
    10971097  major ticks positions when panning a scale. For other alignments
    10981098  ( f.e according to the first day of the month ) alignDate()
     
    11061106  \return Aligned date/time value
    11071107 */
    1108 QDateTime QwtDateScaleEngine::alignDate( 
    1109     const QDateTime &dateTime, double stepSize, 
     1108QDateTime QwtDateScaleEngine::alignDate(
     1109    const QDateTime &dateTime, double stepSize,
    11101110    QwtDate::IntervalType intervalType, bool up ) const
    11111111{
     
    11231123        case QwtDate::Millisecond:
    11241124        {
    1125             const int ms = qwtAlignValue( 
     1125            const int ms = qwtAlignValue(
    11261126                dt.time().msec(), stepSize, up ) ;
    11271127
     
    12931293    if ( !dt.isValid() )
    12941294    {
    1295         const QDate date = ( value <= 0.0 ) 
     1295        const QDate date = ( value <= 0.0 )
    12961296            ? QwtDate::minDate() : QwtDate::maxDate();
    12971297
  • trunk/BNC/qwt/qwt_date_scale_engine.h

    r8127 r9383  
    2828  QwtDateScaleEngine supports representations depending
    2929  on Qt::TimeSpec specifications. The valid range for scales
    30   is limited by the range of QDateTime, that differs 
     30  is limited by the range of QDateTime, that differs
    3131  between Qt4 and Qt5.
    32  
     32
    3333  Datetime values are expected as the number of milliseconds since
    3434  1970-01-01T00:00:00 Universal Coordinated Time - also known
    35   as "The Epoch", that can be converted to QDateTime using 
     35  as "The Epoch", that can be converted to QDateTime using
    3636  QwtDate::toDateTime().
    3737
     
    5353    void setWeek0Type( QwtDate::Week0Type );
    5454    QwtDate::Week0Type week0Type() const;
    55    
     55
    5656    void setMaxWeeks( int );
    5757    int maxWeeks() const;
     
    6060        double &x1, double &x2, double &stepSize ) const;
    6161
    62     virtual QwtScaleDiv divideScale( 
     62    virtual QwtScaleDiv divideScale(
    6363        double x1, double x2,
    6464        int maxMajorSteps, int maxMinorSteps,
    6565        double stepSize = 0.0 ) const;
    6666
    67     virtual QwtDate::IntervalType intervalType( 
     67    virtual QwtDate::IntervalType intervalType(
    6868        const QDateTime &, const QDateTime &, int maxSteps ) const;
    6969
     
    7676private:
    7777    QwtScaleDiv buildScaleDiv( const QDateTime &, const QDateTime &,
    78         int maxMajorSteps, int maxMinorSteps, 
     78        int maxMajorSteps, int maxMinorSteps,
    7979        QwtDate::IntervalType ) const;
    8080
  • trunk/BNC/qwt/qwt_dial.cpp

    r8127 r9383  
    238238    const QRect cr = contentsRect();
    239239
    240     const double dim = qMin( cr.width(), cr.height() );
     240    const int dim = qMin( cr.width(), cr.height() );
    241241
    242242    QRect inner( 0, 0, dim, dim );
     
    338338        p.setRenderHint( QPainter::Antialiasing, true );
    339339        p.translate( -r.topLeft() );
    340            
     340
    341341        if ( d_data->mode != QwtDial::RotateScale )
    342342            drawContents( &p );
     
    475475  \param radius Radius of the scale
    476476*/
    477 void QwtDial::drawScale( QPainter *painter, 
     477void QwtDial::drawScale( QPainter *painter,
    478478    const QPointF &center, double radius ) const
    479479{
     
    568568
    569569  The motivation for setting a scale draw is often
    570   to overload QwtRoundScaleDraw::label() to return 
     570  to overload QwtRoundScaleDraw::label() to return
    571571  individual tick labels.
    572  
     572
    573573  \param scaleDraw Scale draw
    574574  \warning The previous scale draw is deleted
     
    601601        maxScaleArc = minScaleArc + 360.0;
    602602
    603     if ( ( minScaleArc != d_data->minScaleArc ) || 
     603    if ( ( minScaleArc != d_data->minScaleArc ) ||
    604604        ( maxScaleArc != d_data->maxScaleArc ) )
    605605    {
     
    612612}
    613613
    614 /*! 
     614/*!
    615615  Set the lower limit for the scale arc
    616616
     
    623623}
    624624
    625 /*! 
     625/*!
    626626  \return Lower limit of the scale arc
    627627  \sa setScaleArc()
     
    632632}
    633633
    634 /*! 
     634/*!
    635635  Set the upper limit for the scale arc
    636636
     
    643643}
    644644
    645 /*! 
     645/*!
    646646  \return Upper limit of the scale arc
    647647  \sa setScaleArc()
     
    691691    const int d = 6 * sh + 2 * lineWidth();
    692692
    693     QSize hint( d, d ); 
     693    QSize hint( d, d );
    694694    if ( !isReadOnly() )
    695695        hint = hint.expandedTo( QApplication::globalStrut() );
     
    718718  \param pos Mouse position
    719719
    720   \retval True, when the inner circle contains pos 
     720  \retval True, when the inner circle contains pos
    721721  \sa scrolledTo()
    722722*/
     
    730730            angle = 360.0 - angle;
    731731
    732         double valueAngle = 
     732        double valueAngle =
    733733            qwtNormalizeDegrees( 90.0 - scaleMap().transform( value() ) );
    734734
     
    775775            if ( qAbs( arc ) > 180.0 )
    776776            {
    777                 boundedAngle = ( arc > 0 ) 
     777                boundedAngle = ( arc > 0 )
    778778                    ? scaleMap().p1() : scaleMap().p2();
    779779            }
     
    821821            break;
    822822    }
    823    
     823
    824824    QwtAbstractSlider::changeEvent( event );
    825825}
     
    847847
    848848/*!
    849   Invalidate the internal caches and call 
     849  Invalidate the internal caches and call
    850850  QwtAbstractSlider::scaleChange()
    851851 */
  • trunk/BNC/qwt/qwt_dial.h

    r8127 r9383  
    104104    Mode mode() const;
    105105
    106     void setScaleArc( double min, double max );
     106    void setScaleArc( double minArc, double maxArc );
    107107
    108     void setMinScaleArc( double min );
     108    void setMinScaleArc( double );
    109109    double minScaleArc() const;
    110110
    111     void setMaxScaleArc( double min );
     111    void setMaxScaleArc( double );
    112112    double maxScaleArc() const;
    113113
     
    137137    virtual void changeEvent( QEvent * );
    138138
    139     virtual void drawFrame( QPainter *p );
     139    virtual void drawFrame( QPainter * );
    140140    virtual void drawContents( QPainter * ) const;
    141141    virtual void drawFocusIndicator( QPainter * ) const;
     
    143143    void invalidateCache();
    144144
    145     virtual void drawScale( QPainter *, 
     145    virtual void drawScale( QPainter *,
    146146        const QPointF &center, double radius ) const;
    147147
    148     virtual void drawScaleContents( QPainter *painter, 
     148    virtual void drawScaleContents( QPainter *painter,
    149149        const QPointF &center, double radius ) const;
    150150
  • trunk/BNC/qwt/qwt_dial_needle.cpp

    r8127 r9383  
    1414#include <qapplication.h>
    1515#include <qpainter.h>
     16#include <qpainterpath.h>
    1617
    1718#if QT_VERSION < 0x040601
     
    6768}
    6869
    69 static void qwtDrawShadedPointer( QPainter *painter, 
     70static void qwtDrawShadedPointer( QPainter *painter,
    7071    const QColor &lightColor, const QColor &darkColor,
    7172    double length, double width )
     
    171172
    172173    QColor color[4];
    173     color[0] = darkColor.light( 100 + colorOffset );
    174     color[1] = darkColor.dark( 100 + colorOffset );
    175     color[2] = lightColor.light( 100 + colorOffset );
    176     color[3] = lightColor.dark( 100 + colorOffset );
     174    color[0] = darkColor.lighter( 100 + colorOffset );
     175    color[1] = darkColor.darker( 100 + colorOffset );
     176    color[2] = lightColor.lighter( 100 + colorOffset );
     177    color[3] = lightColor.darker( 100 + colorOffset );
    177178
    178179    painter->setPen( Qt::NoPen );
     
    223224  \param colorGroup Color group, used for painting
    224225*/
    225 void QwtDialNeedle::draw( QPainter *painter, 
    226     const QPointF &center, double length, double direction, 
     226void QwtDialNeedle::draw( QPainter *painter,
     227    const QPointF &center, double length, double direction,
    227228    QPalette::ColorGroup colorGroup ) const
    228229{
     
    316317 \param colorGroup Color group, used for painting
    317318*/
    318 void QwtDialSimpleNeedle::drawNeedle( QPainter *painter, 
     319void QwtDialSimpleNeedle::drawNeedle( QPainter *painter,
    319320    double length, QPalette::ColorGroup colorGroup ) const
    320321{
     
    327328            width = qMax(length * 0.06, 6.0);
    328329
    329         qwtDrawArrowNeedle( painter, 
     330        qwtDrawArrowNeedle( painter,
    330331            palette(), colorGroup, length, width );
    331332
     
    336337        if ( width <= 0.0 )
    337338            width = 5.0;
    338        
     339
    339340        QPen pen ( palette().brush( colorGroup, QPalette::Mid ), width );
    340341        pen.setCapStyle( Qt::FlatCap );
    341    
     342
    342343        painter->setPen( pen );
    343344        painter->drawLine( QPointF( 0.0, 0.0 ), QPointF( length, 0.0 ) );
     
    373374    \param colorGroup Color group, used for painting
    374375*/
    375 void QwtCompassMagnetNeedle::drawNeedle( QPainter *painter, 
     376void QwtCompassMagnetNeedle::drawNeedle( QPainter *painter,
    376377    double length, QPalette::ColorGroup colorGroup ) const
    377378{
     
    386387
    387388        qwtDrawShadedPointer( painter,
    388             dark.light( 100 + colorOffset ),
    389             dark.dark( 100 + colorOffset ),
     389            dark.lighter( 100 + colorOffset ),
     390            dark.darker( 100 + colorOffset ),
    390391            length, width );
    391        
     392
    392393        painter->rotate( 180.0 );
    393    
     394
    394395        qwtDrawShadedPointer( painter,
    395             light.light( 100 + colorOffset ),
    396             light.dark( 100 + colorOffset ),
     396            light.lighter( 100 + colorOffset ),
     397            light.darker( 100 + colorOffset ),
    397398            length, width );
    398        
     399
    399400        const QBrush baseBrush = palette().brush( colorGroup, QPalette::Base );
    400401        drawKnob( painter, width, baseBrush, true );
     
    431432 \param colorGroup Color group, used for painting
    432433*/
    433 void QwtCompassWindArrow::drawNeedle( QPainter *painter, 
     434void QwtCompassWindArrow::drawNeedle( QPainter *painter,
    434435    double length, QPalette::ColorGroup colorGroup ) const
    435436{
  • trunk/BNC/qwt/qwt_dial_needle.h

    r8127 r9383  
    3636
    3737    virtual void draw( QPainter *painter, const QPointF &center,
    38         double length, double direction, 
     38        double length, double direction,
    3939        QPalette::ColorGroup = QPalette::Active ) const;
    4040
     
    4444
    4545      The origin of the needle is at position (0.0, 0.0 )
    46       pointing in direction 0.0 ( = east ). 
     46      pointing in direction 0.0 ( = east ).
    4747
    48       The painter is already initialized with translation and 
     48      The painter is already initialized with translation and
    4949      rotation.
    5050
     
    5555      \sa setPalette(), palette()
    5656    */
    57     virtual void drawNeedle( QPainter *painter, 
     57    virtual void drawNeedle( QPainter *painter,
    5858        double length, QPalette::ColorGroup colorGroup ) const = 0;
    5959
    60     virtual void drawKnob( QPainter *, double width, 
     60    virtual void drawKnob( QPainter *, double width,
    6161        const QBrush &, bool sunken ) const;
    6262
     
    133133        TriangleStyle,
    134134
    135         //! A thin needle 
     135        //! A thin needle
    136136        ThinStyle
    137137    };
     
    141141
    142142protected:
    143     virtual void drawNeedle( QPainter *, 
     143    virtual void drawNeedle( QPainter *,
    144144        double length, QPalette::ColorGroup ) const;
    145145
     
    178178
    179179protected:
    180     virtual void drawNeedle( QPainter *, 
     180    virtual void drawNeedle( QPainter *,
    181181        double length, QPalette::ColorGroup ) const;
    182182
     
    185185};
    186186
    187 #endif 
     187#endif
  • trunk/BNC/qwt/qwt_dyngrid_layout.cpp

    r8127 r9383  
    126126}
    127127
    128 /*! 
     128/*!
    129129  \brief Add an item to the next free position.
    130130  \param item Layout item
     
    248248
    249249/*!
    250   \brief Calculate the number of columns for a given width. 
    251 
    252   The calculation tries to use as many columns as possible 
     250  \brief Calculate the number of columns for a given width.
     251
     252  The calculation tries to use as many columns as possible
    253253  ( limited by maxColumns() )
    254254
     
    264264
    265265    uint maxColumns = itemCount();
    266     if ( d_data->maxColumns > 0 ) 
     266    if ( d_data->maxColumns > 0 )
    267267        maxColumns = qMin( d_data->maxColumns, maxColumns );
    268268
  • trunk/BNC/qwt/qwt_dyngrid_layout.h

    r8127 r9383  
    2929    Q_OBJECT
    3030public:
    31     explicit QwtDynGridLayout( QWidget *, int margin = 0, int space = -1 );
    32     explicit QwtDynGridLayout( int space = -1 );
     31    explicit QwtDynGridLayout( QWidget *, int margin = 0, int spacing = -1 );
     32    explicit QwtDynGridLayout( int spacing = -1 );
    3333
    3434    virtual ~QwtDynGridLayout();
     
    3636    virtual void invalidate();
    3737
    38     void setMaxColumns( uint maxCols );
     38    void setMaxColumns( uint maxColumns );
    3939    uint maxColumns() const;
    4040
     
    5050    void setExpandingDirections( Qt::Orientations );
    5151    virtual Qt::Orientations expandingDirections() const;
    52     QList<QRect> layoutItems( const QRect &, uint numCols ) const;
     52    QList<QRect> layoutItems( const QRect &, uint numColumns ) const;
    5353
    5454    virtual int maxItemWidth() const;
     
    6868protected:
    6969
    70     void layoutGrid( uint numCols,
     70    void layoutGrid( uint numColumns,
    7171        QVector<int>& rowHeight, QVector<int>& colWidth ) const;
    72     void stretchGrid( const QRect &rect, uint numCols,
     72    void stretchGrid( const QRect &rect, uint numColumns,
    7373        QVector<int>& rowHeight, QVector<int>& colWidth ) const;
    7474
    7575private:
    7676    void init();
    77     int maxRowWidth( int numCols ) const;
     77    int maxRowWidth( int numColumns ) const;
    7878
    7979    class PrivateData;
  • trunk/BNC/qwt/qwt_event_pattern.cpp

    r8127 r9383  
    106106  \sa QMouseEvent
    107107*/
    108 void QwtEventPattern::setMousePattern( MousePatternCode pattern, 
     108void QwtEventPattern::setMousePattern( MousePatternCode pattern,
    109109    Qt::MouseButton button, Qt::KeyboardModifiers modifiers )
    110110{
     
    125125  \sa QKeyEvent
    126126*/
    127 void QwtEventPattern::setKeyPattern( KeyPatternCode pattern, 
     127void QwtEventPattern::setKeyPattern( KeyPatternCode pattern,
    128128    int key, Qt::KeyboardModifiers modifiers )
    129129{
     
    186186  \sa keyMatch()
    187187*/
    188 bool QwtEventPattern::mouseMatch( MousePatternCode code, 
     188bool QwtEventPattern::mouseMatch( MousePatternCode code,
    189189    const QMouseEvent *event ) const
    190190{
     
    232232  \sa mouseMatch()
    233233*/
    234 bool QwtEventPattern::keyMatch( KeyPatternCode code, 
     234bool QwtEventPattern::keyMatch( KeyPatternCode code,
    235235    const QKeyEvent *event ) const
    236236{
  • trunk/BNC/qwt/qwt_event_pattern.h

    r8127 r9383  
    4444    enum MousePatternCode
    4545    {
    46         /*! 
    47           The default setting for 1, 2 and 3 button mice is:
    48 
    49           - Qt::LeftButton 
    50           - Qt::LeftButton 
    51           - Qt::LeftButton 
     46        /*!
     47          The default setting for 1, 2 and 3 button mice is:
     48
     49          - Qt::LeftButton
     50          - Qt::LeftButton
     51          - Qt::LeftButton
    5252         */
    5353        MouseSelect1,
     
    150150    public:
    151151        //! Constructor
    152         MousePattern( Qt::MouseButton btn = Qt::NoButton, 
     152        MousePattern( Qt::MouseButton btn = Qt::NoButton,
    153153                Qt::KeyboardModifiers modifierCodes = Qt::NoModifier ):
    154154            button( btn ),
     
    157157        }
    158158
    159         //! Button 
     159        //! Button
    160160        Qt::MouseButton button;
    161161
     
    169169    public:
    170170        //! Constructor
    171         KeyPattern( int keyCode = Qt::Key_unknown, 
     171        KeyPattern( int keyCode = Qt::Key_unknown,
    172172                Qt::KeyboardModifiers modifierCodes = Qt::NoModifier ):
    173173            key( keyCode ),
     
    189189    void initKeyPattern();
    190190
    191     void setMousePattern( MousePatternCode, Qt::MouseButton button, 
     191    void setMousePattern( MousePatternCode, Qt::MouseButton button,
    192192        Qt::KeyboardModifiers = Qt::NoModifier );
    193193
    194     void setKeyPattern( KeyPatternCode, int keyCode,
    195         Qt::KeyboardModifiers modifierCodes = Qt::NoModifier );
     194    void setKeyPattern( KeyPatternCode, int key,
     195        Qt::KeyboardModifiers modifiers = Qt::NoModifier );
    196196
    197197    void setMousePattern( const QVector<MousePattern> & );
  • trunk/BNC/qwt/qwt_global.h

    r8127 r9383  
    1515// QWT_VERSION is (major << 16) + (minor << 8) + patch.
    1616
    17 #define QWT_VERSION       0x060104
    18 #define QWT_VERSION_STR   "6.1.4"
     17#define QWT_VERSION       0x060106
     18#define QWT_VERSION_STR   "6.1.6"
    1919
    2020#if defined(_MSC_VER) /* MSVC Compiler */
     
    2727#ifdef QWT_DLL
    2828
    29 #if defined(QWT_MAKEDLL)     // create a Qwt DLL library 
     29#if defined(QWT_MAKEDLL)     // create a Qwt DLL library
    3030#define QWT_EXPORT Q_DECL_EXPORT
    3131#else                        // use a Qwt DLL library
    32 #define QWT_EXPORT Q_DECL_IMPORT 
     32#define QWT_EXPORT Q_DECL_IMPORT
    3333#endif
    3434
     
    3939#endif
    4040
    41 #endif 
     41#endif
  • trunk/BNC/qwt/qwt_graphic.cpp

    r8127 r9383  
    3838}
    3939
    40 static QRectF qwtStrokedPathRect( 
     40static QRectF qwtStrokedPathRect(
    4141    const QPainter *painter, const QPainterPath &path )
    4242{
     
    6464}
    6565
    66 static inline void qwtExecCommand( 
    67     QPainter *painter, const QwtPainterCommand &cmd, 
     66static inline void qwtExecCommand(
     67    QPainter *painter, const QwtPainterCommand &cmd,
    6868    QwtGraphic::RenderHints renderHints,
    6969    const QTransform &transform,
     
    122122        {
    123123            const QwtPainterCommand::ImageData *data = cmd.imageData();
    124             painter->drawImage( data->rect, data->image, 
     124            painter->drawImage( data->rect, data->image,
    125125                data->subRect, data->flags );
    126126            break;
     
    130130            const QwtPainterCommand::StateData *data = cmd.stateData();
    131131
    132             if ( data->flags & QPaintEngine::DirtyPen ) 
     132            if ( data->flags & QPaintEngine::DirtyPen )
    133133                painter->setPen( data->pen );
    134134
    135             if ( data->flags & QPaintEngine::DirtyBrush ) 
     135            if ( data->flags & QPaintEngine::DirtyBrush )
    136136                painter->setBrush( data->brush );
    137137
    138             if ( data->flags & QPaintEngine::DirtyBrushOrigin ) 
     138            if ( data->flags & QPaintEngine::DirtyBrushOrigin )
    139139                painter->setBrushOrigin( data->brushOrigin );
    140140
    141             if ( data->flags & QPaintEngine::DirtyFont ) 
     141            if ( data->flags & QPaintEngine::DirtyFont )
    142142                painter->setFont( data->font );
    143143
    144             if ( data->flags & QPaintEngine::DirtyBackground ) 
     144            if ( data->flags & QPaintEngine::DirtyBackground )
    145145            {
    146146                painter->setBackgroundMode( data->backgroundMode );
     
    148148            }
    149149
    150             if ( data->flags & QPaintEngine::DirtyTransform ) 
     150            if ( data->flags & QPaintEngine::DirtyTransform )
    151151            {
    152152                painter->setTransform( data->transform * transform );
    153153            }
    154154
    155             if ( data->flags & QPaintEngine::DirtyClipEnabled ) 
     155            if ( data->flags & QPaintEngine::DirtyClipEnabled )
    156156                painter->setClipping( data->isClipEnabled );
    157157
    158             if ( data->flags & QPaintEngine::DirtyClipRegion) 
     158            if ( data->flags & QPaintEngine::DirtyClipRegion)
    159159            {
    160                 painter->setClipRegion( data->clipRegion, 
     160                painter->setClipRegion( data->clipRegion,
    161161                    data->clipOperation );
    162162            }
    163163
    164             if ( data->flags & QPaintEngine::DirtyClipPath ) 
     164            if ( data->flags & QPaintEngine::DirtyClipPath )
    165165            {
    166166                painter->setClipPath( data->clipPath, data->clipOperation );
    167167            }
    168168
    169             if ( data->flags & QPaintEngine::DirtyHints) 
     169            if ( data->flags & QPaintEngine::DirtyHints)
    170170            {
    171171                const QPainter::RenderHints hints = data->renderHints;
     
    187187            }
    188188
    189             if ( data->flags & QPaintEngine::DirtyCompositionMode) 
     189            if ( data->flags & QPaintEngine::DirtyCompositionMode)
    190190                painter->setCompositionMode( data->compositionMode );
    191191
    192             if ( data->flags & QPaintEngine::DirtyOpacity) 
     192            if ( data->flags & QPaintEngine::DirtyOpacity)
    193193                painter->setOpacity( data->opacity );
    194194
     
    210210    }
    211211
    212     PathInfo( const QRectF &pointRect, 
     212    PathInfo( const QRectF &pointRect,
    213213            const QRectF &boundingRect, bool scalablePen ):
    214214        d_pointRect( pointRect ),
     
    247247    }
    248248
    249     inline double scaleFactorX( const QRectF& pathRect, 
     249    inline double scaleFactorX( const QRectF& pathRect,
    250250        const QRectF &targetRect, bool scalePens ) const
    251251    {
     
    258258        const double r = qAbs( pathRect.right() - p0.x() );
    259259
    260         const double w = 2.0 * qMin( l, r ) 
     260        const double w = 2.0 * qMin( l, r )
    261261            * targetRect.width() / pathRect.width();
    262262
     
    268268        else
    269269        {
    270             const double pw = qMax( 
     270            const double pw = qMax(
    271271                qAbs( d_boundingRect.left() - d_pointRect.left() ),
    272272                qAbs( d_boundingRect.right() - d_pointRect.right() ) );
     
    278278    }
    279279
    280     inline double scaleFactorY( const QRectF& pathRect, 
     280    inline double scaleFactorY( const QRectF& pathRect,
    281281        const QRectF &targetRect, bool scalePens ) const
    282282    {
     
    289289        const double b = qAbs( pathRect.bottom() - p0.y() );
    290290
    291         const double h = 2.0 * qMin( t, b ) 
     291        const double h = 2.0 * qMin( t, b )
    292292            * targetRect.height() / pathRect.height();
    293293
     
    299299        else
    300300        {
    301             const double pw = 
     301            const double pw =
    302302                qMax( qAbs( d_boundingRect.top() - d_pointRect.top() ),
    303303                qAbs( d_boundingRect.bottom() - d_pointRect.bottom() ) );
     
    352352  \brief Copy constructor
    353353
    354   \param other Source 
     354  \param other Source
    355355  \sa operator=()
    356356 */
     
    371371  \brief Assignment operator
    372372
    373   \param other Source 
     373  \param other Source
    374374  \return A reference of this object
    375375 */
     
    383383
    384384/*!
    385   \brief Clear all stored commands 
     385  \brief Clear all stored commands
    386386  \sa isNull()
    387387 */
    388 void QwtGraphic::reset() 
     388void QwtGraphic::reset()
    389389{
    390390    d_data->commands.clear();
     
    460460
    461461/*!
    462   The control point rectangle is the bounding rectangle 
     462  The control point rectangle is the bounding rectangle
    463463  of all control points of the paths and the target
    464464  rectangles of the images/pixmaps.
     
    478478  \brief Calculate the target rectangle for scaling the graphic
    479479
    480   \param sx Horizontal scaling factor 
    481   \param sy Vertical scaling factor 
    482 
    483   \note In case of paths that are painted with a cosmetic pen 
     480  \param sx Horizontal scaling factor
     481  \param sy Vertical scaling factor
     482
     483  \note In case of paths that are painted with a cosmetic pen
    484484        ( see QPen::isCosmetic() ) the target rectangle is different to
    485485        multiplying the bounding rectangle.
     
    500500    for ( int i = 0; i < d_data->pathInfos.size(); i++ )
    501501    {
    502         rect |= d_data->pathInfos[i].scaledBoundingRect( sx, sy, 
     502        rect |= d_data->pathInfos[i].scaledBoundingRect( sx, sy,
    503503            !d_data->renderHints.testFlag( RenderPensUnscaled ) );
    504504    }
     
    519519  The default size is used in all methods rendering the graphic,
    520520  where no size is explicitly specified. Assigning an empty size
    521   means, that the default size will be calculated from the bounding 
     521  means, that the default size will be calculated from the bounding
    522522  rectangle.
    523523
    524524  The default setting is an empty size.
    525    
     525
    526526  \param size Default size
    527527
     
    544544
    545545  The default size is used in all methods rendering the graphic,
    546   where no size is explicitly specified. 
     546  where no size is explicitly specified.
    547547
    548548  \return Default size
     
    575575    for ( int i = 0; i < numCommands; i++ )
    576576    {
    577         qwtExecCommand( painter, commands[i], 
     577        qwtExecCommand( painter, commands[i],
    578578            d_data->renderHints, transform, d_data->initialTransform );
    579579    }
     
    592592  \param aspectRatioMode Mode how to scale - See Qt::AspectRatioMode
    593593 */
    594 void QwtGraphic::render( QPainter *painter, const QSizeF &size, 
     594void QwtGraphic::render( QPainter *painter, const QSizeF &size,
    595595    Qt::AspectRatioMode aspectRatioMode ) const
    596596{
     
    608608  \param aspectRatioMode Mode how to scale - See Qt::AspectRatioMode
    609609 */
    610 void QwtGraphic::render( QPainter *painter, const QRectF &rect, 
     610void QwtGraphic::render( QPainter *painter, const QRectF &rect,
    611611    Qt::AspectRatioMode aspectRatioMode ) const
    612612{
     
    614614        return;
    615615
    616     double sx = 1.0; 
     616    double sx = 1.0;
    617617    double sy = 1.0;
    618618
     
    623623        sy = rect.height() / d_data->pointRect.height();
    624624
    625     const bool scalePens = 
     625    const bool scalePens =
    626626        !d_data->renderHints.testFlag( RenderPensUnscaled );
    627627
     
    630630        const PathInfo info = d_data->pathInfos[i];
    631631
    632         const double ssx = info.scaleFactorX( 
     632        const double ssx = info.scaleFactorX(
    633633            d_data->pointRect, rect, scalePens );
    634634
     
    636636            sx = qMin( sx, ssx );
    637637
    638         const double ssy = info.scaleFactorY( 
     638        const double ssy = info.scaleFactorY(
    639639            d_data->pointRect, rect, scalePens );
    640640
     
    666666    {
    667667        // we don't want to scale pens according to sx/sy,
    668         // but we want to apply the scaling from the 
     668        // but we want to apply the scaling from the
    669669        // painter transformation later
    670670
     
    690690  \param painter Qt painter
    691691  \param pos Reference point, where to render
    692   \param alignment Flags how to align the target rectangle 
     692  \param alignment Flags how to align the target rectangle
    693693                   to pos.
    694694 */
    695 void QwtGraphic::render( QPainter *painter, 
     695void QwtGraphic::render( QPainter *painter,
    696696    const QPointF &pos, Qt::Alignment alignment ) const
    697697{
     
    729729/*!
    730730  \brief Convert the graphic to a QPixmap
    731    
     731
    732732  All pixels of the pixmap get initialized by Qt::transparent
    733733  before the graphic is scaled and rendered on it.
    734    
     734
    735735  The size of the pixmap is the default size ( ceiled to integers )
    736736  of the graphic.
     
    738738  \return The graphic as pixmap in default size
    739739  \sa defaultSize(), toImage(), render()
    740  */ 
     740 */
    741741QPixmap QwtGraphic::toPixmap() const
    742742{
     
    819819/*!
    820820  \brief Convert the graphic to a QImage
    821    
     821
    822822  All pixels of the image get initialized by 0 ( transparent )
    823823  before the graphic is scaled and rendered on it.
     
    827827  The size of the image is the default size ( ceiled to integers )
    828828  of the graphic.
    829    
     829
    830830  \return The graphic as image in default size
    831831  \sa defaultSize(), toPixmap(), render()
     
    874874        QRectF boundingRect = pointRect;
    875875
    876         if ( painter->pen().style() != Qt::NoPen 
     876        if ( painter->pen().style() != Qt::NoPen
    877877            && painter->pen().brush().style() != Qt::NoBrush )
    878878        {
     
    883883        updateBoundingRect( boundingRect );
    884884
    885         d_data->pathInfos += PathInfo( pointRect, 
     885        d_data->pathInfos += PathInfo( pointRect,
    886886            boundingRect, qwtHasScalablePen( painter ) );
    887887    }
     
    897897  \sa QPaintEngine::drawPixmap()
    898898*/
    899 void QwtGraphic::drawPixmap( const QRectF &rect, 
     899void QwtGraphic::drawPixmap( const QRectF &rect,
    900900    const QPixmap &pixmap, const QRectF &subRect )
    901901{
     
    997997        return;
    998998
    999     // to calculate a proper bounding rectangle we don't simply copy 
    1000     // the commands. 
     999    // to calculate a proper bounding rectangle we don't simply copy
     1000    // the commands.
    10011001
    10021002    const QwtPainterCommand *cmds = commands.constData();
  • trunk/BNC/qwt/qwt_graphic.h

    r8127 r9383  
    3737    - QSvgRenderer/QSvgGenerator\n
    3838      Unfortunately QSvgRenderer hides to much information about
    39       its nodes in internal APIs, that are necessary for proper 
    40       layout calculations. Also it is derived from QObject and 
     39      its nodes in internal APIs, that are necessary for proper
     40      layout calculations. Also it is derived from QObject and
    4141      can't be copied like QImage/QPixmap.
    4242
    4343    QwtGraphic maps all scalable drawing primitives to a QPainterPath
    44     and stores them together with the painter state changes 
    45     ( pen, brush, transformation ... ) in a list of QwtPaintCommands. 
    46     For being a complete QPaintDevice it also stores pixmaps or images, 
    47     what is somehow against the idea of the class, because these objects 
     44    and stores them together with the painter state changes
     45    ( pen, brush, transformation ... ) in a list of QwtPaintCommands.
     46    For being a complete QPaintDevice it also stores pixmaps or images,
     47    what is somehow against the idea of the class, because these objects
    4848    can't be scaled without a loss in quality.
    4949
    5050    The main issue about scaling a QwtGraphic object are the pens used for
    51     drawing the outlines of the painter paths. While non cosmetic pens 
    52     ( QPen::isCosmetic() ) are scaled with the same ratio as the path, 
    53     cosmetic pens have a fixed width. A graphic might have paths with 
     51    drawing the outlines of the painter paths. While non cosmetic pens
     52    ( QPen::isCosmetic() ) are scaled with the same ratio as the path,
     53    cosmetic pens have a fixed width. A graphic might have paths with
    5454    different pens - cosmetic and non-cosmetic.
    5555
     
    5858    - control point rectangle\n
    5959      The control point rectangle is the bounding rectangle of all
    60       control point rectangles of the painter paths, or the target 
     60      control point rectangles of the painter paths, or the target
    6161      rectangle of the pixmaps/images.
    6262
     
    6565      what is needed for rendering the outline with an unscaled pen.
    6666
    67     Because the offset for drawing the outline depends on the shape 
    68     of the painter path ( the peak of a triangle is different than the flat side ) 
    69     scaling with a fixed aspect ratio always needs to be calculated from the 
     67    Because the offset for drawing the outline depends on the shape
     68    of the painter path ( the peak of a triangle is different than the flat side )
     69    scaling with a fixed aspect ratio always needs to be calculated from the
    7070    control point rectangle.
    7171
     
    7575{
    7676public:
    77     /*! 
     77    /*!
    7878        Hint how to render a graphic
    7979        \sa setRenderHint(), testRenderHint()
     
    8282    {
    8383        /*!
    84            When rendering a QwtGraphic a specific scaling between 
     84           When rendering a QwtGraphic a specific scaling between
    8585           the controlPointRect() and the coordinates of the target rectangle
    8686           is set up internally in render().
     
    9696    };
    9797
    98     /*! 
     98    /*!
    9999        \brief Render hints
    100100
     
    117117    void render( QPainter * ) const;
    118118
    119     void render( QPainter *, const QSizeF &, 
     119    void render( QPainter *, const QSizeF &,
    120120            Qt::AspectRatioMode = Qt::IgnoreAspectRatio  ) const;
    121121
    122     void render( QPainter *, const QRectF &, 
     122    void render( QPainter *, const QRectF &,
    123123            Qt::AspectRatioMode = Qt::IgnoreAspectRatio  ) const;
    124124
     
    126126        Qt::Alignment = Qt::AlignTop | Qt::AlignLeft ) const;
    127127
    128     QPixmap toPixmap() const; 
    129     QPixmap toPixmap( const QSize &, 
     128    QPixmap toPixmap() const;
     129    QPixmap toPixmap( const QSize &,
    130130        Qt::AspectRatioMode = Qt::IgnoreAspectRatio  ) const;
    131131
    132     QImage toImage() const; 
    133     QImage toImage( const QSize &, 
     132    QImage toImage() const;
     133    QImage toImage( const QSize &,
    134134        Qt::AspectRatioMode = Qt::IgnoreAspectRatio  ) const;
    135135
     
    144144    void setDefaultSize( const QSizeF & );
    145145    QSizeF defaultSize() const;
    146    
     146
    147147    void setRenderHint( RenderHint, bool on = true );
    148148    bool testRenderHint( RenderHint ) const;
  • trunk/BNC/qwt/qwt_interval.cpp

    r8127 r9383  
    131131}
    132132
    133 /*! 
     133/*!
    134134  \brief Intersect 2 intervals
    135  
     135
    136136  \param other Interval to be intersect with
    137137  \return Intersection
     
    198198}
    199199
    200 /*! 
     200/*!
    201201  \brief Unite this interval with the given interval.
    202202
     
    210210}
    211211
    212 /*! 
     212/*!
    213213  \brief Intersect this interval with the given interval.
    214214
  • trunk/BNC/qwt/qwt_interval.h

    r8127 r9383  
    2828public:
    2929    /*!
    30       Flag indicating if a border is included or excluded 
     30      Flag indicating if a border is included or excluded
    3131      \sa setBorderFlags(), borderFlags()
    3232    */
     
    5858    QwtInterval normalized() const;
    5959    QwtInterval inverted() const;
    60     QwtInterval limited( double minValue, double maxValue ) const;
     60    QwtInterval limited( double lowerBound, double upperBound ) const;
    6161
    6262    bool operator==( const QwtInterval & ) const;
     
    232232/*!
    233233   \brief Intersection of two intervals
    234  
     234
    235235   \param other Interval to intersect with
    236236   \return Intersection of this and other
     
    258258}
    259259
    260 /*! 
     260/*!
    261261   \brief Compare two intervals
    262262
     
    270270           ( d_borderFlags == other.d_borderFlags );
    271271}
    272 /*! 
     272/*!
    273273   \brief Compare two intervals
    274274
  • trunk/BNC/qwt/qwt_interval_symbol.cpp

    r8127 r9383  
    6969
    7070//! \brief Assignment operator
    71 QwtIntervalSymbol &QwtIntervalSymbol::operator=( 
     71QwtIntervalSymbol &QwtIntervalSymbol::operator=(
    7272    const QwtIntervalSymbol &other )
    7373{
     
    7777
    7878//! \brief Compare two symbols
    79 bool QwtIntervalSymbol::operator==( 
     79bool QwtIntervalSymbol::operator==(
    8080    const QwtIntervalSymbol &other ) const
    8181{
     
    8484
    8585//! \brief Compare two symbols
    86 bool QwtIntervalSymbol::operator!=( 
     86bool QwtIntervalSymbol::operator!=(
    8787    const QwtIntervalSymbol &other ) const
    8888{
     
    153153}
    154154
    155 /*! 
     155/*!
    156156  Build and assign a pen
    157    
     157
    158158  In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it
    159159  non cosmetic ( see QPen::isCosmetic() ). This method has been introduced
     
    163163  \param width Pen width
    164164  \param style Pen style
    165    
     165
    166166  \sa pen(), brush()
    167  */ 
    168 void QwtIntervalSymbol::setPen( const QColor &color, 
     167 */
     168void QwtIntervalSymbol::setPen( const QColor &color,
    169169    qreal width, Qt::PenStyle style )
    170 {   
     170{
    171171    setPen( QPen( color, width, style ) );
    172172}
     
    222222            if ( d_data->width > pw )
    223223            {
    224                 if ( ( orientation == Qt::Horizontal ) 
     224                if ( ( orientation == Qt::Horizontal )
    225225                    && ( p1.y() == p2.y() ) )
    226226                {
     
    233233                        p2.x(), y, p2.x(), y + sw );
    234234                }
    235                 else if ( ( orientation == Qt::Vertical ) 
     235                else if ( ( orientation == Qt::Vertical )
    236236                    && ( p1.x() == p2.x() ) )
    237237                {
     
    274274            else
    275275            {
    276                 if ( ( orientation == Qt::Horizontal ) 
     276                if ( ( orientation == Qt::Horizontal )
    277277                    && ( p1.y() == p2.y() ) )
    278278                {
  • trunk/BNC/qwt/qwt_interval_symbol.h

    r8127 r9383  
    6666    int width() const;
    6767
    68     void setBrush( const QBrush& b );
     68    void setBrush( const QBrush & );
    6969    const QBrush& brush() const;
    7070
     
    8080
    8181private:
    82 
    8382    class PrivateData;
    8483    PrivateData* d_data;
  • trunk/BNC/qwt/qwt_knob.cpp

    r8127 r9383  
    120120    setValue( 0.0 );
    121121
    122     setSizePolicy( QSizePolicy::MinimumExpanding, 
     122    setSizePolicy( QSizePolicy::MinimumExpanding,
    123123        QSizePolicy::MinimumExpanding );
    124124}
     
    131131
    132132/*!
    133   \brief Set the knob type 
     133  \brief Set the knob type
    134134
    135135  \param knobStyle Knob type
     
    186186  have to be set using setNumTurns().
    187187
    188   The default angle is 270 degrees. 
     188  The default angle is 270 degrees.
    189189
    190190  \sa totalAngle(), setNumTurns()
     
    206206}
    207207
    208 /*! 
     208/*!
    209209  \return the total angle
    210210  \sa setTotalAngle(), setNumTurns(), numTurns()
     
    223223  \sa numTurns(), totalAngle(), setTotalAngle()
    224224*/
    225  
     225
    226226void QwtKnob::setNumTurns( int numTurns )
    227227{
     
    245245
    246246/*!
    247   \return Number of turns. 
     247  \return Number of turns.
    248248
    249249  When the total angle is below 360° numTurns() is ceiled to 1.
     
    336336        r.moveBottom( cr.bottom() - d );
    337337    }
    338     else 
     338    else
    339339    {
    340340        r.moveCenter( QPoint( r.center().x(), cr.center().y() ) );
     
    401401        if ( !wrapping() )
    402402        {
    403             const double boundedAngle = 
     403            const double boundedAngle =
    404404                qBound( scaleMap().p1(), angle, scaleMap().p2() );
    405405
     
    432432}
    433433
    434 /*! 
     434/*!
    435435  Handle QEvent::StyleChange and QEvent::FontChange;
    436436  \param event Change event
     
    479479    drawKnob( &painter, knobRect );
    480480
    481     drawMarker( &painter, knobRect, 
     481    drawMarker( &painter, knobRect,
    482482        qwtNormalizeDegrees( scaleMap().transform( value() ) ) );
    483483
     
    514514        gradient.setColorAt( 1.0, c2 );
    515515
    516         pen = QPen( gradient, d_data->borderWidth ); 
     516        pen = QPen( gradient, d_data->borderWidth );
    517517    }
    518518
     
    525525            QRadialGradient gradient( knobRect.center(),
    526526                knobRect.width(), knobRect.topLeft() + QPointF( off, off ) );
    527            
     527
    528528            gradient.setColorAt( 0.0, palette().color( QPalette::Midlight ) );
    529529            gradient.setColorAt( 1.0, palette().color( QPalette::Button ) );
     
    553553        case QwtKnob::Sunken:
    554554        {
    555             QLinearGradient gradient( 
     555            QLinearGradient gradient(
    556556                knobRect.topLeft(), knobRect.bottomRight() );
    557557            gradient.setColorAt( 0.0, palette().color( QPalette::Mid ) );
     
    578578  \param painter Painter
    579579  \param rect Bounding rectangle of the knob without scale
    580   \param angle Angle of the marker in degrees 
     580  \param angle Angle of the marker in degrees
    581581               ( clockwise, 0 at the 12 o'clock position )
    582582*/
    583 void QwtKnob::drawMarker( QPainter *painter, 
     583void QwtKnob::drawMarker( QPainter *painter,
    584584    const QRectF &rect, double angle ) const
    585585{
     
    608608        case Nub:
    609609        {
    610             const double dotWidth = 
     610            const double dotWidth =
    611611                qMin( double( markerSize ), radius);
    612612
     
    614614            if ( dotCenterDist > 0.0 )
    615615            {
    616                 const QPointF center( xm - sinA * dotCenterDist, 
     616                const QPointF center( xm - sinA * dotCenterDist,
    617617                    ym - cosA * dotCenterDist );
    618618
     
    626626                    qSwap( c1, c2 );
    627627
    628                 QLinearGradient gradient( 
     628                QLinearGradient gradient(
    629629                    ellipse.topLeft(), ellipse.bottomRight() );
    630630                gradient.setColorAt( 0.0, c1 );
     
    640640        case Dot:
    641641        {
    642             const double dotWidth = 
     642            const double dotWidth =
    643643                qMin( double( markerSize ), radius);
    644644
     
    646646            if ( dotCenterDist > 0.0 )
    647647            {
    648                 const QPointF center( xm - sinA * dotCenterDist, 
     648                const QPointF center( xm - sinA * dotCenterDist,
    649649                    ym - cosA * dotCenterDist );
    650650
     
    681681            painter->translate( rect.center() );
    682682            painter->rotate( angle - 90.0 );
    683            
     683
    684684            QPolygonF polygon;
    685685            polygon += QPointF( re, 0.0 );
     
    705705*/
    706706void QwtKnob::drawFocusIndicator( QPainter *painter ) const
    707 {       
     707{
    708708    const QRect cr = contentsRect();
    709709
     
    723723
    724724    QwtPainter::drawFocusRect( painter, this, focusRect );
    725 } 
     725}
    726726
    727727/*!
     
    729729
    730730  Similar to a QLabel::alignment() the flags decide how
    731   to align the knob inside of contentsRect(). 
     731  to align the knob inside of contentsRect().
    732732
    733733  The default setting is Qt::AlignCenter
     
    758758  \brief Change the knob's width.
    759759
    760   Setting a fixed value for the diameter of the knob 
     760  Setting a fixed value for the diameter of the knob
    761761  is helpful for aligning several knobs in a row.
    762762
     
    764764
    765765  \sa knobWidth(), setAlignment()
    766   \note Modifies the sizePolicy() 
     766  \note Modifies the sizePolicy()
    767767*/
    768768void QwtKnob::setKnobWidth( int width )
     
    828828}
    829829
    830 /*! 
     830/*!
    831831  \return Marker size
    832832  \sa setMarkerSize()
  • trunk/BNC/qwt/qwt_knob.h

    r8127 r9383  
    2626  The layout of the knob depends on the knobWidth().
    2727
    28   - width > 0 
     28  - width > 0
    2929    The diameter of the knob is fixed and the knob is aligned
    30     according to the alignment() flags inside of the contentsRect(). 
     30    according to the alignment() flags inside of the contentsRect().
    3131
    3232  - width <= 0
     
    3636  Setting a fixed knobWidth() is helpful to align several knobs with different
    3737  scale labels.
    38  
     38
    3939  \image html knob.png
    4040*/
     
    5656
    5757public:
    58     /*! 
     58    /*!
    5959       \brief Style of the knob surface
    6060
     
    7272        Raised,
    7373
    74         /*! 
     74        /*!
    7575          Build a gradient from QPalette::Midlight, QPalette::Button
    7676          and QPalette::Midlight
     
    7878        Sunken,
    7979
    80         /*! 
     80        /*!
    8181          Build a radial gradient from QPalette::Button
    8282          like it is used for QDial in various Qt styles.
     
    8787    /*!
    8888        \brief Marker type
    89  
     89
    9090        The marker indicates the current value on the knob
    9191        The default setting is a Notch marker.
     
    9393        \sa setMarkerStyle(), setMarkerSize()
    9494    */
    95     enum MarkerStyle 
    96     { 
     95    enum MarkerStyle
     96    {
    9797        //! Don't paint any marker
    9898        NoMarker = -1,
    9999
    100100        //! Paint a single tick in QPalette::ButtonText color
    101         Tick, 
     101        Tick,
    102102
    103103        //! Paint a triangle in QPalette::ButtonText color
    104         Triangle, 
     104        Triangle,
    105105
    106106        //! Paint a circle in QPalette::ButtonText color
    107         Dot, 
     107        Dot,
    108108
    109         /*! 
     109        /*!
    110110          Draw a raised ellipse with a gradient build from
    111111          QPalette::Light and QPalette::Mid
    112          */ 
    113         Nub, 
     112         */
     113        Nub,
    114114
    115         /*! 
     115        /*!
    116116          Draw a sunken ellipse with a gradient build from
    117117          QPalette::Light and QPalette::Mid
    118          */ 
    119         Notch 
     118         */
     119        Notch
    120120    };
    121121
     
    138138    KnobStyle knobStyle() const;
    139139
    140     void setBorderWidth( int bw );
     140    void setBorderWidth( int );
    141141    int borderWidth() const;
    142142
     
    165165    virtual void drawFocusIndicator( QPainter * ) const;
    166166
    167     virtual void drawMarker( QPainter *, 
    168         const QRectF &, double arc ) const;
     167    virtual void drawMarker( QPainter *,
     168        const QRectF &, double angle ) const;
    169169
    170170    virtual double scrolledTo( const QPoint & ) const;
  • trunk/BNC/qwt/qwt_legend.cpp

    r8127 r9383  
    5050};
    5151
    52 void QwtLegendMap::insert( const QVariant &itemInfo, 
     52void QwtLegendMap::insert( const QVariant &itemInfo,
    5353    const QList<QWidget *> &widgets )
    5454{
     
    142142{
    143143public:
    144     LegendView( QWidget *parent ):
     144    explicit LegendView( QWidget *parent ):
    145145        QScrollArea( parent )
    146146    {
     
    296296    if ( tl )
    297297        tl->setMaxColumns( numColums );
     298
     299    updateGeometry();
    298300}
    299301
     
    342344
    343345/*!
    344   The contents widget is the only child of the viewport of 
     346  The contents widget is the only child of the viewport of
    345347  the internal QScrollArea and the parent widget of all legend items.
    346348
     
    371373
    372374/*!
    373   The contents widget is the only child of the viewport of 
     375  The contents widget is the only child of the viewport of
    374376  the internal QScrollArea and the parent widget of all legend items.
    375377
     
    386388
    387389  \param itemInfo Info for an item
    388   \param data List of legend entry attributes for the item
     390  \param legendData List of legend entry attributes for the item
    389391 */
    390 void QwtLegend::updateLegend( const QVariant &itemInfo, 
    391     const QList<QwtLegendData> &data )
     392void QwtLegend::updateLegend( const QVariant &itemInfo,
     393    const QList<QwtLegendData> &legendData )
    392394{
    393395    QList<QWidget *> widgetList = legendWidgets( itemInfo );
    394396
    395     if ( widgetList.size() != data.size() )
     397    if ( widgetList.size() != legendData.size() )
    396398    {
    397399        QLayout *contentsLayout = d_data->view->contentsWidget->layout();
    398400
    399         while ( widgetList.size() > data.size() )
     401        while ( widgetList.size() > legendData.size() )
    400402        {
    401403            QWidget *w = widgetList.takeLast();
     
    410412        }
    411413
    412         for ( int i = widgetList.size(); i < data.size(); i++ )
    413         {
    414             QWidget *widget = createWidget( data[i] );
     414#if QT_VERSION >= 0x040700
     415        widgetList.reserve( legendData.size() );
     416#endif
     417
     418        for ( int i = widgetList.size(); i < legendData.size(); i++ )
     419        {
     420            QWidget *widget = createWidget( legendData[i] );
    415421
    416422            if ( contentsLayout )
     
    441447        updateTabOrder();
    442448    }
    443    
    444     for ( int i = 0; i < data.size(); i++ )
    445         updateWidget( widgetList[i], data[i] );
     449
     450    for ( int i = 0; i < legendData.size(); i++ )
     451        updateWidget( widgetList[i], legendData[i] );
    446452}
    447453
     
    451457  The default implementation returns a QwtLegendLabel.
    452458
    453   \param data Attributes of the legend entry
     459  \param legendData Attributes of the legend entry
    454460  \return Widget representing data on the legend
    455  
     461
    456462  \note updateWidget() will called soon after createWidget()
    457463        with the same attributes.
    458464 */
    459 QWidget *QwtLegend::createWidget( const QwtLegendData &data ) const
    460 {
    461     Q_UNUSED( data );
     465QWidget *QwtLegend::createWidget( const QwtLegendData &legendData ) const
     466{
     467    Q_UNUSED( legendData );
    462468
    463469    QwtLegendLabel *label = new QwtLegendLabel();
    464470    label->setItemMode( defaultItemMode() );
    465471
    466     connect( label, SIGNAL( clicked() ), SLOT( itemClicked() ) );
    467     connect( label, SIGNAL( checked( bool ) ), SLOT( itemChecked( bool ) ) );
     472    connect( label, SIGNAL(clicked()), SLOT(itemClicked()) );
     473    connect( label, SIGNAL(checked(bool)), SLOT(itemChecked(bool)) );
    468474
    469475    return label;
     
    471477
    472478/*!
    473   \brief Update the widget 
     479  \brief Update the widget
    474480
    475481  \param widget Usually a QwtLegendLabel
    476   \param data Attributes to be displayed
     482  \param legendData Attributes to be displayed
    477483
    478484  \sa createWidget()
    479485  \note When widget is no QwtLegendLabel updateWidget() does nothing.
    480486 */
    481 void QwtLegend::updateWidget( QWidget *widget, const QwtLegendData &data )
     487void QwtLegend::updateWidget( QWidget *widget, const QwtLegendData &legendData )
    482488{
    483489    QwtLegendLabel *label = qobject_cast<QwtLegendLabel *>( widget );
    484490    if ( label )
    485491    {
    486         label->setData( data );
    487         if ( !data.value( QwtLegendData::ModeRole ).isValid() )
     492        label->setData( legendData );
     493        if ( !legendData.value( QwtLegendData::ModeRole ).isValid() )
    488494        {
    489495            // use the default mode, when there is no specific
     
    541547
    542548/*!
    543   Handle QEvent::ChildRemoved andQEvent::LayoutRequest events 
     549  Handle QEvent::ChildRemoved andQEvent::LayoutRequest events
    544550  for the contentsWidget().
    545551
     
    557563            case QEvent::ChildRemoved:
    558564            {
    559                 const QChildEvent *ce = 
     565                const QChildEvent *ce =
    560566                    static_cast<const QChildEvent *>(event);
     567
    561568                if ( ce->child()->isWidgetType() )
    562569                {
    563                     QWidget *w = static_cast< QWidget * >( ce->child() );
     570                    /*
     571                        We are called from the ~QObject and ce->child() is
     572                        no widget anymore. But all we need is the address
     573                        to remove it from the map.
     574                     */
     575                    QWidget *w = reinterpret_cast< QWidget * >( ce->child() );
    564576                    d_data->itemMap.removeWidget( w );
    565577                }
     
    585597                    QApplication::postEvent( parentWidget(),
    586598                        new QEvent( QEvent::LayoutRequest ) );
    587                 }               
     599                }
    588600                break;
    589601            }
     
    645657  \param painter Painter
    646658  \param rect Bounding rectangle
    647   \param fillBackground When true, fill rect with the widget background 
     659  \param fillBackground When true, fill rect with the widget background
    648660
    649661  \sa renderLegend() is used by QwtPlotRenderer - not by QwtLegend itself
    650662*/
    651 void QwtLegend::renderLegend( QPainter *painter, 
     663void QwtLegend::renderLegend( QPainter *painter,
    652664    const QRectF &rect, bool fillBackground ) const
    653665{
     
    664676    }
    665677
    666     const QwtDynGridLayout *legendLayout = 
     678    const QwtDynGridLayout *legendLayout =
    667679        qobject_cast<QwtDynGridLayout *>( contentsWidget()->layout() );
    668680    if ( legendLayout == NULL )
     
    672684    getContentsMargins( &left, &top, &right, &bottom );
    673685
    674     QRect layoutRect; 
     686    QRect layoutRect;
    675687    layoutRect.setLeft( qCeil( rect.left() ) + left );
    676688    layoutRect.setTop( qCeil( rect.top() ) + top );
     
    679691
    680692    uint numCols = legendLayout->columnsForWidth( layoutRect.width() );
    681     QList<QRect> itemRects =
     693    const QList<QRect> itemRects =
    682694        legendLayout->layoutItems( layoutRect, numCols );
    683695
     
    707719  \param widget Widget representing a legend entry
    708720  \param rect Bounding rectangle
    709   \param fillBackground When true, fill rect with the widget background 
     721  \param fillBackground When true, fill rect with the widget background
    710722
    711723  \note When widget is not derived from QwtLegendLabel renderItem
    712724        does nothing beside the background
    713725*/
    714 void QwtLegend::renderItem( QPainter *painter, 
     726void QwtLegend::renderItem( QPainter *painter,
    715727    const QWidget *widget, const QRectF &rect, bool fillBackground ) const
    716728{
     
    733745
    734746        const QRectF iconRect( rect.x() + label->margin(),
    735             rect.center().y() - 0.5 * sz.height(), 
     747            rect.center().y() - 0.5 * sz.height(),
    736748            sz.width(), sz.height() );
    737749
     
    743755        titleRect.setX( iconRect.right() + 2 * label->spacing() );
    744756
    745         painter->setFont( label->font() );
     757        QFont labelFont = label->font();
     758        labelFont.resolve( QFont::AllPropertiesResolved );
     759
     760        painter->setFont( labelFont );
    746761        painter->setPen( label->palette().color( QPalette::Text ) );
     762
    747763        const_cast< QwtLegendLabel *>( label )->drawText( painter, titleRect );
    748764    }
     
    795811    Return the extent, that is needed for the scrollbars
    796812
    797     \param orientation Orientation (
     813    \param orientation Orientation
    798814    \return The width of the vertical scrollbar for Qt::Horizontal and v.v.
    799815 */
  • trunk/BNC/qwt/qwt_legend.h

    r8127 r9383  
    5252
    5353    virtual QSize sizeHint() const;
    54     virtual int heightForWidth( int w ) const;
     54    virtual int heightForWidth( int width ) const;
    5555
    5656    QScrollBar *horizontalScrollBar() const;
    5757    QScrollBar *verticalScrollBar() const;
    5858
    59     virtual void renderLegend( QPainter *, 
     59    virtual void renderLegend( QPainter *,
    6060        const QRectF &, bool fillBackground ) const;
    6161
    62     virtual void renderItem( QPainter *, 
     62    virtual void renderItem( QPainter *,
    6363        const QWidget *, const QRectF &, bool fillBackground ) const;
    6464
     
    106106protected:
    107107    virtual QWidget *createWidget( const QwtLegendData & ) const;
    108     virtual void updateWidget( QWidget *widget, const QwtLegendData &data );
     108    virtual void updateWidget( QWidget *widget, const QwtLegendData & );
    109109
    110110private:
     
    115115};
    116116
    117 #endif 
     117#endif
  • trunk/BNC/qwt/qwt_legend_data.cpp

    r8127 r9383  
    124124        return static_cast<QwtLegendData::Mode>( mode );
    125125    }
    126    
     126
    127127    return QwtLegendData::ReadOnly;
    128128}
  • trunk/BNC/qwt/qwt_legend_data.h

    r8127 r9383  
    2222
    2323  QwtLegendData is an abstract container ( like QAbstractModel )
    24   to exchange attributes, that are only known between to 
    25   the plot item and the legend. 
    26  
     24  to exchange attributes, that are only known between to
     25  the plot item and the legend.
     26
    2727  By overloading QwtPlotItem::legendData() any other set of attributes
    28   could be used, that can be handled by a modified ( or completely 
     28  could be used, that can be handled by a modified ( or completely
    2929  different ) implementation of a legend.
    3030
     
    5353    {
    5454        // The value is a Mode
    55         ModeRole, 
     55        ModeRole,
    5656
    5757        // The value is a title
    58         TitleRole, 
     58        TitleRole,
    5959
    6060        // The value is an icon
    61         IconRole, 
     61        IconRole,
    6262
    6363        // Values < UserRole are reserved for internal use
  • trunk/BNC/qwt/qwt_legend_label.cpp

    r8127 r9383  
    140140        d_data->isDown = false;
    141141
    142         setFocusPolicy( ( mode != QwtLegendData::ReadOnly ) 
     142        setFocusPolicy( ( mode != QwtLegendData::ReadOnly )
    143143            ? Qt::TabFocus : Qt::NoFocus );
    144144        setMargin( ButtonFrame + Margin );
  • trunk/BNC/qwt/qwt_legend_label.h

    r8127 r9383  
    7878};
    7979
    80 #endif 
     80#endif
  • trunk/BNC/qwt/qwt_magnifier.cpp

    r8127 r9383  
    191191   \sa getMouseButton()
    192192*/
    193 void QwtMagnifier::setMouseButton( 
     193void QwtMagnifier::setMouseButton(
    194194    Qt::MouseButton button, Qt::KeyboardModifiers modifiers )
    195195{
     
    239239   \sa getZoomInKey(), setZoomOutKey()
    240240*/
    241 void QwtMagnifier::setZoomInKey( int key, 
     241void QwtMagnifier::setZoomInKey( int key,
    242242    Qt::KeyboardModifiers modifiers )
    243243{
     
    246246}
    247247
    248 /*! 
     248/*!
    249249   \brief Retrieve the settings of the zoom in key
    250250
     
    254254   \sa setZoomInKey()
    255255*/
    256 void QwtMagnifier::getZoomInKey( int &key, 
     256void QwtMagnifier::getZoomInKey( int &key,
    257257    Qt::KeyboardModifiers &modifiers ) const
    258258{
     
    269269   \sa getZoomOutKey(), setZoomOutKey()
    270270*/
    271 void QwtMagnifier::setZoomOutKey( int key, 
     271void QwtMagnifier::setZoomOutKey( int key,
    272272    Qt::KeyboardModifiers modifiers )
    273273{
     
    276276}
    277277
    278 /*! 
     278/*!
    279279   \brief Retrieve the settings of the zoom out key
    280280
     
    284284   \sa setZoomOutKey()
    285285*/
    286 void QwtMagnifier::getZoomOutKey( int &key, 
     286void QwtMagnifier::getZoomOutKey( int &key,
    287287    Qt::KeyboardModifiers &modifiers ) const
    288288{
     
    438438            of 120 (== 15 * 8).
    439439         */
    440         double f = qPow( d_data->wheelFactor, 
     440        double f = qPow( d_data->wheelFactor,
    441441            qAbs( wheelEvent->delta() / 120.0 ) );
    442442
  • trunk/BNC/qwt/qwt_math.h

    r8127 r9383  
    2828
    2929#ifndef M_PI_2
    30 // For Qt <= 4.8.4 M_PI_2 is not known by MinGW-w64 
     30// For Qt <= 4.8.4 M_PI_2 is not known by MinGW-w64
    3131// when compiling with -std=c++11
    3232#define M_PI_2 (1.57079632679489661923)
  • trunk/BNC/qwt/qwt_matrix_raster_data.cpp

    r8127 r9383  
    8282   \param axis X, Y or Z axis
    8383   \param interval Interval
    84    
     84
    8585   \sa QwtRasterData::interval(), setValueMatrix()
    8686*/
    87 void QwtMatrixRasterData::setInterval( 
     87void QwtMatrixRasterData::setInterval(
    8888    Qt::Axis axis, const QwtInterval &interval )
    8989{
     
    9797   The positions of the values are calculated by dividing
    9898   the bounding rectangle of the X/Y intervals into equidistant
    99    rectangles ( pixels ). Each value corresponds to the center of 
     99   rectangles ( pixels ). Each value corresponds to the center of
    100100   a pixel.
    101101
     
    105105   \sa valueMatrix(), numColumns(), numRows(), setInterval()()
    106106*/
    107 void QwtMatrixRasterData::setValueMatrix( 
     107void QwtMatrixRasterData::setValueMatrix(
    108108    const QVector<double> &values, int numColumns )
    109109{
     
    162162   \brief Calculate the pixel hint
    163163
    164    pixelHint() returns the geometry of a pixel, that can be used 
     164   pixelHint() returns the geometry of a pixel, that can be used
    165165   to calculate the resolution and alignment of the plot item, that is
    166    representing the data. 
     166   representing the data.
    167167
    168168   - NearestNeighbour\n
    169      pixelHint() returns the surrounding pixel of the top left value 
     169     pixelHint() returns the surrounding pixel of the top left value
    170170     in the matrix.
    171171
    172172   - BilinearInterpolation\n
    173173     Returns an empty rectangle recommending
    174      to render in target device ( f.e. screen ) resolution. 
     174     to render in target device ( f.e. screen ) resolution.
    175175
    176176   \param area Requested area, ignored
     
    240240            const double v22 = d_data->value( row2, col2 );
    241241
    242             const double x2 = xInterval.minValue() + 
     242            const double x2 = xInterval.minValue() +
    243243                ( col2 + 0.5 ) * d_data->dx;
    244             const double y2 = yInterval.minValue() + 
     244            const double y2 = yInterval.minValue() +
    245245                ( row2 + 0.5 ) * d_data->dy;
    246                
     246
    247247            const double rx = ( x2 - x ) / d_data->dx;
    248248            const double ry = ( y2 - y ) / d_data->dy;
  • trunk/BNC/qwt/qwt_matrix_raster_data.h

    r8127 r9383  
    1919
    2020  QwtMatrixRasterData implements an interface for a matrix of
    21   equidistant values, that can be used by a QwtPlotRasterItem. 
     21  equidistant values, that can be used by a QwtPlotRasterItem.
    2222  It implements a couple of resampling algorithms, to provide
    2323  values for positions, that or not on the value matrix.
     
    3939
    4040        /*!
    41           Interpolate the value from the distances and values of the 
     41          Interpolate the value from the distances and values of the
    4242          4 surrounding values in the matrix,
    4343         */
  • trunk/BNC/qwt/qwt_null_paintdevice.cpp

    r8127 r9383  
    1010#include "qwt_null_paintdevice.h"
    1111#include <qpaintengine.h>
     12#include <qpainterpath.h>
    1213#include <qpixmap.h>
    1314
     
    5152    virtual void drawPolygon(const QPoint *, int , PolygonDrawMode );
    5253
    53     virtual void drawPixmap(const QRectF &, 
     54    virtual void drawPixmap(const QRectF &,
    5455        const QPixmap &, const QRectF &);
    5556
    5657    virtual void drawTextItem(const QPointF &, const QTextItem &);
    5758
    58     virtual void drawTiledPixmap(const QRectF &, 
     59    virtual void drawTiledPixmap(const QRectF &,
    5960        const QPixmap &, const QPointF &s);
    6061
    61     virtual void drawImage(const QRectF &, 
     62    virtual void drawImage(const QRectF &,
    6263        const QImage &, const QRectF &, Qt::ImageConversionFlags );
    6364
     
    6566    QwtNullPaintDevice *nullDevice();
    6667};
    67    
     68
    6869QwtNullPaintDevice::PaintEngine::PaintEngine():
    6970    QPaintEngine( QPaintEngine::AllFeatures )
     
    283284}
    284285
    285 void QwtNullPaintDevice::PaintEngine::drawPixmap( 
     286void QwtNullPaintDevice::PaintEngine::drawPixmap(
    286287    const QRectF &rect, const QPixmap &pm, const QRectF &subRect )
    287288{
     
    310311
    311312void QwtNullPaintDevice::PaintEngine::drawTiledPixmap(
    312     const QRectF &rect, const QPixmap &pixmap, 
     313    const QRectF &rect, const QPixmap &pixmap,
    313314    const QPointF &subRect)
    314315{
     
    321322        QPaintEngine::drawTiledPixmap( rect, pixmap, subRect );
    322323        return;
    323     }   
     324    }
    324325
    325326    device->drawTiledPixmap( rect, pixmap, subRect );
     
    327328
    328329void QwtNullPaintDevice::PaintEngine::drawImage(
    329     const QRectF &rect, const QImage &image, 
     330    const QRectF &rect, const QImage &image,
    330331    const QRectF &subRect, Qt::ImageConversionFlags flags)
    331332{
     
    338339
    339340void QwtNullPaintDevice::PaintEngine::updateState(
    340     const QPaintEngineState &state)
    341 {
    342     QwtNullPaintDevice *device = nullDevice();
    343     if ( device == NULL )
    344         return;
    345 
    346     device->updateState( state );
     341    const QPaintEngineState &engineState)
     342{
     343    QwtNullPaintDevice *device = nullDevice();
     344    if ( device == NULL )
     345        return;
     346
     347    device->updateState( engineState );
    347348}
    348349
     
    380381}
    381382
    382 /*! 
     383/*!
    383384    \return Render mode
    384385    \sa setMode()
     
    394395    if ( d_engine == NULL )
    395396    {
    396         QwtNullPaintDevice *that = 
     397        QwtNullPaintDevice *that =
    397398            const_cast< QwtNullPaintDevice * >( this );
    398399
     
    403404}
    404405
    405 /*! 
     406/*!
    406407    See QPaintDevice::metric()
    407408
     
    415416    int value;
    416417
    417     switch ( deviceMetric ) 
     418    switch ( deviceMetric )
    418419    {
    419420        case PdmWidth:
     
    530531//! See QPaintEngine::drawPolygon()
    531532void QwtNullPaintDevice::drawPolygon(
    532     const QPointF *points, int pointCount, 
     533    const QPointF *points, int pointCount,
    533534    QPaintEngine::PolygonDrawMode mode)
    534535{
     
    540541//! See QPaintEngine::drawPolygon()
    541542void QwtNullPaintDevice::drawPolygon(
    542     const QPoint *points, int pointCount, 
     543    const QPoint *points, int pointCount,
    543544    QPaintEngine::PolygonDrawMode mode)
    544545{
     
    549550
    550551//! See QPaintEngine::drawPixmap()
    551 void QwtNullPaintDevice::drawPixmap( const QRectF &rect, 
     552void QwtNullPaintDevice::drawPixmap( const QRectF &rect,
    552553    const QPixmap &pm, const QRectF &subRect )
    553554{
     
    567568//! See QPaintEngine::drawTiledPixmap()
    568569void QwtNullPaintDevice::drawTiledPixmap(
    569     const QRectF &rect, const QPixmap &pixmap, 
     570    const QRectF &rect, const QPixmap &pixmap,
    570571    const QPointF &subRect)
    571572{
     
    577578//! See QPaintEngine::drawImage()
    578579void QwtNullPaintDevice::drawImage(
    579     const QRectF &rect, const QImage &image, 
     580    const QRectF &rect, const QImage &image,
    580581    const QRectF &subRect, Qt::ImageConversionFlags flags)
    581582{
     
    587588
    588589//! See QPaintEngine::updateState()
    589 void QwtNullPaintDevice::updateState( 
     590void QwtNullPaintDevice::updateState(
    590591    const QPaintEngineState &state )
    591592{
  • trunk/BNC/qwt/qwt_null_paintdevice.h

    r8127 r9383  
    1818  \brief A null paint device doing nothing
    1919
    20   Sometimes important layout/rendering geometries are not 
    21   available or changeable from the public Qt class interface. 
     20  Sometimes important layout/rendering geometries are not
     21  available or changeable from the public Qt class interface.
    2222  ( f.e hidden in the style implementation ).
    2323
    24   QwtNullPaintDevice can be used to manipulate or filter out 
     24  QwtNullPaintDevice can be used to manipulate or filter out
    2525  this information by analyzing the stream of paint primitives.
    2626
     
    4343           the corresponding draw methods
    4444         */
    45         NormalMode, 
     45        NormalMode,
    4646
    4747        /*!
     
    7777    virtual QPaintEngine *paintEngine() const;
    7878
    79     virtual int metric( PaintDeviceMetric metric ) const;
     79    virtual int metric( PaintDeviceMetric ) const;
    8080
    8181    virtual void drawRects(const QRect *, int );
     
    105105
    106106    virtual void drawTiledPixmap(const QRectF &,
    107         const QPixmap &, const QPointF &s);
     107        const QPixmap &, const QPointF & );
    108108
    109109    virtual void drawImage(const QRectF &,
    110110        const QImage &, const QRectF &, Qt::ImageConversionFlags );
    111111
    112     virtual void updateState( const QPaintEngineState &state );
     112    virtual void updateState( const QPaintEngineState & );
    113113
    114114protected:
  • trunk/BNC/qwt/qwt_painter.cpp

    r8127 r9383  
    2020#include <qpalette.h>
    2121#include <qpaintdevice.h>
     22#include <qpainterpath.h>
    2223#include <qpixmap.h>
    2324#include <qstyle.h>
     
    3334#endif
    3435
    35 #if QT_VERSION < 0x050000 
     36#if QT_VERSION < 0x050000
    3637
    3738#ifdef Q_WS_X11
     
    4445bool QwtPainter::d_roundingAlignment = true;
    4546
    46 static inline bool qwtIsClippingNeeded( 
     47static inline bool qwtIsClippingNeeded(
    4748    const QPainter *painter, QRectF &clipRect )
    4849{
     
    142143bool QwtPainter::isX11GraphicsSystem()
    143144{
     145    /*
     146        The X11 paint engine has been removed with Qt 5.0, but
     147        reintroduced with Qt 5.10. It can be enabled with
     148        "export QT_XCB_NATIVE_PAINTING=1".
     149     */
     150
    144151    static int onX11 = -1;
    145152    if ( onX11 < 0 )
     
    181188        }
    182189
    183         const QTransform tr = painter->transform();
     190        const QTransform &tr = painter->transform();
    184191        if ( tr.isRotating() || tr.isScaling() )
    185192        {
     
    196203  to a paint engine that floors to integer values. For other paint engines
    197204  ( PDF, SVG ) this flag has no effect.
    198   QwtPainter stores this flag only, the rounding itself is done in 
     205  QwtPainter stores this flag only, the rounding itself is done in
    199206  the painting code ( f.e the plot items ).
    200207
    201   The default setting is true. 
     208  The default setting is true.
    202209
    203210  \sa roundingAlignment(), isAligning()
     
    214221  much faster when they are split in smaller chunks: f.e all supported Qt versions
    215222  >= Qt 5.0 when drawing an antialiased polyline with a pen width >=2.
     223
     224  Also the raster paint engine has a nasty bug in many versions ( Qt 4.8 - ... )
     225  for short lines ( https://codereview.qt-project.org/#/c/99456 ), that is worked
     226  around in this mode.
    216227
    217228  The default setting is true.
     
    397408            unscaledRect = transform.inverted().mapRect(rect);
    398409        }
    399     } 
     410    }
    400411
    401412    txt->setDefaultFont( painter->font() );
     
    452463    QPolygonF cpa = polygon;
    453464    if ( deviceClipping )
    454         cpa = QwtClipper::clipPolygonF( clipRect, polygon );
     465        cpa = QwtClipper::clipPolygonF( clipRect, polygon, true );
    455466
    456467    painter->drawPolygon( cpa );
     
    501512    QPolygon cpa = polygon;
    502513    if ( deviceClipping )
    503         cpa = QwtClipper::clipPolygon( clipRect, polygon );
     514        cpa = QwtClipper::clipPolygon( clipRect, polygon, true );
    504515
    505516    painter->drawPolygon( cpa );
     
    537548    }
    538549    else
     550    {
    539551        qwtDrawPolyline<QPoint>( painter, points, pointCount, d_polylineSplitting );
     552    }
    540553}
    541554
     
    565578        const int maxY = qFloor( clipRect.bottom() );
    566579
    567         if ( pos.x() < minX || pos.x() > maxX 
     580        if ( pos.x() < minX || pos.x() > maxX
    568581            || pos.y() < minY || pos.y() > maxY )
    569582        {
     
    576589
    577590//! Wrapper for QPainter::drawPoints()
    578 void QwtPainter::drawPoints( QPainter *painter, 
     591void QwtPainter::drawPoints( QPainter *painter,
    579592    const QPoint *points, int pointCount )
    580593{
     
    609622
    610623//! Wrapper for QPainter::drawPoints()
    611 void QwtPainter::drawPoints( QPainter *painter, 
     624void QwtPainter::drawPoints( QPainter *painter,
    612625    const QPointF *points, int pointCount )
    613626{
     
    697710
    698711/*!
    699   Draw a round frame 
     712  Draw a round frame
    700713
    701714  \param painter Painter
     
    708721*/
    709722void QwtPainter::drawRoundFrame( QPainter *painter,
    710     const QRectF &rect, const QPalette &palette, 
     723    const QRectF &rect, const QPalette &palette,
    711724    int lineWidth, int frameStyle )
    712725{
     
    787800    {
    788801        const QRectF outerRect = rect.adjusted( 0.0, 0.0, -1.0, -1.0 );
    789         const QRectF innerRect = outerRect.adjusted( 
     802        const QRectF innerRect = outerRect.adjusted(
    790803            frameWidth, frameWidth, -frameWidth, -frameWidth );
    791804
     
    806819        {
    807820            const QRectF outerRect = rect.adjusted( 0.0, 0.0, -1.0, -1.0 );
    808             const QRectF midRect1 = outerRect.adjusted( 
     821            const QRectF midRect1 = outerRect.adjusted(
    809822                frameWidth, frameWidth, -frameWidth, -frameWidth );
    810             const QRectF midRect2 = midRect1.adjusted( 
     823            const QRectF midRect2 = midRect1.adjusted(
    811824                midLineWidth, midLineWidth, -midLineWidth, -midLineWidth );
    812825
    813             const QRectF innerRect = midRect2.adjusted( 
     826            const QRectF innerRect = midRect2.adjusted(
    814827                frameWidth, frameWidth, -frameWidth, -frameWidth );
    815828
     
    887900        {
    888901            const QRectF outerRect = rect.adjusted( 0.0, 0.0, -1.0, -1.0 );
    889             const QRectF innerRect = outerRect.adjusted( 
    890                 frameWidth - 1.0, frameWidth - 1.0, 
     902            const QRectF innerRect = outerRect.adjusted(
     903                frameWidth - 1.0, frameWidth - 1.0,
    891904                -( frameWidth - 1.0 ), -( frameWidth - 1.0 ) );
    892905
     
    942955*/
    943956
    944 void QwtPainter::drawRoundedFrame( QPainter *painter, 
    945     const QRectF &rect, double xRadius, double yRadius, 
     957void QwtPainter::drawRoundedFrame( QPainter *painter,
     958    const QRectF &rect, double xRadius, double yRadius,
    946959    const QPalette &palette, int lineWidth, int frameStyle )
    947960{
     
    951964
    952965    double lw2 = lineWidth * 0.5;
    953     QRectF r = rect.adjusted( lw2, lw2, -lw2, -lw2 );
     966    QRectF innerRect = rect.adjusted( lw2, lw2, -lw2, -lw2 );
    954967
    955968    QPainterPath path;
    956     path.addRoundedRect( r, xRadius, yRadius );
     969    path.addRoundedRect( innerRect, xRadius, yRadius );
    957970
    958971    enum Style
     
    973986        // move + 4 * ( cubicTo + lineTo )
    974987        QPainterPath pathList[8];
    975        
     988
    976989        for ( int i = 0; i < 4; i++ )
    977990        {
    978991            const int j = i * 4 + 1;
    979            
     992
    980993            pathList[ 2 * i ].moveTo(
    981994                path.elementAt(j - 1).x, path.elementAt( j - 1 ).y
    982             ); 
    983            
     995            );
     996
    984997            pathList[ 2 * i ].cubicTo(
    985998                path.elementAt(j + 0).x, path.elementAt(j + 0).y,
    986999                path.elementAt(j + 1).x, path.elementAt(j + 1).y,
    9871000                path.elementAt(j + 2).x, path.elementAt(j + 2).y );
    988                
     1001
    9891002            pathList[ 2 * i + 1 ].moveTo(
    9901003                path.elementAt(j + 2).x, path.elementAt(j + 2).y
    991             ); 
     1004            );
    9921005            pathList[ 2 * i + 1 ].lineTo(
    9931006                path.elementAt(j + 3).x, path.elementAt(j + 3).y
    994             ); 
    995         }   
     1007            );
     1008        }
    9961009
    9971010        QColor c1( palette.color( QPalette::Dark ) );
     
    10031016        for ( int i = 0; i < 4; i++ )
    10041017        {
    1005             QRectF r = pathList[2 * i].controlPointRect();
     1018            const QRectF r = pathList[2 * i].controlPointRect();
    10061019
    10071020            QPen arcPen;
     
    11471160}
    11481161
    1149 static inline void qwtFillRect( const QWidget *widget, QPainter *painter, 
     1162static inline void qwtFillRect( const QWidget *widget, QPainter *painter,
    11501163    const QRect &rect, const QBrush &brush)
    11511164{
    1152     if ( brush.style() == Qt::TexturePattern ) 
     1165    if ( brush.style() == Qt::TexturePattern )
    11531166    {
    11541167        painter->save();
     
    11581171
    11591172        painter->restore();
    1160     } 
     1173    }
    11611174    else if ( brush.gradient() )
    11621175    {
     
    11641177
    11651178        painter->setClipRect( rect );
    1166         painter->fillRect(0, 0, widget->width(), 
     1179        painter->fillRect(0, 0, widget->width(),
    11671180            widget->height(), brush);
    11681181
    11691182        painter->restore();
    1170     } 
    1171     else 
     1183    }
     1184    else
    11721185    {
    11731186        painter->fillRect(rect, brush);
     
    11791192
    11801193  In Qt >= 5.0 QPixmap::fill() is a nop, in Qt 4.x it is buggy
    1181   for backgrounds with gradients. Thus fillPixmap() offers 
     1194  for backgrounds with gradients. Thus fillPixmap() offers
    11821195  an alternative implementation.
    11831196
    11841197  \param widget Widget
    11851198  \param pixmap Pixmap to be filled
    1186   \param offset Offset 
     1199  \param offset Offset
    11871200
    11881201  \sa QPixmap::fill()
    11891202 */
    1190 void QwtPainter::fillPixmap( const QWidget *widget, 
     1203void QwtPainter::fillPixmap( const QWidget *widget,
    11911204    QPixmap &pixmap, const QPoint &offset )
    11921205{
     
    11961209    painter.translate( -offset );
    11971210
    1198     const QBrush autoFillBrush = 
     1211    const QBrush autoFillBrush =
    11991212        widget->palette().brush( widget->backgroundRole() );
    12001213
    1201     if ( !( widget->autoFillBackground() && autoFillBrush.isOpaque() ) ) 
     1214    if ( !( widget->autoFillBackground() && autoFillBrush.isOpaque() ) )
    12021215    {
    12031216        const QBrush bg = widget->palette().brush( QPalette::Window );
     
    12081221        qwtFillRect( widget, &painter, rect, autoFillBrush);
    12091222
    1210     if ( widget->testAttribute(Qt::WA_StyledBackground) ) 
     1223    if ( widget->testAttribute(Qt::WA_StyledBackground) )
    12111224    {
    12121225        painter.setClipRegion( rect );
     
    12141227        QStyleOption opt;
    12151228        opt.initFrom( widget );
    1216         widget->style()->drawPrimitive( QStyle::PE_Widget, 
     1229        widget->style()->drawPrimitive( QStyle::PE_Widget,
    12171230            &opt, &painter, widget );
    12181231    }
     
    12851298#endif
    12861299
    1287 #if QT_VERSION < 0x050000 
     1300#if QT_VERSION < 0x050000
    12881301#ifdef Q_WS_X11
    12891302    if ( widget && isX11GraphicsSystem() )
  • trunk/BNC/qwt/qwt_painter.h

    r8127 r9383  
    5151    static void drawText( QPainter *, double x, double y, double w, double h,
    5252        int flags, const QString & );
    53     static void drawText( QPainter *, const QRectF &, 
     53    static void drawText( QPainter *, const QRectF &,
    5454        int flags, const QString & );
    5555
     
    6464
    6565    static void drawEllipse( QPainter *, const QRectF & );
    66     static void drawPie( QPainter *, const QRectF & r, int a, int alen );
     66    static void drawPie( QPainter *, const QRectF &, int a, int alen );
    6767
    6868    static void drawLine( QPainter *, double x1, double y1, double x2, double y2 );
     
    9494        const QRectF &, const QPalette &, int lineWidth, int frameStyle );
    9595
    96     static void drawRoundedFrame( QPainter *, 
     96    static void drawRoundedFrame( QPainter *,
    9797        const QRectF &, double xRadius, double yRadius,
    9898        const QPalette &, int lineWidth, int frameStyle );
     
    100100    static void drawFrame( QPainter *, const QRectF &rect,
    101101        const QPalette &palette, QPalette::ColorRole foregroundRole,
    102         int lineWidth, int midLineWidth, int frameStyle );
     102        int frameWidth, int midLineWidth, int frameStyle );
    103103
    104104    static void drawFocusRect( QPainter *, const QWidget * );
     
    112112    static bool isX11GraphicsSystem();
    113113
    114     static void fillPixmap( const QWidget *, 
     114    static void fillPixmap( const QWidget *,
    115115        QPixmap &, const QPoint &offset = QPoint() );
    116116
  • trunk/BNC/qwt/qwt_painter_command.cpp

    r8127 r9383  
    6464}
    6565
    66 /*! 
     66/*!
    6767  Constructor for State paint operation
    6868  \param state Paint engine state
    69  */ 
     69 */
    7070QwtPainterCommand::QwtPainterCommand( const QPaintEngineState &state ):
    7171    d_type( State )
     
    7575    d_stateData->flags = state.state();
    7676
    77     if ( d_stateData->flags & QPaintEngine::DirtyPen ) 
     77    if ( d_stateData->flags & QPaintEngine::DirtyPen )
    7878        d_stateData->pen = state.pen();
    7979
    80     if ( d_stateData->flags & QPaintEngine::DirtyBrush ) 
     80    if ( d_stateData->flags & QPaintEngine::DirtyBrush )
    8181        d_stateData->brush = state.brush();
    8282
    83     if ( d_stateData->flags & QPaintEngine::DirtyBrushOrigin ) 
     83    if ( d_stateData->flags & QPaintEngine::DirtyBrushOrigin )
    8484        d_stateData->brushOrigin = state.brushOrigin();
    8585
    86     if ( d_stateData->flags & QPaintEngine::DirtyFont ) 
     86    if ( d_stateData->flags & QPaintEngine::DirtyFont )
    8787        d_stateData->font = state.font();
    8888
    89     if ( d_stateData->flags & QPaintEngine::DirtyBackground ) 
     89    if ( d_stateData->flags & QPaintEngine::DirtyBackground )
    9090    {
    9191        d_stateData->backgroundMode = state.backgroundMode();
     
    9393    }
    9494
    95     if ( d_stateData->flags & QPaintEngine::DirtyTransform ) 
     95    if ( d_stateData->flags & QPaintEngine::DirtyTransform )
    9696        d_stateData->transform = state.transform();
    9797
    98     if ( d_stateData->flags & QPaintEngine::DirtyClipEnabled ) 
     98    if ( d_stateData->flags & QPaintEngine::DirtyClipEnabled )
    9999        d_stateData->isClipEnabled = state.isClipEnabled();
    100100
    101     if ( d_stateData->flags & QPaintEngine::DirtyClipRegion ) 
     101    if ( d_stateData->flags & QPaintEngine::DirtyClipRegion )
    102102    {
    103103        d_stateData->clipRegion = state.clipRegion();
     
    105105    }
    106106
    107     if ( d_stateData->flags & QPaintEngine::DirtyClipPath ) 
     107    if ( d_stateData->flags & QPaintEngine::DirtyClipPath )
    108108    {
    109109        d_stateData->clipPath = state.clipPath();
     
    111111    }
    112112
    113     if ( d_stateData->flags & QPaintEngine::DirtyHints ) 
     113    if ( d_stateData->flags & QPaintEngine::DirtyHints )
    114114        d_stateData->renderHints = state.renderHints();
    115115
    116     if ( d_stateData->flags & QPaintEngine::DirtyCompositionMode ) 
     116    if ( d_stateData->flags & QPaintEngine::DirtyCompositionMode )
    117117        d_stateData->compositionMode = state.compositionMode();
    118118
    119     if ( d_stateData->flags & QPaintEngine::DirtyOpacity ) 
     119    if ( d_stateData->flags & QPaintEngine::DirtyOpacity )
    120120        d_stateData->opacity = state.opacity();
    121121}
     
    124124  Copy constructor
    125125  \param other Command to be copied
    126  
     126
    127127 */
    128128QwtPainterCommand::QwtPainterCommand(const QwtPainterCommand &other)
     
    214214
    215215//! \return Painter path to be painted
    216 QPainterPath *QwtPainterCommand::path() 
     216QPainterPath *QwtPainterCommand::path()
    217217{
    218218    return d_path;
     
    220220
    221221//! \return Attributes how to paint a QPixmap
    222 QwtPainterCommand::PixmapData* QwtPainterCommand::pixmapData() 
     222QwtPainterCommand::PixmapData* QwtPainterCommand::pixmapData()
    223223{
    224224    return d_pixmapData;
     
    226226
    227227//! \return Attributes how to paint a QImage
    228 QwtPainterCommand::ImageData* QwtPainterCommand::imageData() 
     228QwtPainterCommand::ImageData* QwtPainterCommand::imageData()
    229229{
    230230    return d_imageData;
     
    232232
    233233//! \return Attributes of a state change
    234 QwtPainterCommand::StateData* QwtPainterCommand::stateData() 
     234QwtPainterCommand::StateData* QwtPainterCommand::stateData()
    235235{
    236236    return d_stateData;
  • trunk/BNC/qwt/qwt_painter_command.h

    r8127 r9383  
    1616#include <qimage.h>
    1717#include <qpolygon.h>
     18#include <qpainterpath.h>
    1819
    1920class QPainterPath;
     
    2728  \sa QwtGraphic::commands()
    2829 */
    29  
     30
    3031class QWT_EXPORT QwtPainterCommand
    3132{
     
    5051    };
    5152
    52     //! Attributes how to paint a QPixmap 
     53    //! Attributes how to paint a QPixmap
    5354    struct PixmapData
    5455    {
     
    5859    };
    5960
    60     //! Attributes how to paint a QImage 
     61    //! Attributes how to paint a QImage
    6162    struct ImageData
    6263    {
     
    151152
    152153//! \return Attributes how to paint a QPixmap
    153 inline const QwtPainterCommand::PixmapData*
     154inline const QwtPainterCommand::PixmapData *
    154155QwtPainterCommand::pixmapData() const
    155156{
     
    158159
    159160//! \return Attributes how to paint a QImage
    160 inline const QwtPainterCommand::ImageData * 
     161inline const QwtPainterCommand::ImageData *
    161162QwtPainterCommand::imageData() const
    162163{
     
    165166
    166167//! \return Attributes of a state change
    167 inline const QwtPainterCommand::StateData * 
     168inline const QwtPainterCommand::StateData *
    168169QwtPainterCommand::stateData() const
    169170{
  • trunk/BNC/qwt/qwt_panner.cpp

    r8127 r9383  
    129129   \param modifiers Keyboard modifiers
    130130*/
    131 void QwtPanner::setAbortKey( int key, 
     131void QwtPanner::setAbortKey( int key,
    132132    Qt::KeyboardModifiers modifiers )
    133133{
     
    137137
    138138//! Get the abort key and modifiers
    139 void QwtPanner::getAbortKey( int &key, 
     139void QwtPanner::getAbortKey( int &key,
    140140    Qt::KeyboardModifiers &modifiers ) const
    141141{
     
    248248   fill the empty spaces by the background of the parent widget.
    249249
    250    \param pe Paint event
    251 */
    252 void QwtPanner::paintEvent( QPaintEvent *pe )
     250   \param event Paint event
     251*/
     252void QwtPanner::paintEvent( QPaintEvent *event )
    253253{
    254254    int dx = d_data->pos.x() - d_data->initialPos.x();
    255255    int dy = d_data->pos.y() - d_data->initialPos.y();
    256256
    257     QRect r( 0, 0, d_data->pixmap.width(), d_data->pixmap.height() );
    258     r.moveCenter( QPoint( r.center().x() + dx, r.center().y() + dy ) );
    259 
    260     QPixmap pm( size() );
     257    QRectF r;
     258    r.setSize( d_data->pixmap.size() );
     259#if QT_VERSION >= 0x050000
     260    r.setSize( r.size() / d_data->pixmap.devicePixelRatio() );
     261#endif
     262    r.moveCenter( QPointF( r.center().x() + dx, r.center().y() + dy ) );
     263
     264    QPixmap pm = QwtPainter::backingStore( this, size() );
    261265    QwtPainter::fillPixmap( parentWidget(), pm );
    262266
     
    267271        QPixmap masked = d_data->pixmap;
    268272        masked.setMask( d_data->contentsMask );
    269         painter.drawPixmap( r, masked );
     273        painter.drawPixmap( r.toRect(), masked );
    270274    }
    271275    else
    272276    {
    273         painter.drawPixmap( r, d_data->pixmap );
     277        painter.drawPixmap( r.toRect(), d_data->pixmap );
    274278    }
    275279
     
    280284
    281285    painter.begin( this );
    282     painter.setClipRegion( pe->region() );
     286    painter.setClipRegion( event->region() );
    283287    painter.drawPixmap( 0, 0, pm );
    284288}
  • trunk/BNC/qwt/qwt_panner.h

    r8127 r9383  
    4444    bool isEnabled() const;
    4545
    46     void setMouseButton( Qt::MouseButton, 
     46    void setMouseButton( Qt::MouseButton,
    4747        Qt::KeyboardModifiers = Qt::NoModifier );
    48     void getMouseButton( Qt::MouseButton &button, 
     48    void getMouseButton( Qt::MouseButton &button,
    4949        Qt::KeyboardModifiers & ) const;
    5050
  • trunk/BNC/qwt/qwt_picker.cpp

    r8127 r9383  
    5353    if ( l.x1() == l.x2() )
    5454    {
    55         region += QRect( l.x1() - pw2, l.y1(), 
     55        region += QRect( l.x1() - pw2, l.y1(),
    5656            pw, l.y2() ).normalized();
    5757    }
    5858    else if ( l.y1() == l.y2() )
    5959    {
    60         region += QRect( l.x1(), l.y1() - pw2, 
     60        region += QRect( l.x1(), l.y1() - pw2,
    6161            l.x2(), pw ).normalized();
    6262    }
     
    7878
    7979class QwtPickerTracker: public QwtWidgetOverlay
    80 {                                 
     80{
    8181public:
    8282    QwtPickerTracker( QwtPicker *, QWidget * );
    83    
     83
    8484protected:
    8585    virtual void drawOverlay( QPainter * ) const;
    8686    virtual QRegion maskHint() const;
    87    
     87
    8888    QwtPicker *d_picker;
    89 }; 
     89};
    9090
    9191
     
    105105    {
    106106    }
    107        
     107
    108108    bool enabled;
    109109
     
    558558                case VLineRubberBand:
    559559                {
    560                     mask += qwtMaskRegion( QLine( pos.x(), pRect.top(), 
     560                    mask += qwtMaskRegion( QLine( pos.x(), pRect.top(),
    561561                        pos.x(), pRect.bottom() ), pw );
    562562                    break;
     
    564564                case HLineRubberBand:
    565565                {
    566                     mask += qwtMaskRegion( QLine( pRect.left(), pos.y(), 
     566                    mask += qwtMaskRegion( QLine( pRect.left(), pos.y(),
    567567                        pRect.right(), pos.y() ), pw );
    568568                    break;
     
    570570                case CrossRubberBand:
    571571                {
    572                     mask += qwtMaskRegion( QLine( pos.x(), pRect.top(), 
     572                    mask += qwtMaskRegion( QLine( pos.x(), pRect.top(),
    573573                        pos.x(), pRect.bottom() ), pw );
    574                     mask += qwtMaskRegion( QLine( pRect.left(), pos.y(), 
     574                    mask += qwtMaskRegion( QLine( pRect.left(), pos.y(),
    575575                        pRect.right(), pos.y() ), pw );
    576576                    break;
     
    752752   depends on the application requirements. F.e. :
    753753
    754    - A rectangular selection might need to have a specific aspect ratio only.\n
    755    - A selection could accept non intersecting polygons only.\n
    756    - ...\n
     754     - A rectangular selection might need to have a specific aspect ratio only.
     755     - A selection could accept non intersecting polygons only.
     756     - ...
    757757
    758758   The example below is for a rectangular selection, where the first
    759759   point is the center of the selected rectangle.
     760
    760761  \par Example
    761   \verbatim QPolygon MyPicker::adjustedPoints(const QPolygon &points) const
    762 {
    763     QPolygon adjusted;
    764     if ( points.size() == 2 )
    765     {
    766         const int width = qAbs(points[1].x() - points[0].x());
    767         const int height = qAbs(points[1].y() - points[0].y());
    768 
    769         QRect rect(0, 0, 2 * width, 2 * height);
    770         rect.moveCenter(points[0]);
    771 
    772         adjusted += rect.topLeft();
    773         adjusted += rect.bottomRight();
    774     }
    775     return adjusted;
    776 }\endverbatim\n
     762  \code
     763    QPolygon MyPicker::adjustedPoints( const QPolygon &points ) const
     764    {
     765        QPolygon adjusted;
     766        if ( points.size() == 2 )
     767        {
     768            const int width = qAbs( points[1].x() - points[0].x() );
     769            const int height = qAbs( points[1].y() - points[0].y() );
     770
     771            QRect rect( 0, 0, 2 * width, 2 * height );
     772            rect.moveCenter( points[0] );
     773
     774            adjusted += rect.topLeft();
     775            adjusted += rect.bottomRight();
     776        }
     777        return adjusted;
     778    }
     779  \endcode
     780  \endpar
    777781
    778782  \param points Selected points
     
    833837    {
    834838        const QPoint last =
    835             d_data->pickedPoints[int( d_data->pickedPoints.count() ) - 2];
     839            d_data->pickedPoints[ d_data->pickedPoints.count() - 2 ];
    836840
    837841        alignment |= ( pos.x() >= last.x() ) ? Qt::AlignRight : Qt::AlignLeft;
     
    11831187        case QEvent::MouseMove:
    11841188        {
    1185             const QMouseEvent *me = 
     1189            const QMouseEvent *me =
    11861190                static_cast< const QMouseEvent * >( event );
    11871191            pos = me->pos();
     
    12351239        return;
    12361240
    1237     d_data->pickedPoints.resize( 0 );
     1241    d_data->pickedPoints.clear();
    12381242    d_data->isActive = true;
    12391243    Q_EMIT activated( true );
     
    12811285            Q_EMIT selected( d_data->pickedPoints );
    12821286        else
    1283             d_data->pickedPoints.resize( 0 );
     1287            d_data->pickedPoints.clear();
    12841288
    12851289        updateDisplay();
     
    13151319    if ( d_data->isActive )
    13161320    {
    1317         const int idx = d_data->pickedPoints.count();
    1318         d_data->pickedPoints.resize( idx + 1 );
    1319         d_data->pickedPoints[idx] = pos;
     1321        d_data->pickedPoints += pos;
    13201322
    13211323        updateDisplay();
     
    13331335void QwtPicker::move( const QPoint &pos )
    13341336{
    1335     if ( d_data->isActive )
    1336     {
    1337         const int idx = d_data->pickedPoints.count() - 1;
    1338         if ( idx >= 0 )
    1339         {
    1340             if ( d_data->pickedPoints[idx] != pos )
    1341             {
    1342                 d_data->pickedPoints[idx] = pos;
    1343 
    1344                 updateDisplay();
    1345                 Q_EMIT moved( pos );
    1346             }
     1337    if ( d_data->isActive && !d_data->pickedPoints.isEmpty() )
     1338    {
     1339        QPoint &point = d_data->pickedPoints.last();
     1340        if ( point != pos )
     1341        {
     1342            point = pos;
     1343
     1344            updateDisplay();
     1345            Q_EMIT moved( pos );
    13471346        }
    13481347    }
     
    13571356void QwtPicker::remove()
    13581357{
    1359     if ( d_data->isActive )
    1360     {
    1361         const int idx = d_data->pickedPoints.count() - 1;
    1362         if ( idx > 0 )
    1363         {
    1364             const int idx = d_data->pickedPoints.count();
    1365 
    1366             const QPoint pos = d_data->pickedPoints[idx - 1];
    1367             d_data->pickedPoints.resize( idx - 1 );
    1368 
    1369             updateDisplay();
    1370             Q_EMIT removed( pos );
    1371         }
     1358    if ( d_data->isActive && !d_data->pickedPoints.isEmpty() )
     1359    {
     1360#if QT_VERSION >= 0x050100
     1361        const QPoint pos = d_data->pickedPoints.takeLast();
     1362#else
     1363        const QPoint pos = d_data->pickedPoints.last();
     1364        d_data->pickedPoints.resize( d_data->pickedPoints.count() - 1 );
     1365#endif
     1366
     1367        updateDisplay();
     1368        Q_EMIT removed( pos );
    13721369    }
    13731370}
     
    14241421    }
    14251422
    1426     const double xRatio =
    1427         double( newSize.width() ) / double( oldSize.width() );
    1428     const double yRatio =
    1429         double( newSize.height() ) / double( oldSize.height() );
    1430 
    1431     for ( int i = 0; i < int( d_data->pickedPoints.count() ); i++ )
     1423    const double xRatio = double( newSize.width() ) / double( oldSize.width() );
     1424    const double yRatio = double( newSize.height() ) / double( oldSize.height() );
     1425
     1426    for ( int i = 0; i < d_data->pickedPoints.count(); i++ )
    14321427    {
    14331428        QPoint &p = d_data->pickedPoints[i];
     
    14721467  Find the area of the observed widget, where selection might happen.
    14731468
    1474   \return parentWidget()->contentsRect() 
     1469  \return parentWidget()->contentsRect()
    14751470*/
    14761471QPainterPath QwtPicker::pickArea() const
     
    15041499            ( trackerMode() == ActiveOnly && isActive() ) )
    15051500        {
    1506             if ( trackerPen() != Qt::NoPen 
     1501            if ( trackerPen() != Qt::NoPen
    15071502                && !trackerRect( QFont() ).isEmpty() )
    15081503            {
  • trunk/BNC/qwt/qwt_picker.h

    r8127 r9383  
    5959
    6060  \par Example
    61   \verbatim #include <qwt_picker.h>
    62 #include <qwt_picker_machine.h>
    63 
    64 QwtPicker *picker = new QwtPicker(widget);
    65 picker->setStateMachine(new QwtPickerDragRectMachine);
    66 picker->setTrackerMode(QwtPicker::ActiveOnly);
    67 picker->setRubberBand(QwtPicker::RectRubberBand); \endverbatim\n
     61  \code
     62    #include <qwt_picker.h>
     63    #include <qwt_picker_machine.h>
     64
     65    QwtPicker *picker = new QwtPicker(widget);
     66    picker->setStateMachine(new QwtPickerDragRectMachine);
     67    picker->setTrackerMode(QwtPicker::ActiveOnly);
     68    picker->setRubberBand(QwtPicker::RectRubberBand);
     69  \endcode
     70  \endpar
    6871
    6972  The state machine triggers the following commands:
     
    308311    virtual void widgetLeaveEvent( QEvent * );
    309312
    310     virtual void stretchSelection( const QSize &oldSize,
    311                                   const QSize &newSize );
     313    virtual void stretchSelection(
     314        const QSize &oldSize, const QSize &newSize );
    312315
    313316    virtual void updateDisplay();
  • trunk/BNC/qwt/qwt_picker_machine.cpp

    r8127 r9383  
    106106        case QEvent::MouseButtonPress:
    107107        {
    108             if ( eventPattern.mouseMatch( QwtEventPattern::MouseSelect1, 
     108            if ( eventPattern.mouseMatch( QwtEventPattern::MouseSelect1,
    109109                static_cast<const QMouseEvent *>( event ) ) )
    110110            {
     
    152152        case QEvent::MouseButtonPress:
    153153        {
    154             if ( eventPattern.mouseMatch( QwtEventPattern::MouseSelect1, 
     154            if ( eventPattern.mouseMatch( QwtEventPattern::MouseSelect1,
    155155                static_cast<const QMouseEvent *>( event ) ) )
    156156            {
     
    225225        case QEvent::MouseButtonPress:
    226226        {
    227             if ( eventPattern.mouseMatch( QwtEventPattern::MouseSelect1, 
     227            if ( eventPattern.mouseMatch( QwtEventPattern::MouseSelect1,
    228228                static_cast<const QMouseEvent *>( event ) ) )
    229229            {
     
    260260        case QEvent::MouseButtonRelease:
    261261        {
    262             if ( eventPattern.mouseMatch( QwtEventPattern::MouseSelect1, 
     262            if ( eventPattern.mouseMatch( QwtEventPattern::MouseSelect1,
    263263                static_cast<const QMouseEvent *>( event ) ) )
    264264            {
     
    324324        case QEvent::MouseButtonPress:
    325325        {
    326             if ( eventPattern.mouseMatch( QwtEventPattern::MouseSelect1, 
     326            if ( eventPattern.mouseMatch( QwtEventPattern::MouseSelect1,
    327327                static_cast<const QMouseEvent *>( event ) ) )
    328328            {
     
    355355        case QEvent::KeyPress:
    356356        {
    357             if ( eventPattern.keyMatch( QwtEventPattern::KeySelect1, 
     357            if ( eventPattern.keyMatch( QwtEventPattern::KeySelect1,
    358358                static_cast<const QKeyEvent *> ( event ) ) )
    359359            {
     
    396396        case QEvent::MouseButtonPress:
    397397        {
    398             if ( eventPattern.mouseMatch( QwtEventPattern::MouseSelect1, 
     398            if ( eventPattern.mouseMatch( QwtEventPattern::MouseSelect1,
    399399                static_cast<const QMouseEvent *>( event ) ) )
    400400            {
     
    411411                }
    412412            }
    413             if ( eventPattern.mouseMatch( QwtEventPattern::MouseSelect2, 
     413            if ( eventPattern.mouseMatch( QwtEventPattern::MouseSelect2,
    414414                static_cast<const QMouseEvent *>( event ) ) )
    415415            {
  • trunk/BNC/qwt/qwt_picker_machine.h

    r8127 r9383  
    170170/*!
    171171  \brief A state machine for line selections
    172    
     172
    173173  Pressing QwtEventPattern::MouseSelect1 selects
    174174  the first point, releasing it the second point.
     
    179179  A common use case of QwtPickerDragLineMachine are pickers for
    180180  distance measurements.
    181  
    182   \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode
    183 */             
    184                    
     181
     182  \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode
     183*/
     184
    185185class QWT_EXPORT QwtPickerDragLineMachine: public QwtPickerMachine
    186186{
  • trunk/BNC/qwt/qwt_plot.cpp

    r8127 r9383  
    2828    if ( on )
    2929    {
    30         QObject::connect(
    31             plot, SIGNAL( legendDataChanged(
    32                 const QVariant &, const QList<QwtLegendData> & ) ),
    33             plot, SLOT( updateLegendItems(
    34                 const QVariant &, const QList<QwtLegendData> & ) ) );
     30        QObject::connect(
     31            plot, SIGNAL(legendDataChanged(QVariant,QList<QwtLegendData>)),
     32            plot, SLOT(updateLegendItems(QVariant,QList<QwtLegendData>))
     33        );
    3534    }
    3635    else
    3736    {
    38         QObject::disconnect(
    39             plot, SIGNAL( legendDataChanged(
    40                 const QVariant &, const QList<QwtLegendData> & ) ),
    41             plot, SLOT( updateLegendItems(
    42                 const QVariant &, const QList<QwtLegendData> & ) ) );
    43     }
    44 }
    45 
    46 static void qwtSetTabOrder(
     37        QObject::disconnect(
     38            plot, SIGNAL(legendDataChanged(QVariant,QList<QwtLegendData>) ),
     39            plot, SLOT( updateLegendItems(QVariant,QList<QwtLegendData>))
     40        );
     41    }
     42}
     43
     44static void qwtSetTabOrder(
    4745    QWidget *first, QWidget *second, bool withChildren )
    4846{
     
    196194  QwtPlot invokes methods of the canvas as meta methods ( see QMetaObject ).
    197195  In opposite to using conventional C++ techniques like virtual methods
    198   they allow to use canvas implementations that are derived from 
     196  they allow to use canvas implementations that are derived from
    199197  QWidget or QGLWidget.
    200198
     
    210208    it is o.k. not to implement this method.
    211209
    212   The default canvas is a QwtPlotCanvas 
     210  The default canvas is a QwtPlotCanvas
    213211
    214212  \param canvas Canvas Widget
     
    317315}
    318316
    319 /*! 
     317/*!
    320318  \return true if the autoReplot option is set.
    321319  \sa setAutoReplot()
     
    371369
    372370/*!
    373   Change the text the footer 
     371  Change the text the footer
    374372  \param text New text of the footer
    375373*/
     
    384382
    385383/*!
    386   Change the text the footer 
     384  Change the text the footer
    387385  \param text New text of the footer
    388386*/
     
    560558    if ( d_data->canvas )
    561559    {
    562         const bool ok = QMetaObject::invokeMethod( 
     560        const bool ok = QMetaObject::invokeMethod(
    563561            d_data->canvas, "replot", Qt::DirectConnection );
    564562        if ( !ok )
     
    724722    getCanvasMarginsHint( maps, canvas()->contentsRect(),
    725723        margins[yLeft], margins[xTop], margins[yRight], margins[xBottom] );
    726    
     724
    727725    bool doUpdate = false;
    728726    for ( int axisId = 0; axisId < axisCnt; axisId++ )
     
    766764
    767765  \note Usually canvasRect is contentsRect() of the plot canvas.
    768         Due to a bug in Qt this rectangle might be wrong for certain 
    769         frame styles ( f.e QFrame::Box ) and it might be necessary to 
     766        Due to a bug in Qt this rectangle might be wrong for certain
     767        frame styles ( f.e QFrame::Box ) and it might be necessary to
    770768        fix the margins manually using QWidget::setContentsMargins()
    771769*/
     
    914912
    915913  insertLegend() will set the plot widget as parent for the legend.
    916   The legend will be deleted in the destructor of the plot or when 
     914  The legend will be deleted in the destructor of the plot or when
    917915  another legend is inserted.
    918916
     
    952950        if ( d_data->legend )
    953951        {
    954             connect( this,
    955                 SIGNAL( legendDataChanged(
    956                     const QVariant &, const QList<QwtLegendData> & ) ),
    957                 d_data->legend,
    958                 SLOT( updateLegend(
    959                     const QVariant &, const QList<QwtLegendData> & ) )
     952            connect(
     953                this, SIGNAL(legendDataChanged(QVariant,QList<QwtLegendData>)),
     954                d_data->legend, SLOT(updateLegend(QVariant,QList<QwtLegendData>) )
    960955            );
    961956
     
    10881083
    10891084/*!
    1090   \brief Attach/Detach a plot item 
     1085  \brief Attach/Detach a plot item
    10911086
    10921087  \param plotItem Plot item
     
    11161111    if ( on )
    11171112        insertItem( plotItem );
    1118     else 
     1113    else
    11191114        removeItem( plotItem );
    11201115
     
    11681163         that has bee generated from itemToInfo().
    11691164
    1170   The default implementation simply tries to unwrap a QwtPlotItem 
     1165  The default implementation simply tries to unwrap a QwtPlotItem
    11711166  pointer:
    11721167
  • trunk/BNC/qwt/qwt_plot.h

    r8127 r9383  
    4141  can be configured separately for each axis.
    4242
    43   The simpleplot example is a good starting point to see how to set up a 
     43  The simpleplot example is a good starting point to see how to set up a
    4444  plot widget.
    4545
     
    4747
    4848  \par Example
    49   The following example shows (schematically) the most simple
    50   way to use QwtPlot. By default, only the left and bottom axes are
    51   visible and their scales are computed automatically.
    52   \verbatim
    53 #include <qwt_plot.h>
    54 #include <qwt_plot_curve.h>
    55 
    56 QwtPlot *myPlot = new QwtPlot("Two Curves", parent);
    57 
    58 // add curves
    59 QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
    60 QwtPlotCurve *curve2 = new QwtPlotCurve("Curve 2");
    61 
    62 // connect or copy the data to the curves
    63 curve1->setData(...);
    64 curve2->setData(...);
    65 
    66 curve1->attach(myPlot);
    67 curve2->attach(myPlot);
    68 
    69 // finally, refresh the plot
    70 myPlot->replot();
    71 \endverbatim
     49    The following example shows (schematically) the most simple
     50    way to use QwtPlot. By default, only the left and bottom axes are
     51    visible and their scales are computed automatically.
     52    \code
     53      #include <qwt_plot.h>
     54      #include <qwt_plot_curve.h>
     55
     56      QwtPlot *myPlot = new QwtPlot( "Two Curves", parent );
     57
     58      // add curves
     59      QwtPlotCurve *curve1 = new QwtPlotCurve( "Curve 1" );
     60      QwtPlotCurve *curve2 = new QwtPlotCurve( "Curve 2" );
     61
     62      // connect or copy the data to the curves
     63      curve1->setData( ... );
     64      curve2->setData( ... );
     65
     66      curve1->attach( myPlot );
     67      curve2->attach( myPlot );
     68
     69      // finally, refresh the plot
     70      myPlot->replot();
     71    \endcode
     72  \endpar
    7273*/
    7374
     
    7677    Q_OBJECT
    7778
    78     Q_PROPERTY( QBrush canvasBackground 
     79    Q_PROPERTY( QBrush canvasBackground
    7980        READ canvasBackground WRITE setCanvasBackground )
    8081    Q_PROPERTY( bool autoReplot READ autoReplot WRITE setAutoReplot )
     
    122123        RightLegend,
    123124
    124         //! The legend will be below the footer 
     125        //! The legend will be below the footer
    125126        BottomLegend,
    126127
     
    150151
    151152    void setTitle( const QString & );
    152     void setTitle( const QwtText &t );
     153    void setTitle( const QwtText & );
    153154    QwtText title() const;
    154155
     
    159160
    160161    void setFooter( const QString & );
    161     void setFooter( const QwtText &t );
     162    void setFooter( const QwtText & );
    162163    QwtText footer() const;
    163164
     
    192193    bool axisEnabled( int axisId ) const;
    193194
    194     void setAxisFont( int axisId, const QFont &f );
     195    void setAxisFont( int axisId, const QFont & );
    195196    QFont axisFont( int axisId ) const;
    196197
    197     void setAxisScale( int axisId, double min, double max, double step = 0 );
     198    void setAxisScale( int axisId, double min, double max, double stepSize = 0 );
    198199    void setAxisScaleDiv( int axisId, const QwtScaleDiv & );
    199200    void setAxisScaleDraw( int axisId, QwtScaleDraw * );
     
    225226    // Legend
    226227
    227     void insertLegend( QwtAbstractLegend *, 
     228    void insertLegend( QwtAbstractLegend *,
    228229        LegendPosition = QwtPlot::RightLegend, double ratio = -1.0 );
    229230
     
    245246    void updateCanvasMargins();
    246247
    247     virtual void getCanvasMarginsHint( 
     248    virtual void getCanvasMarginsHint(
    248249        const QwtScaleMap maps[], const QRectF &canvasRect,
    249250        double &left, double &top, double &right, double &bottom) const;
     
    268269
    269270    /*!
    270       A signal with the attributes how to update 
     271      A signal with the attributes how to update
    271272      the legend entries for a plot item.
    272273
     
    277278      \sa itemToInfo(), infoToItem(), QwtAbstractLegend::updateLegend()
    278279     */
    279     void legendDataChanged( const QVariant &itemInfo, 
     280    void legendDataChanged( const QVariant &itemInfo,
    280281        const QList<QwtLegendData> &data );
    281282
     
    291292private Q_SLOTS:
    292293    void updateLegendItems( const QVariant &itemInfo,
    293         const QList<QwtLegendData> &data );
     294        const QList<QwtLegendData> &legendData );
    294295
    295296private:
  • trunk/BNC/qwt/qwt_plot_abstract_barchart.cpp

    r8127 r9383  
    181181   \brief Set the baseline
    182182
    183    The baseline is the origin for the chart. Each bar is 
    184    painted from the baseline in the direction of the sample 
     183   The baseline is the origin for the chart. Each bar is
     184   painted from the baseline in the direction of the sample
    185185   value. In case of a horizontal orientation() the baseline
    186186   is interpreted as x - otherwise as y - value.
     
    201201}
    202202
    203 /*! 
     203/*!
    204204   \return Value for the origin of the bar chart
    205205   \sa setBaseline(), QwtPlotSeriesItem::orientation()
     
    286286       QwtPlot::getCanvasMarginsHint(), QwtPlot::updateCanvasMargins()
    287287 */
    288 void QwtPlotAbstractBarChart::getCanvasMarginHint( const QwtScaleMap &xMap, 
     288void QwtPlotAbstractBarChart::getCanvasMarginHint( const QwtScaleMap &xMap,
    289289    const QwtScaleMap &yMap, const QRectF &canvasRect,
    290290    double &left, double &top, double &right, double &bottom ) const
  • trunk/BNC/qwt/qwt_plot_abstract_barchart.h

    r8127 r9383  
    1818  \brief Abstract base class for bar chart items
    1919
    20   In opposite to almost all other plot items bar charts can't be 
     20  In opposite to almost all other plot items bar charts can't be
    2121  displayed inside of their bounding rectangle and need a special
    2222  API  how to calculate the width of the bars and how they affect
     
    7979    double baseline() const;
    8080
    81     virtual void getCanvasMarginHint( 
     81    virtual void getCanvasMarginHint(
    8282        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    8383        const QRectF &canvasRect,
     
    8787protected:
    8888    double sampleWidth( const QwtScaleMap &map,
    89         double canvasSize, double dataSize,
     89        double canvasSize, double boundingSize,
    9090        double value ) const;
    9191
  • trunk/BNC/qwt/qwt_plot_axis.cpp

    r8127 r9383  
    6868        d.scaleEngine = new QwtLinearScaleEngine;
    6969
    70         d.scaleWidget->setTransformation( 
     70        d.scaleWidget->setTransformation(
    7171            d.scaleEngine->transformation() );
    7272
     
    148148        d.scaleEngine = scaleEngine;
    149149
    150         d_axisData[axisId]->scaleWidget->setTransformation( 
     150        d_axisData[axisId]->scaleWidget->setTransformation(
    151151            scaleEngine->transformation() );
    152152
     
    190190    else
    191191        return false;
    192 
    193192}
    194193
     
    289288
    290289/*!
    291   \brief Return the step size parameter that has been set in setAxisScale. 
     290  \brief Return the step size parameter that has been set in setAxisScale.
    292291
    293292  This doesn't need to be the step size of the current scale.
     
    310309
    311310  This is only a convenience function for axisScaleDiv( axisId )->interval();
    312  
     311
    313312  \param axisId Axis index
    314313  \return Scale interval
     
    434433  \brief Disable autoscaling and specify a fixed scale for a selected axis.
    435434
    436   In updateAxes() the scale engine calculates a scale division from the 
    437   specified parameters, that will be assigned to the scale widget. So 
     435  In updateAxes() the scale engine calculates a scale division from the
     436  specified parameters, that will be assigned to the scale widget. So
    438437  updates of the scale widget usually happen delayed with the next replot.
    439438
     
    467466
    468467  The scale division will be stored locally only until the next call
    469   of updateAxes(). So updates of the scale widget usually happen delayed with 
     468  of updateAxes(). So updates of the scale widget usually happen delayed with
    470469  the next replot.
    471470
     
    615614}
    616615
    617 /*! 
     616/*!
    618617  \brief Rebuild the axes scales
    619618
    620   In case of autoscaling the boundaries of a scale are calculated 
    621   from the bounding rectangles of all plot items, having the 
    622   QwtPlotItem::AutoScale flag enabled ( QwtScaleEngine::autoScale() ). 
    623   Then a scale division is calculated ( QwtScaleEngine::didvideScale() ) 
     619  In case of autoscaling the boundaries of a scale are calculated
     620  from the bounding rectangles of all plot items, having the
     621  QwtPlotItem::AutoScale flag enabled ( QwtScaleEngine::autoScale() ).
     622  Then a scale division is calculated ( QwtScaleEngine::didvideScale() )
    624623  and assigned to scale widget.
    625624
    626   When the scale boundaries have been assigned with setAxisScale() a 
     625  When the scale boundaries have been assigned with setAxisScale() a
    627626  scale division is calculated ( QwtScaleEngine::didvideScale() )
    628627  for this interval and assigned to the scale widget.
    629628
    630   When the scale has been set explicitly by setAxisScaleDiv() the 
     629  When the scale has been set explicitly by setAxisScaleDiv() the
    631630  locally stored scale division gets assigned to the scale widget.
    632631
    633   The scale widget indicates modifications by emitting a 
     632  The scale widget indicates modifications by emitting a
    634633  QwtScaleWidget::scaleDivChanged() signal.
    635634
    636   updateAxes() is usually called by replot(). 
     635  updateAxes() is usually called by replot().
    637636
    638637  \sa setAxisAutoScale(), setAxisScale(), setAxisScaleDiv(), replot()
  • trunk/BNC/qwt/qwt_plot_barchart.cpp

    r8127 r9383  
    2222    {
    2323    }
    24  
     24
    2525    ~PrivateData()
    2626    {
     
    121121
    122122  The bar chart will take the ownership of the symbol, hence the previously
    123   set symbol will be delete by setting a new one. If \p symbol is 
     123  set symbol will be delete by setting a new one. If \p symbol is
    124124  \c NULL no symbol will be drawn.
    125125
     
    305305
    306306/*!
    307   Draw a bar 
     307  Draw a bar
    308308
    309309  \param painter Painter
     
    313313 */
    314314void QwtPlotBarChart::drawBar( QPainter *painter,
    315     int sampleIndex, const QPointF &sample, 
     315    int sampleIndex, const QPointF &sample,
    316316    const QwtColumnRect &rect ) const
    317317{
    318     const QwtColumnSymbol *specialSym = 
     318    const QwtColumnSymbol *specialSym =
    319319        specialSymbol( sampleIndex, sample );
    320320
     
    330330    {
    331331        // we build a temporary default symbol
    332         QwtColumnSymbol sym( QwtColumnSymbol::Box );
    333         sym.setLineWidth( 1 );
    334         sym.setFrameStyle( QwtColumnSymbol::Plain );
    335         sym.draw( painter, rect );
     332        QwtColumnSymbol columnSymbol( QwtColumnSymbol::Box );
     333        columnSymbol.setLineWidth( 1 );
     334        columnSymbol.setFrameStyle( QwtColumnSymbol::Plain );
     335        columnSymbol.draw( painter, rect );
    336336    }
    337337
     
    340340
    341341/*!
    342   Needs to be overloaded to return a 
     342  Needs to be overloaded to return a
    343343  non default symbol for a specific sample
    344344
     
    348348  \return NULL, indicating to use the default symbol
    349349 */
    350 QwtColumnSymbol *QwtPlotBarChart::specialSymbol( 
     350QwtColumnSymbol *QwtPlotBarChart::specialSymbol(
    351351    int sampleIndex, const QPointF &sample ) const
    352352{
     
    429429   displays the default symbol.
    430430
    431    \param index Index of the legend entry 
     431   \param index Index of the legend entry
    432432   \param size Icon size
    433433
    434    \sa setLegendMode(), drawBar(), 
     434   \sa setLegendMode(), drawBar(),
    435435       QwtPlotItem::setLegendIconSize(), QwtPlotItem::legendData()
    436436 */
    437 QwtGraphic QwtPlotBarChart::legendIcon( 
     437QwtGraphic QwtPlotBarChart::legendIcon(
    438438    int index, const QSizeF &size ) const
    439439{
     
    453453    if ( d_data->legendMode == QwtPlotBarChart::LegendBarTitles )
    454454        barIndex = index;
    455        
     455
    456456    drawBar( &painter, barIndex, QPointF(), column );
    457457
  • trunk/BNC/qwt/qwt_plot_barchart.h

    r8127 r9383  
    2424  a specialSymbol(). Otherwise it is rendered using a default symbol.
    2525
    26   Depending on its orientation() the bars are displayed horizontally 
    27   or vertically. The bars cover the interval between the baseline() 
     26  Depending on its orientation() the bars are displayed horizontally
     27  or vertically. The bars cover the interval between the baseline()
    2828  and the value.
    2929
     
    5151    enum LegendMode
    5252    {
    53         /*! 
     53        /*!
    5454          One entry on the legend showing the default symbol
    5555          and the title() of the chart
     
    6868    };
    6969
    70     explicit QwtPlotBarChart( const QString &title = QString::null );
     70    explicit QwtPlotBarChart( const QString &title = QString() );
    7171    explicit QwtPlotBarChart( const QwtText &title );
    7272
     
    7777    void setSamples( const QVector<QPointF> & );
    7878    void setSamples( const QVector<double> & );
    79     void setSamples( QwtSeriesData<QPointF> *series );
     79    void setSamples( QwtSeriesData<QPointF> * );
    8080
    8181    void setSymbol( QwtColumnSymbol * );
     
    9191    virtual QRectF boundingRect() const;
    9292
    93     virtual QwtColumnSymbol *specialSymbol( 
     93    virtual QwtColumnSymbol *specialSymbol(
    9494        int sampleIndex, const QPointF& ) const;
    9595
     
    103103
    104104    virtual void drawBar( QPainter *,
    105         int sampleIndex, const QPointF& point,
     105        int sampleIndex, const QPointF& sample,
    106106        const QwtColumnRect & ) const;
    107107
  • trunk/BNC/qwt/qwt_plot_canvas.cpp

    r8127 r9383  
    4949    }
    5050
     51    virtual void drawRects(const QRect *rects, int count )
     52    {
     53        // to silence -Woverloaded-virtual
     54        QwtNullPaintDevice::drawRects( rects, count );
     55    }
     56
    5157    virtual void drawPath( const QPainterPath &path )
    5258    {
     
    7379        for ( int i = 0; i < path.elementCount(); i++ )
    7480        {
    75             QPainterPath::Element el = path.elementAt(i); 
     81            QPainterPath::Element el = path.elementAt(i);
    7682            switch( el.type )
    7783            {
     
    98104                    {
    99105                        QRectF r = clipRects.last();
    100                         r.setCoords( 
     106                        r.setCoords(
    101107                            qMin( r.left(), el.x ),
    102108                            qMin( r.top(), el.y ),
     
    170176        painter->setClipPath( borderClip, Qt::IntersectClip );
    171177
    172     const QBrush &brush = 
     178    const QBrush &brush =
    173179        canvas->palette().brush( canvas->backgroundRole() );
    174180
     
    186192        {
    187193            rects += canvas->rect();
    188         } 
    189         else 
     194        }
     195        else
    190196        {
    191197            rects = painter->clipRegion().rects();
     
    197203        if ( painter->paintEngine()->type() == QPaintEngine::X11 )
    198204        {
    199             // Qt 4.7.1: gradients on X11 are broken ( subrects + 
     205            // Qt 4.7.1: gradients on X11 are broken ( subrects +
    200206            // QGradient::StretchToDeviceMode ) and horrible slow.
    201207            // As workaround we have to use the raster paintengine.
     
    223229                }
    224230            }
    225            
     231
    226232            QImage image( canvas->size(), format );
    227233
     
    268274}
    269275
    270 static QPainterPath qwtCombinePathList( const QRectF &rect, 
     276static QPainterPath qwtCombinePathList( const QRectF &rect,
    271277    const QList<QPainterPath> &pathList )
    272278{
     
    286292            if ( br.center().y() < rect.center().y() )
    287293            {
    288                 if ( qAbs( br.top() - rect.top() ) < 
     294                if ( qAbs( br.top() - rect.top() ) <
    289295                    qAbs( br.left() - rect.left() ) )
    290296                {
     
    298304            else
    299305            {
    300                 if ( qAbs( br.bottom() - rect.bottom() ) < 
     306                if ( qAbs( br.bottom() - rect.bottom() ) <
    301307                    qAbs( br.left() - rect.left() ) )
    302308                {
     
    316322            if ( br.center().y() < rect.center().y() )
    317323            {
    318                 if ( qAbs( br.top() - rect.top() ) < 
     324                if ( qAbs( br.top() - rect.top() ) <
    319325                    qAbs( br.right() - rect.right() ) )
    320326                {
     
    328334            else
    329335            {
    330                 if ( qAbs( br.bottom() - rect.bottom() ) < 
     336                if ( qAbs( br.bottom() - rect.bottom() ) <
    331337                    qAbs( br.right() - rect.right() ) )
    332338                {
     
    340346            if ( subPath.currentPosition().y() < br.center().y() )
    341347                qwtRevertPath( subPath );
    342         }   
     348        }
    343349        ordered[index] = subPath;
    344350    }
     
    381387}
    382388
    383 static inline void qwtDrawStyledBackground( 
     389static inline void qwtDrawStyledBackground(
    384390    QWidget *w, QPainter *painter )
    385391{
     
    418424}
    419425
    420 static void qwtFillBackground( QPainter *painter, 
     426static void qwtFillBackground( QPainter *painter,
    421427    QWidget *widget, const QVector<QRectF> &fillRects )
    422428{
     
    521527};
    522528
    523 /*! 
     529/*!
    524530  \brief Constructor
    525531
     
    595601                    *d_data->backingStore = grab( rect() );
    596602#else
    597                     *d_data->backingStore = 
     603                    *d_data->backingStore =
    598604                        QPixmap::grabWidget( this, rect() );
    599605#endif
     
    695701bool QwtPlotCanvas::event( QEvent *event )
    696702{
    697     if ( event->type() == QEvent::PolishRequest ) 
     703    if ( event->type() == QEvent::PolishRequest )
    698704    {
    699705        if ( testPaintAttribute( QwtPlotCanvas::Opaque ) )
    700706        {
    701             // Setting a style sheet changes the 
     707            // Setting a style sheet changes the
    702708            // Qt::WA_OpaquePaintEvent attribute, but we insist
    703709            // on painting the background.
    704            
     710
    705711            setAttribute( Qt::WA_OpaquePaintEvent, true );
    706712        }
    707713    }
    708714
    709     if ( event->type() == QEvent::PolishRequest || 
     715    if ( event->type() == QEvent::PolishRequest ||
    710716        event->type() == QEvent::StyleChange )
    711717    {
     
    729735    {
    730736        QPixmap &bs = *d_data->backingStore;
    731         if ( bs.size() != size() )
     737
     738        qreal pixelRatio = 1.0;
     739
     740#if QT_VERSION >= 0x050000
     741        pixelRatio = bs.devicePixelRatio();
     742#endif
     743
     744        if ( bs.size() != size() * pixelRatio )
    732745        {
    733746            bs = QwtPainter::backingStore( this, size() );
     
    806819            drawCanvas( &painter, false );
    807820
    808             if ( frameWidth() > 0 ) 
     821            if ( frameWidth() > 0 )
    809822                drawBorder( &painter );
    810823        }
     
    815828}
    816829
    817 void QwtPlotCanvas::drawCanvas( QPainter *painter, bool withBackground ) 
     830void QwtPlotCanvas::drawCanvas( QPainter *painter, bool withBackground )
    818831{
    819832    bool hackStyledBackground = false;
    820833
    821     if ( withBackground && testAttribute( Qt::WA_StyledBackground ) 
     834    if ( withBackground && testAttribute( Qt::WA_StyledBackground )
    822835        && testPaintAttribute( HackStyledBackground ) )
    823836    {
    824837        // Antialiasing rounded borders is done by
    825         // inserting pixels with colors between the 
     838        // inserting pixels with colors between the
    826839        // border color and the color on the canvas,
    827840        // When the border is painted before the plot items
     
    853866
    854867                painter->setPen( Qt::NoPen );
    855                 painter->setBrush( d_data->styleSheet.background.brush ); 
     868                painter->setBrush( d_data->styleSheet.background.brush );
    856869                painter->setBrushOrigin( d_data->styleSheet.background.origin );
    857870                painter->setClipPath( d_data->styleSheet.borderPath );
     
    894907    if ( !d_data->styleSheet.borderPath.isEmpty() )
    895908    {
    896         painter->setClipPath( 
     909        painter->setClipPath(
    897910            d_data->styleSheet.borderPath, Qt::IntersectClip );
    898911    }
     
    930943        if ( frameWidth() > 0 )
    931944        {
    932             QwtPainter::drawRoundedFrame( painter, QRectF( frameRect() ), 
     945            QwtPainter::drawRoundedFrame( painter, QRectF( frameRect() ),
    933946                d_data->borderRadius, d_data->borderRadius,
    934947                palette(), frameWidth(), frameStyle() );
     
    953966#endif
    954967
    955         switch (frameShape) 
     968        switch (frameShape)
    956969        {
    957970            case QFrame::Box:
     
    963976                opt.lineWidth = lineWidth();
    964977                opt.midLineWidth = midLineWidth();
    965                 break; 
    966             }
    967             default: 
     978                break;
     979            }
     980            default:
    968981            {
    969982                opt.lineWidth = frameWidth();
     
    971984            }
    972985        }
    973    
     986
    974987        if ( frameShadow == Sunken )
    975988            opt.state |= QStyle::State_Sunken;
     
    10301043
    10311044    QwtStyleSheetRecorder recorder( size() );
    1032    
     1045
    10331046    QPainter painter( &recorder );
    1034    
     1047
    10351048    QStyleOption opt;
    10361049    opt.initFrom(this);
    10371050    style()->drawPrimitive( QStyle::PE_Widget, &opt, &painter, this);
    1038    
     1051
    10391052    painter.end();
    10401053
     
    10461059        if ( !recorder.border.rectList.isEmpty() )
    10471060        {
    1048             d_data->styleSheet.borderPath = 
     1061            d_data->styleSheet.borderPath =
    10491062                qwtCombinePathList( rect(), recorder.border.pathList );
    10501063        }
     
    10971110        return path;
    10981111    }
    1099    
     1112
    11001113    return QPainterPath();
    11011114}
  • trunk/BNC/qwt/qwt_plot_canvas.h

    r8127 r9383  
    2020/*!
    2121  \brief Canvas of a QwtPlot.
    22  
     22
    2323   Canvas is the widget where all plot items are displayed
    2424
     
    4343    {
    4444        /*!
    45           \brief Paint double buffered reusing the content 
    46                  of the pixmap buffer when possible. 
     45          \brief Paint double buffered reusing the content
     46                 of the pixmap buffer when possible.
    4747
    4848          Using a backing store might improve the performance
     
    6060
    6161          When using styled backgrounds Qt assumes, that the
    62           canvas doesn't fill its area completely 
     62          canvas doesn't fill its area completely
    6363          ( f.e because of rounded borders ) and fills the area
    6464          below the canvas. When this is done with gradients it might
     
    6666
    6767          When the Opaque attribute is enabled the canvas tries to
    68           identify the gaps with some heuristics and to fill those only. 
     68          identify the gaps with some heuristics and to fill those only.
    6969
    70           \warning Will not work for semitransparent backgrounds 
     70          \warning Will not work for semitransparent backgrounds
    7171         */
    7272        Opaque       = 2,
  • trunk/BNC/qwt/qwt_plot_curve.cpp

    r8127 r9383  
    2525static void qwtUpdateLegendIconSize( QwtPlotCurve *curve )
    2626{
    27     if ( curve->symbol() && 
     27    if ( curve->symbol() &&
    2828        curve->testLegendAttribute( QwtPlotCurve::LegendShowSymbol ) )
    2929    {
     
    6868        symbol( NULL ),
    6969        attributes( 0 ),
    70         paintAttributes( 
     70        paintAttributes(
    7171            QwtPlotCurve::ClipPolygons | QwtPlotCurve::FilterPoints ),
    7272        legendAttributes( 0 )
     
    225225
    226226  The curve will take the ownership of the symbol, hence the previously
    227   set symbol will be delete by setting a new one. If \p symbol is 
     227  set symbol will be delete by setting a new one. If \p symbol is
    228228  \c NULL no symbol will be drawn.
    229229
     
    475475
    476476        if ( !doFit && !doFill )
    477             doIntegers = true; 
     477            doIntegers = true;
    478478    }
    479479#endif
     
    488488    if ( doIntegers )
    489489    {
    490         QPolygon polyline = mapper.toPolygon( 
     490        QPolygon polyline = mapper.toPolygon(
    491491            xMap, yMap, data(), from, to );
    492492
    493493        if ( d_data->paintAttributes & ClipPolygons )
    494494        {
    495             polyline = QwtClipper::clipPolygon( 
     495            polyline = QwtClipper::clipPolygon(
    496496                clipRect.toAlignedRect(), polyline, false );
    497497        }
     
    519519                if ( d_data->paintAttributes & ClipPolygons )
    520520                {
    521                     polyline = QwtClipper::clipPolygonF( 
     521                    polyline = QwtClipper::clipPolygonF(
    522522                        clipRect, polyline, false );
    523523                }
     
    557557void QwtPlotCurve::drawSticks( QPainter *painter,
    558558    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    559     const QRectF &, int from, int to ) const
    560 {
     559    const QRectF &canvasRect, int from, int to ) const
     560{
     561    Q_UNUSED( canvasRect )
     562
    561563    painter->save();
    562564    painter->setRenderHint( QPainter::Antialiasing, false );
     
    640642        mapper.setFlag( QwtPointMapper::WeedOutPoints, false );
    641643
    642         QPolygonF points = mapper.toPointsF( 
     644        QPolygonF points = mapper.toPointsF(
    643645            xMap, yMap, data(), from, to );
    644646
     
    649651    {
    650652        const QImage image = mapper.toImage( xMap, yMap,
    651             data(), from, to, d_data->pen, 
     653            data(), from, to, d_data->pen,
    652654            painter->testRenderHint( QPainter::Antialiasing ),
    653655            renderThreadCount() );
     
    680682        {
    681683            const QPolygon points = mapper.toPoints(
    682                 xMap, yMap, data(), from, to ); 
     684                xMap, yMap, data(), from, to );
    683685
    684686            QwtPainter::drawPoints( painter, points );
     
    686688        else
    687689        {
    688             const QPolygonF points = mapper.toPointsF( 
     690            const QPolygonF points = mapper.toPointsF(
    689691                xMap, yMap, data(), from, to );
    690692
     
    761763        qreal pw = qMax( qreal( 1.0 ), painter->pen().widthF());
    762764        const QRectF clipRect = canvasRect.adjusted(-pw, -pw, pw, pw);
    763        
    764         const QPolygonF clipped = QwtClipper::clipPolygonF( 
     765
     766        const QPolygonF clipped = QwtClipper::clipPolygonF(
    765767            clipRect, polygon, false );
    766768
     
    884886
    885887/*!
    886   \brief Complete a polygon to be a closed polygon including the 
     888  \brief Complete a polygon to be a closed polygon including the
    887889         area between the original polygon and the baseline.
    888890
     
    902904
    903905    double baseline = d_data->baseline;
    904    
     906
    905907    if ( orientation() == Qt::Vertical )
    906908    {
     
    947949{
    948950    QwtPointMapper mapper;
    949     mapper.setFlag( QwtPointMapper::RoundPoints, 
     951    mapper.setFlag( QwtPointMapper::RoundPoints,
    950952        QwtPainter::roundingAlignment( painter ) );
    951     mapper.setFlag( QwtPointMapper::WeedOutPoints, 
     953    mapper.setFlag( QwtPointMapper::WeedOutPoints,
    952954        testPaintAttribute( QwtPlotCurve::FilterPoints ) );
    953955    mapper.setBoundingRect( canvasRect );
     
    974976
    975977  The interpretation of the baseline depends on the orientation().
    976   With Qt::Horizontal, the baseline is interpreted as a horizontal line
    977   at y = baseline(), with Qt::Vertical, it is interpreted as a vertical
     978  With Qt::Vertical, the baseline is interpreted as a horizontal line
     979  at y = baseline(), with Qt::Horizontal, it is interpreted as a vertical
    978980  line at x = baseline().
    979981
     
    10501052   \return Icon representing the curve on the legend
    10511053
    1052    \param index Index of the legend entry 
     1054   \param index Index of the legend entry
    10531055                ( ignored as there is only one )
    10541056   \param size Icon size
     
    10561058   \sa QwtPlotItem::setLegendIconSize(), QwtPlotItem::legendData()
    10571059 */
    1058 QwtGraphic QwtPlotCurve::legendIcon( int index, 
     1060QwtGraphic QwtPlotCurve::legendIcon( int index,
    10591061    const QSizeF &size ) const
    10601062{
     
    11541156
    11551157/*!
    1156   \brief Initialize the data by pointing to memory blocks which 
     1158  \brief Initialize the data by pointing to memory blocks which
    11571159         are not managed by QwtPlotCurve.
    11581160
    1159   setRawSamples is provided for efficiency. 
     1161  setRawSamples is provided for efficiency.
    11601162  It is important to keep the pointers
    11611163  during the lifetime of the underlying QwtCPointerData class.
     
    11671169  \sa QwtCPointerData
    11681170*/
    1169 void QwtPlotCurve::setRawSamples( 
     1171void QwtPlotCurve::setRawSamples(
    11701172    const double *xData, const double *yData, int size )
    11711173{
     
    11841186  \sa QwtPointArrayData
    11851187*/
    1186 void QwtPlotCurve::setSamples( 
     1188void QwtPlotCurve::setSamples(
    11871189    const double *xData, const double *yData, int size )
    11881190{
  • trunk/BNC/qwt/qwt_plot_curve.h

    r8127 r9383  
    3434  <dl><dt>a) Assign curve properties</dt>
    3535  <dd>When a curve is created, it is configured to draw black solid lines
    36   with in QwtPlotCurve::Lines style and no symbols. 
     36  with in QwtPlotCurve::Lines style and no symbols.
    3737  You can change this by calling
    3838  setPen(), setStyle() and setSymbol().</dd>
     
    5353  \sa QwtPointSeriesData, QwtSymbol, QwtScaleMap
    5454*/
    55 class QWT_EXPORT QwtPlotCurve: 
     55class QWT_EXPORT QwtPlotCurve:
    5656    public QwtPlotSeriesItem, public QwtSeriesStore<QPointF>
    5757{
     
    7676
    7777        /*!
    78            Draw vertical or horizontal sticks ( depending on the 
     78           Draw vertical or horizontal sticks ( depending on the
    7979           orientation() ) from a baseline which is defined by setBaseline().
    8080        */
     
    9191           Draw dots at the locations of the data points. Note:
    9292           This is different from a dotted line (see setPen()), and faster
    93            as a curve in QwtPlotCurve::NoStyle style and a symbol 
     93           as a curve in QwtPlotCurve::NoStyle style and a symbol
    9494           painting a point.
    9595        */
     
    111111    {
    112112        /*!
    113            For QwtPlotCurve::Steps only. 
     113           For QwtPlotCurve::Steps only.
    114114           Draws a step function from the right to the left.
    115115         */
     
    142142    {
    143143        /*!
    144           QwtPlotCurve tries to find a color representing the curve 
     144          QwtPlotCurve tries to find a color representing the curve
    145145          and paints a rectangle with it.
    146146         */
     
    148148
    149149        /*!
    150           If the style() is not QwtPlotCurve::NoCurve a line 
     150          If the style() is not QwtPlotCurve::NoCurve a line
    151151          is painted with the curve pen().
    152152         */
     
    192192
    193193        /*!
    194           Minimize memory usage that is temporarily needed for the 
     194          Minimize memory usage that is temporarily needed for the
    195195          translated points, before they get painted.
    196           This might slow down the performance of painting 
     196          This might slow down the performance of painting
    197197         */
    198198        MinimizeMemory = 0x04,
     
    201201          Render the points to a temporary image and paint the image.
    202202          This is a very special optimization for Dots style, when
    203           having a huge amount of points. 
     203          having a huge amount of points.
    204204          With a reasonable number of points QPainter::drawPoints()
    205205          will be faster.
     
    211211    typedef QFlags<PaintAttribute> PaintAttributes;
    212212
    213     explicit QwtPlotCurve( const QString &title = QString::null );
     213    explicit QwtPlotCurve( const QString &title = QString() );
    214214    explicit QwtPlotCurve( const QwtText &title );
    215215
     
    271271    void init();
    272272
    273     virtual void drawCurve( QPainter *p, int style,
    274         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    275         const QRectF &canvasRect, int from, int to ) const;
    276 
    277     virtual void drawSymbols( QPainter *p, const QwtSymbol &,
    278         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    279         const QRectF &canvasRect, int from, int to ) const;
    280 
    281     virtual void drawLines( QPainter *p,
    282         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    283         const QRectF &canvasRect, int from, int to ) const;
    284 
    285     virtual void drawSticks( QPainter *p,
    286         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    287         const QRectF &canvasRect, int from, int to ) const;
    288 
    289     virtual void drawDots( QPainter *p,
    290         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    291         const QRectF &canvasRect, int from, int to ) const;
    292 
    293     virtual void drawSteps( QPainter *p,
     273    virtual void drawCurve( QPainter *, int style,
     274        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
     275        const QRectF &canvasRect, int from, int to ) const;
     276
     277    virtual void drawSymbols( QPainter *, const QwtSymbol &,
     278        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
     279        const QRectF &canvasRect, int from, int to ) const;
     280
     281    virtual void drawLines( QPainter *,
     282        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
     283        const QRectF &canvasRect, int from, int to ) const;
     284
     285    virtual void drawSticks( QPainter *,
     286        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
     287        const QRectF &canvasRect, int from, int to ) const;
     288
     289    virtual void drawDots( QPainter *,
     290        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
     291        const QRectF &canvasRect, int from, int to ) const;
     292
     293    virtual void drawSteps( QPainter *,
    294294        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    295295        const QRectF &canvasRect, int from, int to ) const;
    296296
    297297    virtual void fillCurve( QPainter *,
    298         const QwtScaleMap &, const QwtScaleMap &, 
     298        const QwtScaleMap &, const QwtScaleMap &,
    299299        const QRectF &canvasRect, QPolygonF & ) const;
    300300
  • trunk/BNC/qwt/qwt_plot_dict.cpp

    r8127 r9383  
    138138{
    139139    PrivateData::ItemList list = d_data->itemList;
    140     QwtPlotItemIterator it = list.begin();
    141     while ( it != list.end() )
     140    QwtPlotItemIterator it = list.constBegin();
     141    while ( it != list.constEnd() )
    142142    {
    143143        QwtPlotItem *item = *it;
     
    181181
    182182    PrivateData::ItemList list = d_data->itemList;
    183     for ( QwtPlotItemIterator it = list.begin(); it != list.end(); ++it )
     183    for ( QwtPlotItemIterator it = list.constBegin(); it != list.constEnd(); ++it )
    184184    {
    185185        QwtPlotItem *item = *it;
  • trunk/BNC/qwt/qwt_plot_directpainter.cpp

    r8127 r9383  
    1818#include <qpixmap.h>
    1919
    20 static inline void qwtRenderItem( 
     20static inline void qwtRenderItem(
    2121    QPainter *painter, const QRect &canvasRect,
    2222    QwtPlotSeriesItem *seriesItem, int from, int to )
     
    110110
    111111/*!
    112   En/Disables clipping 
     112  En/Disables clipping
    113113
    114114  \param enable Enables clipping is true, disable it otherwise
     
    132132   \brief Assign a clip region and enable clipping
    133133
    134    Depending on the environment setting a proper clip region might improve 
     134   Depending on the environment setting a proper clip region might improve
    135135   the performance heavily. F.e. on Qt embedded only the clipped part of
    136136   the backing store will be copied to a ( maybe unaccelerated ) frame buffer
    137137   device.
    138    
     138
    139139   \param region Clip region
    140140   \sa clipRegion(), hasClipping(), setClipping()
     
    201201
    202202    bool immediatePaint = true;
    203     if ( !canvas->testAttribute( Qt::WA_WState_InPaintEvent ) ) 
     203    if ( !canvas->testAttribute( Qt::WA_WState_InPaintEvent ) )
    204204    {
    205205#if QT_VERSION < 0x050000
     
    221221        if ( d_data->hasClipping )
    222222        {
    223             d_data->painter.setClipRegion( 
     223            d_data->painter.setClipRegion(
    224224                QRegion( canvasRect ) & d_data->clipRegion );
    225225        }
     
    295295            if ( doCopyCache )
    296296            {
    297                 QwtPlotCanvas *plotCanvas = 
     297                QwtPlotCanvas *plotCanvas =
    298298                    qobject_cast<QwtPlotCanvas *>( canvas );
    299299                if ( plotCanvas )
     
    302302                    if ( doCopyCache )
    303303                    {
    304                         painter.drawPixmap( plotCanvas->rect().topLeft(), 
     304                        painter.drawPixmap( plotCanvas->rect().topLeft(),
    305305                            *plotCanvas->backingStore() );
    306306                    }
  • trunk/BNC/qwt/qwt_plot_directpainter.h

    r8127 r9383  
    3030    On certain environments it might be important to calculate a proper
    3131    clip region before painting. F.e. for Qt Embedded only the clipped part
    32     of the backing store will be copied to a ( maybe unaccelerated ) 
     32    of the backing store will be copied to a ( maybe unaccelerated )
    3333    frame buffer.
    3434
     
    6262        /*!
    6363          When QwtPlotCanvas::BackingStore is enabled the painter
    64           has to paint to the backing store and the widget. In certain 
    65           situations/environments it might be faster to paint to 
     64          has to paint to the backing store and the widget. In certain
     65          situations/environments it might be faster to paint to
    6666          the backing store only and then copy the backing store to the canvas.
    6767          This flag can also be useful for settings, where Qt fills the
  • trunk/BNC/qwt/qwt_plot_glcanvas.cpp

    r8127 r9383  
    2525    for ( ; w->parentWidget() != NULL; w = w->parentWidget() )
    2626    {
    27         if ( w->autoFillBackground() || 
     27        if ( w->autoFillBackground() ||
    2828            w->testAttribute( Qt::WA_StyledBackground ) )
    2929        {
     
    6666};
    6767
    68 /*! 
     68/*!
    6969  \brief Constructor
    7070
     
    9494  Set the frame style
    9595
    96   \param style The bitwise OR between a shape and a shadow. 
    97  
    98   \sa frameStyle(), QFrame::setFrameStyle(), 
     96  \param style The bitwise OR between a shape and a shadow.
     97
     98  \sa frameStyle(), QFrame::setFrameStyle(),
    9999      setFrameShadow(), setFrameShape()
    100100 */
     
    209209  \return Midline width of the frame
    210210  \sa setMidLineWidth(), lineWidth()
    211  */ 
     211 */
    212212int QwtPlotGLCanvas::midLineWidth() const
    213213{
     
    279279
    280280  \sa QwtPlot::drawCanvas()
    281 */ 
     281*/
    282282void QwtPlotGLCanvas::drawItems( QPainter *painter )
    283283{
     
    296296  Draw the background of the canvas
    297297  \param painter Painter
    298 */ 
     298*/
    299299void QwtPlotGLCanvas::drawBackground( QPainter *painter )
    300300{
     
    316316        w->style()->drawPrimitive( QStyle::PE_Widget, &opt, painter, w);
    317317    }
    318     else 
     318    else
    319319    {
    320320        painter->fillRect( fillRect,
     
    337337    if ( frameShadow() == QwtPlotGLCanvas::Plain )
    338338    {
    339         qDrawPlainRect( painter, frameRect(), 
     339        qDrawPlainRect( painter, frameRect(),
    340340            palette().shadow().color(), lineWidth() );
    341341    }
     
    349349        else
    350350        {
    351             qDrawShadePanel( painter, frameRect(), palette(), 
     351            qDrawShadePanel( painter, frameRect(), palette(),
    352352                frameShadow() == Sunken, lineWidth() );
    353353        }
  • trunk/BNC/qwt/qwt_plot_glcanvas.h

    r8127 r9383  
    1414#include <qframe.h>
    1515#include <qgl.h>
     16#include <qpainterpath.h>
    1617
    1718class QwtPlot;
     
    1920/*!
    2021  \brief An alternative canvas for a QwtPlot derived from QGLWidget
    21  
     22
    2223  QwtPlotGLCanvas implements the very basics to act as canvas
    2324  inside of a QwtPlot widget. It might be extended to a full
     
    3132
    3233  \note With Qt4 you might want to use the QPaintEngine::OpenGL paint engine
    33         ( see QGL::setPreferredPaintEngine() ). On a Linux test system 
     34        ( see QGL::setPreferredPaintEngine() ). On a Linux test system
    3435        QPaintEngine::OpenGL2 shows very basic problems like translated
    3536        geometries.
     
    7778        to use QFrame::Shadow instead.
    7879
    79         \note QFrame::StyledPanel and QFrame::WinPanel are unsuported
     80        \note QFrame::StyledPanel and QFrame::WinPanel are unsupported
    8081              and will be displayed as QFrame::Panel.
    8182     */
  • trunk/BNC/qwt/qwt_plot_grid.h

    r8127 r9383  
    4040    virtual int rtti() const;
    4141
    42     void enableX( bool tf );
     42    void enableX( bool );
    4343    bool xEnabled() const;
    4444
    45     void enableY( bool tf );
     45    void enableY( bool );
    4646    bool yEnabled() const;
    4747
    48     void enableXMin( bool tf );
     48    void enableXMin( bool );
    4949    bool xMinEnabled() const;
    5050
    51     void enableYMin( bool tf );
     51    void enableYMin( bool );
    5252    bool yMinEnabled() const;
    5353
    54     void setXDiv( const QwtScaleDiv &sx );
     54    void setXDiv( const QwtScaleDiv & );
    5555    const QwtScaleDiv &xScaleDiv() const;
    5656
    57     void setYDiv( const QwtScaleDiv &sy );
     57    void setYDiv( const QwtScaleDiv & );
    5858    const QwtScaleDiv &yScaleDiv() const;
    5959
     
    6666
    6767    void setMinorPen( const QColor &, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
    68     void setMinorPen( const QPen &p );
     68    void setMinorPen( const QPen & );
    6969    const QPen& minorPen() const;
    7070
    71     virtual void draw( QPainter *p,
     71    virtual void draw( QPainter *,
    7272        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    73         const QRectF &rect ) const;
     73        const QRectF &canvasRect ) const;
    7474
    75     virtual void updateScaleDiv( 
    76         const QwtScaleDiv &xMap, const QwtScaleDiv &yMap );
     75    virtual void updateScaleDiv(
     76        const QwtScaleDiv &xScaleDiv, const QwtScaleDiv &yScaleDiv );
    7777
    7878private:
    79     void drawLines( QPainter *painter, const QRectF &,
    80         Qt::Orientation orientation, const QwtScaleMap &,
     79    void drawLines( QPainter *, const QRectF &,
     80        Qt::Orientation, const QwtScaleMap &,
    8181        const QList<double> & ) const;
    8282
  • trunk/BNC/qwt/qwt_plot_histogram.cpp

    r8127 r9383  
    123123/*!
    124124  Build and assign a pen
    125    
     125
    126126  In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it
    127127  non cosmetic ( see QPen::isCosmetic() ). This method has been introduced
    128128  to hide this incompatibility.
    129    
     129
    130130  \param color Pen color
    131131  \param width Pen width
    132132  \param style Pen style
    133    
     133
    134134  \sa pen(), brush()
    135135 */
    136136void QwtPlotHistogram::setPen( const QColor &color, qreal width, Qt::PenStyle style )
    137 {   
     137{
    138138    setPen( QPen( color, width, style ) );
    139 }   
     139}
    140140
    141141/*!
     
    304304/*!
    305305  Assign a series of samples
    306    
     306
    307307  setSamples() is just a wrapper for setData() without any additional
    308308  value - beside that it is easier to find for the developer.
    309    
     309
    310310  \param data Data
    311311  \warning The item takes ownership of the data object, deleting
    312312           it when its not used anymore.
    313313*/
    314 void QwtPlotHistogram::setSamples( 
     314void QwtPlotHistogram::setSamples(
    315315    QwtSeriesData<QwtIntervalSample> *data )
    316316{
     
    333333void QwtPlotHistogram::drawSeries( QPainter *painter,
    334334    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    335     const QRectF &, int from, int to ) const
    336 {
     335    const QRectF &canvasRect, int from, int to ) const
     336{
     337    Q_UNUSED( canvasRect )
     338
    337339    if ( !painter || dataSize() <= 0 )
    338340        return;
     
    676678  A plain rectangle without pen using the brush()
    677679
    678   \param index Index of the legend entry 
     680  \param index Index of the legend entry
    679681                ( ignored as there is only one )
    680682  \param size Icon size
    681683  \return A graphic displaying the icon
    682    
     684
    683685  \sa QwtPlotItem::setLegendIconSize(), QwtPlotItem::legendData()
    684686*/
  • trunk/BNC/qwt/qwt_plot_histogram.h

    r8127 r9383  
    3737*/
    3838
    39 class QWT_EXPORT QwtPlotHistogram: 
     39class QWT_EXPORT QwtPlotHistogram:
    4040    public QwtPlotSeriesItem, public QwtSeriesStore<QwtIntervalSample>
    4141{
     
    5959        /*!
    6060           Draw a column for each interval. When a symbol() has been set
    61            the symbol is used otherwise the column is displayed as 
     61           the symbol is used otherwise the column is displayed as
    6262           plain rectangle using pen() and brush().
    6363         */
     
    7777    };
    7878
    79     explicit QwtPlotHistogram( const QString &title = QString::null );
     79    explicit QwtPlotHistogram( const QString &title = QString() );
    8080    explicit QwtPlotHistogram( const QwtText &title );
    8181    virtual ~QwtPlotHistogram();
     
    9393    void setSamples( QwtSeriesData<QwtIntervalSample> * );
    9494
    95     void setBaseline( double reference );
     95    void setBaseline( double );
    9696    double baseline() const;
    9797
     
    102102    const QwtColumnSymbol *symbol() const;
    103103
    104     virtual void drawSeries( QPainter *p,
     104    virtual void drawSeries( QPainter *,
    105105        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    106106        const QRectF &canvasRect, int from, int to ) const;
  • trunk/BNC/qwt/qwt_plot_intervalcurve.cpp

    r8127 r9383  
    154154/*!
    155155  Assign a series of samples
    156    
     156
    157157  setSamples() is just a wrapper for setData() without any additional
    158158  value - beside that it is easier to find for the developer.
    159    
     159
    160160  \param data Data
    161161  \warning The item takes ownership of the data object, deleting
    162162           it when its not used anymore.
    163163*/
    164 void QwtPlotIntervalCurve::setSamples( 
     164void QwtPlotIntervalCurve::setSamples(
    165165    QwtSeriesData<QwtIntervalSample> *data )
    166166{
     
    223223/*!
    224224  Build and assign a pen
    225    
     225
    226226  In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it
    227227  non cosmetic ( see QPen::isCosmetic() ). This method has been introduced
    228228  to hide this incompatibility.
    229    
     229
    230230  \param color Pen color
    231231  \param width Pen width
    232232  \param style Pen style
    233    
     233
    234234  \sa pen(), brush()
    235235 */
    236236void QwtPlotIntervalCurve::setPen( const QColor &color, qreal width, Qt::PenStyle style )
    237 {   
     237{
    238238    setPen( QPen( color, width, style ) );
    239 }   
     239}
    240240
    241241/*!
     
    299299{
    300300    QRectF rect = QwtPlotSeriesItem::boundingRect();
    301     if ( rect.isValid() && orientation() == Qt::Vertical )
     301    if ( orientation() == Qt::Vertical )
    302302        rect.setRect( rect.y(), rect.x(), rect.height(), rect.width() );
    303303
     
    546546  If a symbol is assigned it is scaled to size.
    547547
    548   \param index Index of the legend entry 
     548  \param index Index of the legend entry
    549549               ( ignored as there is only one )
    550550  \param size Icon size
    551    
     551
    552552  \sa QwtPlotItem::setLegendIconSize(), QwtPlotItem::legendData()
    553553*/
    554 QwtGraphic QwtPlotIntervalCurve::legendIcon( 
     554QwtGraphic QwtPlotIntervalCurve::legendIcon(
    555555    int index, const QSizeF &size ) const
    556556{
  • trunk/BNC/qwt/qwt_plot_intervalcurve.h

    r8127 r9383  
    2525  to display error bars or the area between 2 curves.
    2626*/
    27 class QWT_EXPORT QwtPlotIntervalCurve: 
     27class QWT_EXPORT QwtPlotIntervalCurve:
    2828    public QwtPlotSeriesItem, public QwtSeriesStore<QwtIntervalSample>
    2929{
     
    7777    typedef QFlags<PaintAttribute> PaintAttributes;
    7878
    79     explicit QwtPlotIntervalCurve( const QString &title = QString::null );
     79    explicit QwtPlotIntervalCurve( const QString &title = QString() );
    8080    explicit QwtPlotIntervalCurve( const QwtText &title );
    8181
     
    103103    const QwtIntervalSymbol *symbol() const;
    104104
    105     virtual void drawSeries( QPainter *p,
     105    virtual void drawSeries( QPainter *,
    106106        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    107107        const QRectF &canvasRect, int from, int to ) const;
  • trunk/BNC/qwt/qwt_plot_item.cpp

    r8127 r9383  
    9595
    9696/*!
    97    \brief This method detaches a QwtPlotItem from any 
     97   \brief This method detaches a QwtPlotItem from any
    9898          QwtPlot it has been associated with.
    9999
     
    305305
    306306/*!
    307    On multi core systems rendering of certain plot item 
    308    ( f.e QwtPlotRasterItem ) can be done in parallel in 
     307   On multi core systems rendering of certain plot item
     308   ( f.e QwtPlotRasterItem ) can be done in parallel in
    309309   several threads.
    310310
     
    363363   The default implementation returns an invalid icon
    364364
    365    \param index Index of the legend entry 
     365   \param index Index of the legend entry
    366366                ( usually there is only one )
    367367   \param size Icon size
     
    369369   \sa setLegendIconSize(), legendData()
    370370 */
    371 QwtGraphic QwtPlotItem::legendIcon( 
     371QwtGraphic QwtPlotItem::legendIcon(
    372372    int index, const QSizeF &size ) const
    373373{
     
    389389   \return A filled rectangle
    390390 */
    391 QwtGraphic QwtPlotItem::defaultIcon( 
     391QwtGraphic QwtPlotItem::defaultIcon(
    392392    const QBrush &brush, const QSizeF &size ) const
    393 {   
     393{
    394394    QwtGraphic icon;
    395395    if ( !size.isEmpty() )
    396396    {
    397397        icon.setDefaultSize( size );
    398        
     398
    399399        QRectF r( 0, 0, size.width(), size.height() );
    400        
     400
    401401        QPainter painter( &icon );
    402402        painter.fillRect( r, brush );
    403     }   
    404    
     403    }
     404
    405405    return icon;
    406 }   
     406}
    407407
    408408//! Show the item
     
    558558   \param bottom Returns the bottom margin
    559559
    560    \return The default implementation returns 0 for all margins
     560   The default implementation returns 0 for all margins
    561561
    562562   \sa QwtPlot::getCanvasMarginsHint(), QwtPlot::updateCanvasMargins()
    563563 */
    564 void QwtPlotItem::getCanvasMarginHint( const QwtScaleMap &xMap, 
     564void QwtPlotItem::getCanvasMarginHint( const QwtScaleMap &xMap,
    565565    const QwtScaleMap &yMap, const QRectF &canvasRect,
    566566    double &left, double &top, double &right, double &bottom ) const
     
    583583
    584584   QwtLegendData is basically a list of QVariants that makes it
    585    possible to overload and reimplement legendData() to 
     585   possible to overload and reimplement legendData() to
    586586   return almost any type of information, that is understood
    587587   by the receiver that acts as the legend.
    588588
    589    The default implementation returns one entry with 
     589   The default implementation returns one entry with
    590590   the title() of the item and the legendIcon().
    591591
     
    599599    QwtText label = title();
    600600    label.setRenderFlags( label.renderFlags() & Qt::AlignLeft );
    601            
     601
    602602    QVariant titleValue;
    603603    qVariantSetValue( titleValue, label );
    604604    data.setValue( QwtLegendData::TitleRole, titleValue );
    605        
     605
    606606    const QwtGraphic graphic = legendIcon( 0, legendIconSize() );
    607607    if ( !graphic.isNull() )
    608     {   
     608    {
    609609        QVariant iconValue;
    610610        qVariantSetValue( iconValue, graphic );
    611611        data.setValue( QwtLegendData::IconRole, iconValue );
    612     }   
    613        
     612    }
     613
    614614    QList<QwtLegendData> list;
    615615    list += data;
     
    659659         legendData() and legendIcon()
    660660 */
    661 void QwtPlotItem::updateLegend( const QwtPlotItem *item, 
     661void QwtPlotItem::updateLegend( const QwtPlotItem *item,
    662662    const QList<QwtLegendData> &data )
    663663{
  • trunk/BNC/qwt/qwt_plot_item.h

    r8127 r9383  
    124124        Rtti_PlotZone,
    125125
    126         /*! 
     126        /*!
    127127           Values >= Rtti_PlotUserItem are reserved for plot items
    128128           not implemented in the Qwt library.
     
    135135
    136136       Various aspects of a plot widget depend on the attributes of
    137        the attached plot items. If and how a single plot item 
     137       the attached plot items. If and how a single plot item
    138138       participates in these updates depends on its attributes.
    139        
     139
    140140       \sa setItemAttribute(), testItemAttribute(), ItemInterest
    141141     */
     
    154154        /*!
    155155           The item needs extra space to display something outside
    156            its bounding rectangle. 
     156           its bounding rectangle.
    157157           \sa getCanvasMarginHint()
    158158         */
     
    175175    enum ItemInterest
    176176    {
    177         /*! 
     177        /*!
    178178           The item is interested in updates of the scales
    179179           \sa updateScaleDiv()
     
    181181        ScaleInterest = 0x01,
    182182
    183         /*! 
     183        /*!
    184184           The item is interested in updates of the legend ( of other items )
    185185           This flag is intended for items, that want to implement a legend
     
    269269    virtual QRectF boundingRect() const;
    270270
    271     virtual void getCanvasMarginHint( 
     271    virtual void getCanvasMarginHint(
    272272        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    273         const QRectF &canvasSize,
     273        const QRectF &canvasRect,
    274274        double &left, double &top, double &right, double &bottom) const;
    275275
    276     virtual void updateScaleDiv( 
     276    virtual void updateScaleDiv(
    277277        const QwtScaleDiv&, const QwtScaleDiv& );
    278278
  • trunk/BNC/qwt/qwt_plot_layout.cpp

    r8127 r9383  
    164164    // canvas
    165165
    166     plot->canvas()->getContentsMargins( 
    167         &canvas.contentsMargins[ QwtPlot::yLeft ], 
     166    plot->canvas()->getContentsMargins(
     167        &canvas.contentsMargins[ QwtPlot::yLeft ],
    168168        &canvas.contentsMargins[ QwtPlot::xTop ],
    169169        &canvas.contentsMargins[ QwtPlot::yRight ],
     
    845845  \param dimTitle Expanded height of the title widget
    846846  \param dimFooter Expanded height of the footer widget
    847   \param dimAxis Expanded heights of the axis in axis orientation.
     847  \param dimAxes Expanded heights of the axis in axis orientation.
    848848
    849849  \sa Options
    850850*/
    851851void QwtPlotLayout::expandLineBreaks( Options options, const QRectF &rect,
    852     int &dimTitle, int &dimFooter, int dimAxis[QwtPlot::axisCnt] ) const
     852    int &dimTitle, int &dimFooter, int dimAxes[QwtPlot::axisCnt] ) const
    853853{
    854854    dimTitle = dimFooter = 0;
    855855    for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
    856         dimAxis[axis] = 0;
     856        dimAxes[axis] = 0;
    857857
    858858    int backboneOffset[QwtPlot::axisCnt];
     
    889889            {
    890890                // center to the canvas
    891                 w -= dimAxis[QwtPlot::yLeft] + dimAxis[QwtPlot::yRight];
     891                w -= dimAxes[QwtPlot::yLeft] + dimAxes[QwtPlot::yRight];
    892892            }
    893893
     
    912912            {
    913913                // center to the canvas
    914                 w -= dimAxis[QwtPlot::yLeft] + dimAxis[QwtPlot::yRight];
     914                w -= dimAxes[QwtPlot::yLeft] + dimAxes[QwtPlot::yRight];
    915915            }
    916916
     
    936936                if ( axis == QwtPlot::xTop || axis == QwtPlot::xBottom )
    937937                {
    938                     length = rect.width() - dimAxis[QwtPlot::yLeft]
    939                         - dimAxis[QwtPlot::yRight];
     938                    length = rect.width() - dimAxes[QwtPlot::yLeft]
     939                        - dimAxes[QwtPlot::yRight];
    940940                    length -= scaleData.start + scaleData.end;
    941941
    942                     if ( dimAxis[QwtPlot::yRight] > 0 )
     942                    if ( dimAxes[QwtPlot::yRight] > 0 )
    943943                        length -= 1;
    944944
    945                     length += qMin( dimAxis[QwtPlot::yLeft],
     945                    length += qMin( dimAxes[QwtPlot::yLeft],
    946946                        scaleData.start - backboneOffset[QwtPlot::yLeft] );
    947                     length += qMin( dimAxis[QwtPlot::yRight],
     947                    length += qMin( dimAxes[QwtPlot::yRight],
    948948                        scaleData.end - backboneOffset[QwtPlot::yRight] );
    949949                }
    950950                else // QwtPlot::yLeft, QwtPlot::yRight
    951951                {
    952                     length = rect.height() - dimAxis[QwtPlot::xTop]
    953                         - dimAxis[QwtPlot::xBottom];
     952                    length = rect.height() - dimAxes[QwtPlot::xTop]
     953                        - dimAxes[QwtPlot::xBottom];
    954954                    length -= scaleData.start + scaleData.end;
    955955                    length -= 1;
    956956
    957                     if ( dimAxis[QwtPlot::xBottom] <= 0 )
     957                    if ( dimAxes[QwtPlot::xBottom] <= 0 )
    958958                        length -= 1;
    959                     if ( dimAxis[QwtPlot::xTop] <= 0 )
     959                    if ( dimAxes[QwtPlot::xTop] <= 0 )
    960960                        length -= 1;
    961961
    962                     if ( dimAxis[QwtPlot::xBottom] > 0 )
     962                    if ( dimAxes[QwtPlot::xBottom] > 0 )
    963963                    {
    964964                        length += qMin(
     
    966966                            double( scaleData.start - backboneOffset[QwtPlot::xBottom] ) );
    967967                    }
    968                     if ( dimAxis[QwtPlot::xTop] > 0 )
     968                    if ( dimAxes[QwtPlot::xTop] > 0 )
    969969                    {
    970970                        length += qMin(
     
    984984
    985985
    986                 if ( d > dimAxis[axis] )
    987                 {
    988                     dimAxis[axis] = d;
     986                if ( d > dimAxes[axis] )
     987                {
     988                    dimAxes[axis] = d;
    989989                    done = false;
    990990                }
     
    10201020        if ( !( options & IgnoreFrames ) )
    10211021        {
    1022             backboneOffset[axis] += 
     1022            backboneOffset[axis] +=
    10231023                d_data->layoutData.canvas.contentsMargins[axis];
    10241024        }
     
    10891089                    const double cRight = canvasRect.right(); // qreal -> double
    10901090                    canvasRect.setRight( qMin( cRight, axisRect.right() + dx ) );
    1091                 }   
     1091                }
    10921092
    10931093                const double maxRight = rightScaleRect.right();
  • trunk/BNC/qwt/qwt_plot_layout.h

    r8127 r9383  
    4242        IgnoreScrollbars = 0x02,
    4343
    44         //! Ignore all frames. 
     44        //! Ignore all frames.
    4545        IgnoreFrames = 0x04,
    4646
     
    6262
    6363    void setCanvasMargin( int margin, int axis = -1 );
    64     int canvasMargin( int axis ) const;
     64    int canvasMargin( int axisId ) const;
    6565
    6666    void setAlignCanvasToScales( bool );
     
    8282
    8383    virtual void activate( const QwtPlot *,
    84         const QRectF &rect, Options options = 0x00 );
     84        const QRectF &plotRect, Options options = Options() );
    8585
    8686    virtual void invalidate();
  • 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{
  • trunk/BNC/qwt/qwt_plot_legenditem.h

    r8127 r9383  
    2424  to have more space for the plot canvas.
    2525
    26   In opposite to QwtLegend the legend item is not interactive. 
     26  In opposite to QwtLegend the legend item is not interactive.
    2727  To identify mouse clicks on a legend item an event filter
    2828  needs to be installed catching mouse events ob the plot canvas.
    2929  The geometries of the legend items are available using
    3030  legendGeometries().
    31  
    32   The legend item is aligned to plot canvas according to 
     31
     32  The legend item is aligned to plot canvas according to
    3333  its alignment() flags. It might have a background for the
    3434  complete legend ( usually semi transparent ) or for
    3535  each legend item.
    3636
    37   \note An external QwtLegend with a transparent background 
    38         on top the plot canvas might be another option 
     37  \note An external QwtLegend with a transparent background
     38        on top the plot canvas might be another option
    3939        with a similar effect.
    4040*/
     
    4646      \brief Background mode
    4747
    48       Depending on the mode the complete legend or each item 
     48      Depending on the mode the complete legend or each item
    4949      might have an background.
    5050
     
    8484    void setItemSpacing( int );
    8585    int itemSpacing() const;
    86    
     86
    8787    void setFont( const QFont& );
    8888    QFont font() const;
    8989
    90     void setBorderDistance( int numPixels );
     90    void setBorderDistance( int );
    9191    int borderDistance() const;
    9292
     
    106106    QPen textPen() const;
    107107
    108     virtual void draw( QPainter *p,
     108    virtual void draw( QPainter *,
    109109        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    110         const QRectF &rect ) const;
     110        const QRectF &canvasRect ) const;
    111111
    112112    void clearLegend();
     
    118118
    119119    virtual QSize minimumSize( const QwtLegendData & ) const;
    120     virtual int heightForWidth( const QwtLegendData &, int w ) const;
     120    virtual int heightForWidth( const QwtLegendData &, int width ) const;
    121121
    122122    QList< const QwtPlotItem * > plotItems() const;
     
    124124
    125125protected:
    126     virtual void drawLegendData( QPainter *painter, 
     126    virtual void drawLegendData( QPainter *painter,
    127127        const QwtPlotItem *, const QwtLegendData &, const QRectF & ) const;
    128128
  • 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        }
  • trunk/BNC/qwt/qwt_plot_marker.h

    r8127 r9383  
    3838  line style. The alignment refers to the center point of
    3939  the marker, which means, for example, that the label would be printed
    40   left above the center point if the alignment was set to 
     40  left above the center point if the alignment was set to
    4141  Qt::AlignLeft | Qt::AlignTop.
    4242
    4343  \note QwtPlotTextLabel is intended to align a text label
    44         according to the geometry of canvas 
     44        according to the geometry of canvas
    4545        ( unrelated to plot coordinates )
    4646*/
     
    6969    };
    7070
    71     explicit QwtPlotMarker( const QString &title = QString::null );
     71    explicit QwtPlotMarker( const QString &title = QString() );
    7272    explicit QwtPlotMarker( const QwtText &title );
    7373
     
    8585    void setValue( const QPointF & );
    8686
    87     void setLineStyle( LineStyle st );
     87    void setLineStyle( LineStyle );
    8888    LineStyle lineStyle() const;
    8989
    9090    void setLinePen( const QColor &, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
    91     void setLinePen( const QPen &p );
     91    void setLinePen( const QPen & );
    9292    const QPen &linePen() const;
    9393
     
    107107    int spacing() const;
    108108
    109     virtual void draw( QPainter *p,
     109    virtual void draw( QPainter *,
    110110        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    111111        const QRectF & ) const;
     
    116116
    117117protected:
    118     virtual void drawLines( QPainter *, 
     118    virtual void drawLines( QPainter *,
    119119        const QRectF &, const QPointF & ) const;
    120120
    121     virtual void drawLabel( QPainter *, 
     121    virtual void drawLabel( QPainter *,
    122122        const QRectF &, const QPointF & ) const;
    123123
  • trunk/BNC/qwt/qwt_plot_multi_barchart.cpp

    r8127 r9383  
    109109/*!
    110110  Assign a series of samples
    111    
     111
    112112  setSamples() is just a wrapper for setData() without any additional
    113113  value - beside that it is easier to find for the developer.
    114    
     114
    115115  \param data Data
    116116  \warning The item takes ownership of the data object, deleting
    117117           it when its not used anymore.
    118 */ 
    119 void QwtPlotMultiBarChart::setSamples( 
     118*/
     119void QwtPlotMultiBarChart::setSamples(
    120120    QwtSeriesData<QwtSetSample> *data )
    121 {       
     121{
    122122    setData( data );
    123 }       
     123}
    124124
    125125/*!
     
    138138}
    139139
    140 /*! 
     140/*!
    141141  \return Bar titles
    142142  \sa setBarTitles(), legendData()
     
    163163        return;
    164164
    165     QMap<int, QwtColumnSymbol *>::iterator it = 
     165    QMap<int, QwtColumnSymbol *>::iterator it =
    166166        d_data->symbolMap.find(valueIndex);
    167167    if ( it == d_data->symbolMap.end() )
     
    207207{
    208208    QMap<int, QwtColumnSymbol *>::const_iterator it =
    209         d_data->symbolMap.find( valueIndex );
    210 
    211     return ( it == d_data->symbolMap.end() ) ? NULL : it.value();
     209        d_data->symbolMap.constFind( valueIndex );
     210
     211    return ( it == d_data->symbolMap.constEnd() ) ? NULL : it.value();
    212212}
    213213
     
    220220  \sa setSymbol(), specialSymbol(), drawBar()
    221221*/
    222 QwtColumnSymbol *QwtPlotMultiBarChart::symbol( int valueIndex ) 
    223 {
    224     QMap<int, QwtColumnSymbol *>::iterator it =
    225         d_data->symbolMap.find( valueIndex );
    226 
    227     return ( it == d_data->symbolMap.end() ) ? NULL : it.value();
     222QwtColumnSymbol *QwtPlotMultiBarChart::symbol( int valueIndex )
     223{
     224    QMap<int, QwtColumnSymbol *>::const_iterator it =
     225        d_data->symbolMap.constFind( valueIndex );
     226
     227    return ( it == d_data->symbolMap.constEnd() ) ? NULL : it.value();
    228228}
    229229
     
    233233void QwtPlotMultiBarChart::resetSymbolMap()
    234234{
    235     for ( QMap<int, QwtColumnSymbol *>::iterator it
    236         = d_data->symbolMap.begin(); it != d_data->symbolMap.end(); ++it )
    237     {
    238         delete it.value();
    239     }
    240 
     235    qDeleteAll( d_data->symbolMap );
    241236    d_data->symbolMap.clear();
    242237}
     
    253248
    254249  When no symbol ( NULL ) is returned, the value will be displayed
    255   with the standard symbol that is used for all symbols with the same 
     250  with the standard symbol that is used for all symbols with the same
    256251  valueIndex.
    257252
     
    260255
    261256  \return NULL, meaning that the value is not special
    262    
     257
    263258 */
    264 QwtColumnSymbol *QwtPlotMultiBarChart::specialSymbol( 
     259QwtColumnSymbol *QwtPlotMultiBarChart::specialSymbol(
    265260    int sampleIndex, int valueIndex ) const
    266261{
     
    456451  \param index Index of the sample to be painted
    457452  \param sampleWidth Boundng width for all bars of the smaple
    458   \param sample Sample 
     453  \param sample Sample
    459454
    460455  \sa drawSeries(), sampleWidth()
     
    536531  \param index Index of the sample to be painted
    537532  \param sampleWidth Width of the bars
    538   \param sample Sample 
     533  \param sample Sample
    539534
    540535  \sa drawSeries(), sampleWidth()
     
    542537void QwtPlotMultiBarChart::drawStackedBars( QPainter *painter,
    543538    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    544     const QRectF &canvasRect, int index, 
     539    const QRectF &canvasRect, int index,
    545540    double sampleWidth, const QwtSetSample& sample ) const
    546541{
     
    568563        double sum = baseline();
    569564
    570         const int numBars = sample.set.size();
    571565        for ( int i = 0; i < numBars; i++ )
    572566        {
     
    670664    {
    671665        // we build a temporary default symbol
    672         QwtColumnSymbol sym( QwtColumnSymbol::Box );
    673         sym.setLineWidth( 1 );
    674         sym.setFrameStyle( QwtColumnSymbol::Plain );
    675         sym.draw( painter, rect );
     666        QwtColumnSymbol columnSymbol( QwtColumnSymbol::Box );
     667        columnSymbol.setLineWidth( 1 );
     668        columnSymbol.setFrameStyle( QwtColumnSymbol::Plain );
     669        columnSymbol.draw( painter, rect );
    676670    }
    677671
     
    702696        {
    703697            QVariant iconValue;
    704             qVariantSetValue( iconValue, 
     698            qVariantSetValue( iconValue,
    705699                legendIcon( i, legendIconSize() ) );
    706700
     
    719713  \param index Index of the bar
    720714  \param size Icon size
    721  
     715
    722716  \return An icon showing a bar
    723717  \sa drawBar(), legendData()
  • trunk/BNC/qwt/qwt_plot_multi_barchart.h

    r8127 r9383  
    2020/*!
    2121  \brief QwtPlotMultiBarChart displays a series of a samples that consist
    22          each of a set of values. 
     22         each of a set of values.
    2323
    24   Each value is displayed as a bar, the bars of each set can be organized 
     24  Each value is displayed as a bar, the bars of each set can be organized
    2525  side by side or accumulated.
    2626
     
    2929  by overloading specialSymbol() or overloading drawBar().
    3030
    31   Depending on its orientation() the bars are displayed horizontally 
    32   or vertically. The bars cover the interval between the baseline() 
     31  Depending on its orientation() the bars are displayed horizontally
     32  or vertically. The bars cover the interval between the baseline()
    3333  and the value.
    3434
    3535  In opposite to most other plot items, QwtPlotMultiBarChart returns more
    3636  than one entry for the legend - one for each symbol.
    37    
     37
    3838  \sa QwtPlotBarChart, QwtPlotHistogram
    3939      QwtPlotSeriesItem::orientation(), QwtPlotAbstractBarChart::baseline()
    4040 */
    41 class QWT_EXPORT QwtPlotMultiBarChart: 
     41class QWT_EXPORT QwtPlotMultiBarChart:
    4242    public QwtPlotAbstractBarChart, public QwtSeriesStore<QwtSetSample>
    4343{
     
    6262    };
    6363
    64     explicit QwtPlotMultiBarChart( const QString &title = QString::null );
     64    explicit QwtPlotMultiBarChart( const QString &title = QString() );
    6565    explicit QwtPlotMultiBarChart( const QwtText &title );
    6666
     
    7979    ChartStyle style() const;
    8080
    81     void setSymbol( int barIndex, QwtColumnSymbol *symbol );
    82     const QwtColumnSymbol *symbol( int barIndex ) const;
     81    void setSymbol( int valueIndex, QwtColumnSymbol * );
     82    const QwtColumnSymbol *symbol( int valueIndex ) const;
    8383
    8484    void resetSymbolMap();
     
    9595
    9696protected:
    97     QwtColumnSymbol *symbol( int barIndex );
     97    QwtColumnSymbol *symbol( int valueIndex );
    9898
    99     virtual QwtColumnSymbol *specialSymbol( 
     99    virtual QwtColumnSymbol *specialSymbol(
    100100        int sampleIndex, int valueIndex ) const;
    101101
     
    106106
    107107    virtual void drawBar( QPainter *, int sampleIndex,
    108         int barIndex, const QwtColumnRect & ) const;
     108        int valueIndex, const QwtColumnRect & ) const;
    109109
    110110    void drawStackedBars( QPainter *painter,
  • trunk/BNC/qwt/qwt_plot_panner.cpp

    r8127 r9383  
    1515#include <qstyle.h>
    1616#include <qstyleoption.h>
     17#include <qpainterpath.h>
     18
     19#if QT_VERSION >= 0x050000
     20#if QT_VERSION < 0x050100
     21#define QWT_USE_WINDOW_HANDLE 1
     22#endif
     23#endif
     24
     25#ifdef QWT_USE_WINDOW_HANDLE
     26#include <qwindow.h>
     27#endif
    1728
    1829static QBitmap qwtBorderMask( const QWidget *canvas, const QSize &size )
    1930{
     31#if QT_VERSION >= 0x050000
     32    qreal pixelRatio = 1.0;
     33
     34#ifdef QWT_USE_WINDOW_HANDLE
     35    pixelRatio = canvas->windowHandle()->devicePixelRatio();
     36#else
     37    pixelRatio = canvas->devicePixelRatio();
     38#endif
     39#endif
     40
    2041    const QRect r( 0, 0, size.width(), size.height() );
    2142
    2243    QPainterPath borderPath;
    2344
    24     ( void )QMetaObject::invokeMethod( 
     45    ( void )QMetaObject::invokeMethod(
    2546        const_cast< QWidget *>( canvas ), "borderPath", Qt::DirectConnection,
    2647        Q_RETURN_ARG( QPainterPath, borderPath ), Q_ARG( QRect, r ) );
     
    3152            return QBitmap();
    3253
     54#if QT_VERSION >= 0x050000
     55        QBitmap mask( size * pixelRatio );
     56        mask.setDevicePixelRatio( pixelRatio );
     57#else
    3358        QBitmap mask( size );
     59#endif
    3460        mask.fill( Qt::color0 );
    3561
     
    4066    }
    4167
     68#if QT_VERSION >= 0x050000
     69    QImage image( size * pixelRatio, QImage::Format_ARGB32_Premultiplied );
     70    image.setDevicePixelRatio( pixelRatio );
     71#else
    4272    QImage image( size, QImage::Format_ARGB32_Premultiplied );
     73#endif
    4374    image.fill( Qt::color0 );
    4475
     
    6394        const QVariant frameWidth = canvas->property( "frameWidth" );
    6495
    65         if ( borderRadius.type() == QVariant::Double 
     96        if ( borderRadius.type() == QVariant::Double
    6697            && frameWidth.type() == QVariant::Int )
    6798        {
    6899            const double br = borderRadius.toDouble();
    69100            const int fw = frameWidth.toInt();
    70        
     101
    71102            if ( br > 0.0 && fw > 0 )
    72103            {
     
    114145    d_data = new PrivateData();
    115146
    116     connect( this, SIGNAL( panned( int, int ) ),
    117         SLOT( moveCanvas( int, int ) ) );
     147    connect( this, SIGNAL(panned(int,int)),
     148        SLOT(moveCanvas(int,int)) );
    118149}
    119150
     
    256287 */
    257288QPixmap QwtPlotPanner::grab() const
    258 {   
     289{
    259290    const QWidget *cv = canvas();
    260291    if ( cv && cv->inherits( "QGLWidget" ) )
     
    272303
    273304    return QwtPanner::grab();
    274 }   
    275 
     305}
     306
  • trunk/BNC/qwt/qwt_plot_picker.cpp

    r8127 r9383  
    193193QwtText QwtPlotPicker::trackerText( const QPoint &pos ) const
    194194{
     195    if ( plot() == NULL )
     196        return QwtText();
     197
    195198    return trackerTextF( invTransform( pos ) );
    196199}
  • trunk/BNC/qwt/qwt_plot_rasteritem.cpp

    r8127 r9383  
    159159    py0 += strippedRect.top() - paintRect.top();
    160160
    161     QImage expanded(sz, image.format());
     161    QImage expanded( sz, image.format() );
     162    if ( image.format() == QImage::Format_Indexed8 )
     163        expanded.setColorTable( image.colorTable() );
    162164
    163165    switch( image.depth() )
     
    191193                }
    192194
    193                 const quint32 *line1 = 
     195                const quint32 *line1 =
    194196                    reinterpret_cast<const quint32 *>( image.scanLine( y1 ) );
    195197
     
    223225                    for ( int y2 = yy1; y2 < yy2; y2++ )
    224226                    {
    225                         quint32 *line2 = reinterpret_cast<quint32 *>( 
     227                        quint32 *line2 = reinterpret_cast<quint32 *>(
    226228                            expanded.scanLine( y2 ) );
    227229
    228                         for ( int x2 = xx1; x2 < xx2; x2++ ) 
     230                        for ( int x2 = xx1; x2 < xx2; x2++ )
    229231                            line2[x2] = rgb;
    230                     }       
    231                 }   
    232             }   
     232                    }
     233                }
     234            }
    233235            break;
    234236        }
     
    241243                {
    242244                    yy1 = 0;
    243                 }   
     245                }
    244246                else
    245247                {
    246248                    yy1 = qRound( y1 * ph - py0 );
    247249                    if ( yy1 < 0 )
    248                         yy1 = 0; 
    249                 }       
    250                
     250                        yy1 = 0;
     251                }
     252
    251253                int yy2;
    252254                if ( y1 == h - 1 )
    253255                {
    254256                    yy2 = sz.height();
    255                 }   
     257                }
    256258                else
    257259                {
     
    260262                        yy2 = sz.height();
    261263                }
    262    
     264
    263265                const uchar *line1 = image.scanLine( y1 );
    264266
     
    293295                        uchar *line2 = expanded.scanLine( y2 );
    294296                        memset( line2 + xx1, line1[x1], xx2 - xx1 );
    295                     }       
    296                 }   
     297                    }
     298                }
    297299            }
    298300            break;
     
    301303            expanded = image;
    302304    }
    303    
     305
    304306    return expanded;
    305 }   
     307}
    306308
    307309static QRectF qwtExpandToPixels(const QRectF &rect, const QRectF &pixelRect)
     
    385387}
    386388
    387 static void qwtToRgba( const QImage* from, QImage* to, 
     389static void qwtToRgba( const QImage* from, QImage* to,
    388390    const QRect& tile, int alpha )
    389391{
     
    573575
    574576   The geometry of a pixel is used to calculated the resolution and
    575    alignment of the rendered image. 
    576 
    577    Width and height of the hint need to be the horizontal 
    578    and vertical distances between 2 neighbored points. 
    579    The center of the hint has to be the position of any point 
     577   alignment of the rendered image.
     578
     579   Width and height of the hint need to be the horizontal
     580   and vertical distances between 2 neighbored points.
     581   The center of the hint has to be the position of any point
    580582   ( it doesn't matter which one ).
    581583
    582584   Limiting the resolution of the image might significantly improve
    583585   the performance and heavily reduce the amount of memory when rendering
    584    a QImage from the raster data. 
     586   a QImage from the raster data.
    585587
    586588   The default implementation returns an empty rectangle (QRectF()),
     
    664666        {
    665667            /*
    666               If only one dimension is of the data pixel is higher 
     668              If only one dimension is of the data pixel is higher
    667669              we expand the pixel rect to the resolution of the target device.
    668670             */
     
    690692        // data pixels we render in resolution of the paint device.
    691693
    692         image = compose(xxMap, yyMap, 
     694        image = compose(xxMap, yyMap,
    693695            area, paintRect, paintRect.size().toSize(), doCache);
    694696        if ( image.isNull() )
     
    698700        // excluded in the intervals
    699701
    700         imageRect = qwtStripRect(paintRect, area, 
     702        imageRect = qwtStripRect(paintRect, area,
    701703            xxMap, yyMap, xInterval, yInterval);
    702704
    703705        if ( imageRect != paintRect )
    704706        {
    705             const QRect r( 
     707            const QRect r(
    706708                qRound( imageRect.x() - paintRect.x()),
    707709                qRound( imageRect.y() - paintRect.y() ),
    708710                qRound( imageRect.width() ),
    709711                qRound( imageRect.height() ) );
    710                
     712
    711713            image = image.copy(r);
    712         }   
     714        }
    713715    }
    714716    else
     
    735737        imageSize.setHeight( qRound( imageArea.height() / pixelRect.height() ) );
    736738
    737         image = compose(xxMap, yyMap, 
     739        image = compose(xxMap, yyMap,
    738740            imageArea, paintRect, imageSize, doCache );
    739741
     
    741743            return;
    742744
    743         imageRect = qwtStripRect(paintRect, area, 
     745        imageRect = qwtStripRect(paintRect, area,
    744746            xxMap, yyMap, xInterval, yInterval);
    745747
     
    747749            testPaintAttribute( PaintInDeviceResolution ) )
    748750        {
    749             // Because of rounding errors the pixels 
    750             // need to be expanded manually to rectangles of 
     751            // Because of rounding errors the pixels
     752            // need to be expanded manually to rectangles of
    751753            // different sizes
    752754
    753             image = qwtExpandImage(image, xxMap, yyMap, 
     755            image = qwtExpandImage(image, xxMap, yyMap,
    754756                imageArea, area, paintRect, xInterval, yInterval );
    755757        }
     
    758760    painter->save();
    759761    painter->setWorldTransform( QTransform() );
    760    
     762
    761763    QwtPainter::drawImage( painter, imageRect, image );
    762764
     
    769771   This method is intended to be reimplemented by derived classes.
    770772   The default implementation returns an invalid interval.
    771    
     773
    772774   \param axis X, Y, or Z axis
    773775*/
     
    817819}
    818820
    819 QImage QwtPlotRasterItem::compose( 
     821QImage QwtPlotRasterItem::compose(
    820822    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    821     const QRectF &imageArea, const QRectF &paintRect, 
     823    const QRectF &imageArea, const QRectF &paintRect,
    822824    const QSize &imageSize, bool doCache) const
    823825{
     
    842844            dx = imageArea.width() / imageSize.width();
    843845
    844         const QwtScaleMap xxMap = 
     846        const QwtScaleMap xxMap =
    845847            imageMap(Qt::Horizontal, xMap, imageArea, imageSize, dx);
    846        
     848
    847849        double dy = 0.0;
    848850        if ( paintRect.toRect().height() > imageSize.height() )
    849851            dy = imageArea.height() / imageSize.height();
    850852
    851         const QwtScaleMap yyMap = 
     853        const QwtScaleMap yyMap =
    852854            imageMap(Qt::Vertical, yMap, imageArea, imageSize, dy);
    853855
     
    937939    }
    938940
    939     if ( pixelSize > 0.0 )
     941    if ( pixelSize > 0.0 || p2 == 1.0 )
    940942    {
    941943        double off = 0.5 * pixelSize;
  • trunk/BNC/qwt/qwt_plot_rasteritem.h

    r8127 r9383  
    5151        /*!
    5252          renderImage() is called, whenever the image cache is not valid,
    53           or the scales, or the size of the canvas has changed. 
     53          or the scales, or the size of the canvas has changed.
    5454
    55           This type of cache is useful for improving the performance 
    56           of hide/show operations or manipulations of the alpha value. 
     55          This type of cache is useful for improving the performance
     56          of hide/show operations or manipulations of the alpha value.
    5757          All other situations are handled by the canvas backing store.
    5858         */
     
    6969          When the image is rendered according to the data pixels
    7070          ( QwtRasterData::pixelHint() ) it can be expanded to paint
    71           device resolution before it is passed to QPainter. 
    72           The expansion algorithm rounds the pixel borders in the same 
     71          device resolution before it is passed to QPainter.
     72          The expansion algorithm rounds the pixel borders in the same
    7373          way as the axis ticks, what is usually better than the
    7474          scaling algorithm implemented in Qt.
    75           Disabling this flag might make sense, to reduce the size of a 
     75          Disabling this flag might make sense, to reduce the size of a
    7676          document/file. If this is possible for a document format
    7777          depends on the implementation of the specific QPaintEngine.
     
    8484    typedef QFlags<PaintAttribute> PaintAttributes;
    8585
    86     explicit QwtPlotRasterItem( const QString& title = QString::null );
     86    explicit QwtPlotRasterItem( const QString& title = QString() );
    8787    explicit QwtPlotRasterItem( const QwtText& title );
    8888    virtual ~QwtPlotRasterItem();
     
    9999    void invalidateCache();
    100100
    101     virtual void draw( QPainter *p,
     101    virtual void draw( QPainter *,
    102102        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    103         const QRectF &rect ) const;
     103        const QRectF &canvasRect ) const;
    104104
    105105    virtual QRectF pixelHint( const QRectF & ) const;
     
    110110protected:
    111111    /*!
    112       \brief Render an image 
     112      \brief Render an image
    113113
    114114      An implementation of render() might iterate over all
    115       pixels of imageRect. Each pixel has to be translated into 
     115      pixels of imageRect. Each pixel has to be translated into
    116116      the corresponding position in scale coordinates using the maps.
    117117      This position can be used to look up a value in a implementation
     
    122122      \param area Requested area for the image in scale coordinates
    123123      \param imageSize Requested size of the image
    124    
     124
    125125      \return Rendered image
    126126     */
  • trunk/BNC/qwt/qwt_plot_renderer.cpp

    r8127 r9383  
    1515#include "qwt_scale_widget.h"
    1616#include "qwt_scale_engine.h"
     17#include "qwt_scale_map.h"
    1718#include "qwt_text.h"
    1819#include "qwt_text_label.h"
    1920#include "qwt_math.h"
     21
    2022#include <qpainter.h>
    21 #include <qpaintengine.h>
     23#include <qpainterpath.h>
    2224#include <qtransform.h>
    2325#include <qprinter.h>
    24 #include <qprintdialog.h>
    2526#include <qfiledialog.h>
    2627#include <qfileinfo.h>
    27 #include <qstyle.h>
    28 #include <qstyleoption.h>
    2928#include <qimagewriter.h>
     29#include <qvariant.h>
     30
    3031#ifndef QWT_NO_SVG
    3132#ifdef QT_SVG_LIB
     33#if QT_VERSION >= 0x040500
     34#define QWT_FORMAT_SVG 1
     35#endif
     36#endif
     37#endif
     38
     39#ifndef QT_NO_PRINTER
     40#define QWT_FORMAT_PDF 1
     41#endif
     42
     43#ifndef QT_NO_PDF
     44
     45// QPdfWriter::setResolution() has been introduced with
     46// Qt 5.3. Guess it is o.k. to stay with QPrinter for older
     47// versions.
     48
     49#if QT_VERSION >= 0x050300
     50
     51#ifndef QWT_FORMAT_PDF
     52#define QWT_FORMAT_PDF 1
     53#endif
     54
     55#define QWT_PDF_WRITER 1
     56
     57#endif
     58#endif
     59
     60#ifndef QT_NO_PRINTER
     61// postscript support has been dropped in Qt5
     62#if QT_VERSION < 0x050000
     63#define QWT_FORMAT_POSTSCRIPT 1
     64#endif
     65#endif
     66
     67#if QWT_FORMAT_SVG
    3268#include <qsvggenerator.h>
    3369#endif
    34 #endif
    35 
    36 static QPainterPath qwtCanvasClip(
     70
     71#if QWT_PDF_WRITER
     72#include <qpdfwriter.h>
     73#endif
     74
     75static QPainterPath qwtCanvasClip(
    3776    const QWidget* canvas, const QRectF &canvasRect )
    3877{
     
    5897}
    5998
     99static inline QFont qwtResolvedFont( const QWidget *widget )
     100{
     101    QFont font = widget->font();
     102    font.resolve( QFont::AllPropertiesResolved );
     103
     104    return font;
     105}
     106
    60107class QwtPlotRenderer::PrivateData
    61108{
     
    71118};
    72119
    73 /*! 
     120/*!
    74121   Constructor
    75122   \param parent Parent object
     
    239286
    240287    const QString fmt = format.toLower();
    241     if ( fmt == "pdf" )
    242     {
    243 #ifndef QT_NO_PRINTER
     288    if ( fmt == QLatin1String( "pdf" ) )
     289    {
     290#if QWT_FORMAT_PDF
     291
     292#if QWT_PDF_WRITER
     293        QPdfWriter pdfWriter( fileName );
     294        pdfWriter.setPageSizeMM( sizeMM );
     295        pdfWriter.setTitle( title );
     296        pdfWriter.setPageMargins( QMarginsF() );
     297        pdfWriter.setResolution( resolution );
     298
     299        QPainter painter( &pdfWriter );
     300        render( plot, &painter, documentRect );
     301#else
    244302        QPrinter printer;
    245303        printer.setOutputFormat( QPrinter::PdfFormat );
     
    254312        render( plot, &painter, documentRect );
    255313#endif
    256     }
    257     else if ( fmt == "ps" )
    258     {
    259 #if QT_VERSION < 0x050000
    260 #ifndef QT_NO_PRINTER
     314#endif
     315    }
     316    else if ( fmt == QLatin1String( "ps" ) )
     317    {
     318#if QWT_FORMAT_POSTSCRIPT
    261319        QPrinter printer;
    262320        printer.setOutputFormat( QPrinter::PostScriptFormat );
     
    271329        render( plot, &painter, documentRect );
    272330#endif
    273 #endif
    274     }
    275     else if ( fmt == "svg" )
    276     {
    277 #ifndef QWT_NO_SVG
    278 #ifdef QT_SVG_LIB
    279 #if QT_VERSION >= 0x040500
     331    }
     332    else if ( fmt == QLatin1String( "svg" ) )
     333    {
     334#if QWT_FORMAT_SVG
    280335        QSvgGenerator generator;
    281336        generator.setTitle( title );
     
    287342        render( plot, &painter, documentRect );
    288343#endif
    289 #endif
    290 #endif
    291344    }
    292345    else
     
    367420#endif
    368421
    369 #ifndef QWT_NO_SVG
    370 #ifdef QT_SVG_LIB
    371 #if QT_VERSION >= 0x040500
     422#if QWT_FORMAT_SVG
    372423
    373424/*!
     
    395446    render( plot, &p, rect );
    396447}
    397 #endif
    398 #endif
     448
    399449#endif
    400450
     
    461511            if ( !plot->axisEnabled( axisId ) )
    462512            {
    463                 int left = 0;
    464                 int right = 0;
    465                 int top = 0;
    466                 int bottom = 0;
    467 
    468513                // When we have a scale the frame is painted on
    469514                // the position of the backbone - otherwise we
     
    487532                        break;
    488533                }
    489                 layoutRect.adjust( left, top, right, bottom );
    490534            }
    491535        }
     
    500544    {
    501545        layoutOptions |= QwtPlotLayout::IgnoreFrames;
    502     }
    503 
     546    }
    504547
    505548    if ( d_data->discardFlags & DiscardLegend )
     
    591634  \param plot Plot widget
    592635  \param painter Painter
    593   \param rect Bounding rectangle
     636  \param titleRect Bounding rectangle for the title
    594637*/
    595638void QwtPlotRenderer::renderTitle( const QwtPlot *plot,
    596     QPainter *painter, const QRectF &rect ) const
    597 {
    598     painter->setFont( plot->titleLabel()->font() );
     639    QPainter *painter, const QRectF &titleRect ) const
     640{
     641    painter->setFont( qwtResolvedFont( plot->titleLabel() ) );
    599642
    600643    const QColor color = plot->titleLabel()->palette().color(
     
    602645
    603646    painter->setPen( color );
    604     plot->titleLabel()->text().draw( painter, rect );
     647    plot->titleLabel()->text().draw( painter, titleRect );
    605648}
    606649
     
    610653  \param plot Plot widget
    611654  \param painter Painter
    612   \param rect Bounding rectangle
     655  \param footerRect Bounding rectangle for the footer
    613656*/
    614657void QwtPlotRenderer::renderFooter( const QwtPlot *plot,
    615     QPainter *painter, const QRectF &rect ) const
    616 {
    617     painter->setFont( plot->footerLabel()->font() );
     658    QPainter *painter, const QRectF &footerRect ) const
     659{
     660    painter->setFont( qwtResolvedFont( plot->footerLabel() ) );
    618661
    619662    const QColor color = plot->footerLabel()->palette().color(
     
    621664
    622665    painter->setPen( color );
    623     plot->footerLabel()->text().draw( painter, rect );
    624 }
    625 
     666    plot->footerLabel()->text().draw( painter, footerRect );
     667}
    626668
    627669/*!
     
    630672  \param plot Plot widget
    631673  \param painter Painter
    632   \param rect Bounding rectangle
     674  \param legendRect Bounding rectangle for the legend
    633675*/
    634676void QwtPlotRenderer::renderLegend( const QwtPlot *plot,
    635     QPainter *painter, const QRectF &rect ) const
     677    QPainter *painter, const QRectF &legendRect ) const
    636678{
    637679    if ( plot->legend() )
    638680    {
    639681        bool fillBackground = !( d_data->discardFlags & DiscardBackground );
    640         plot->legend()->renderLegend( painter, rect, fillBackground );
     682        plot->legend()->renderLegend( painter, legendRect, fillBackground );
    641683    }
    642684}
     
    652694  \param endDist End border distance
    653695  \param baseDist Base distance
    654   \param rect Bounding rectangle
     696  \param scaleRect Bounding rectangle for the scale
    655697*/
    656698void QwtPlotRenderer::renderScale( const QwtPlot *plot,
    657699    QPainter *painter,
    658700    int axisId, int startDist, int endDist, int baseDist,
    659     const QRectF &rect ) const
     701    const QRectF &scaleRect ) const
    660702{
    661703    if ( !plot->axisEnabled( axisId ) )
     
    666708        && scaleWidget->colorBarWidth() > 0 )
    667709    {
    668         scaleWidget->drawColorBar( painter, scaleWidget->colorBarRect( rect ) );
     710        scaleWidget->drawColorBar( painter, scaleWidget->colorBarRect( scaleRect ) );
    669711        baseDist += scaleWidget->colorBarWidth() + scaleWidget->spacing();
    670712    }
     
    679721        case QwtPlot::yLeft:
    680722        {
    681             x = rect.right() - 1.0 - baseDist;
    682             y = rect.y() + startDist;
    683             w = rect.height() - startDist - endDist;
     723            x = scaleRect.right() - 1.0 - baseDist;
     724            y = scaleRect.y() + startDist;
     725            w = scaleRect.height() - startDist - endDist;
    684726            align = QwtScaleDraw::LeftScale;
    685727            break;
     
    687729        case QwtPlot::yRight:
    688730        {
    689             x = rect.left() + baseDist;
    690             y = rect.y() + startDist;
    691             w = rect.height() - startDist - endDist;
     731            x = scaleRect.left() + baseDist;
     732            y = scaleRect.y() + startDist;
     733            w = scaleRect.height() - startDist - endDist;
    692734            align = QwtScaleDraw::RightScale;
    693735            break;
     
    695737        case QwtPlot::xTop:
    696738        {
    697             x = rect.left() + startDist;
    698             y = rect.bottom() - 1.0 - baseDist;
    699             w = rect.width() - startDist - endDist;
     739            x = scaleRect.left() + startDist;
     740            y = scaleRect.bottom() - 1.0 - baseDist;
     741            w = scaleRect.width() - startDist - endDist;
    700742            align = QwtScaleDraw::TopScale;
    701743            break;
     
    703745        case QwtPlot::xBottom:
    704746        {
    705             x = rect.left() + startDist;
    706             y = rect.top() + baseDist;
    707             w = rect.width() - startDist - endDist;
     747            x = scaleRect.left() + startDist;
     748            y = scaleRect.top() + baseDist;
     749            w = scaleRect.width() - startDist - endDist;
    708750            align = QwtScaleDraw::BottomScale;
    709751            break;
     
    713755    }
    714756
    715     scaleWidget->drawTitle( painter, align, rect );
    716 
    717     painter->setFont( scaleWidget->font() );
     757    scaleWidget->drawTitle( painter, align, scaleRect );
     758
     759    painter->setFont( qwtResolvedFont( scaleWidget ) );
    718760
    719761    QwtScaleDraw *sd = const_cast<QwtScaleDraw *>( scaleWidget->scaleDraw() );
     
    740782  \param plot Plot widget
    741783  \param painter Painter
    742   \param map Maps mapping between plot and paint device coordinates
     784  \param maps Maps mapping between plot and paint device coordinates
    743785  \param canvasRect Canvas rectangle
    744786*/
    745787void QwtPlotRenderer::renderCanvas( const QwtPlot *plot,
    746     QPainter *painter, const QRectF &canvasRect, 
    747     const QwtScaleMap *map ) const
     788    QPainter *painter, const QRectF &canvasRect,
     789    const QwtScaleMap *maps ) const
    748790{
    749791    const QWidget *canvas = plot->canvas();
     
    771813
    772814        painter->setClipRect( canvasRect );
    773         plot->drawItems( painter, canvasRect, map );
     815        plot->drawItems( painter, canvasRect, maps );
    774816
    775817        painter->restore();
     
    795837            painter->setClipPath( clipPath );
    796838
    797         plot->drawItems( painter, canvasRect, map );
     839        plot->drawItems( painter, canvasRect, maps );
    798840
    799841        painter->restore();
     
    814856        }
    815857
    816         QRectF innerRect = canvasRect.adjusted( 
     858        QRectF innerRect = canvasRect.adjusted(
    817859            frameWidth, frameWidth, -frameWidth, -frameWidth );
    818860
     
    833875        }
    834876
    835         plot->drawItems( painter, innerRect, map );
     877        plot->drawItems( painter, innerRect, maps );
    836878
    837879        painter->restore();
     
    845887                canvas->property( "frameShape" ).toInt();
    846888
    847             const int frameWidth = canvas->property( "frameWidth" ).toInt();
    848 
    849 
    850889            const QVariant borderRadius = canvas->property( "borderRadius" );
    851             if ( borderRadius.type() == QVariant::Double 
     890            if ( borderRadius.type() == QVariant::Double
    852891                && borderRadius.toDouble() > 0.0 )
    853892            {
    854                 const double r = borderRadius.toDouble();
     893                const double radius = borderRadius.toDouble();
    855894
    856895                QwtPainter::drawRoundedFrame( painter, canvasRect,
    857                     r, r, canvas->palette(), frameWidth, frameStyle );
     896                    radius, radius, canvas->palette(), frameWidth, frameStyle );
    858897            }
    859898            else
     
    933972    double margins[QwtPlot::axisCnt];
    934973    plot->getCanvasMarginsHint( maps, canvasRect,
    935         margins[QwtPlot::yLeft], margins[QwtPlot::xTop], 
     974        margins[QwtPlot::yLeft], margins[QwtPlot::xTop],
    936975        margins[QwtPlot::yRight], margins[QwtPlot::xBottom] );
    937976
     
    9631002bool QwtPlotRenderer::exportTo( QwtPlot *plot, const QString &documentName,
    9641003     const QSizeF &sizeMM, int resolution )
    965 {       
     1004{
    9661005    if ( plot == NULL )
    9671006        return false;
    968    
     1007
    9691008    QString fileName = documentName;
    9701009
    971     // What about translation 
     1010    // What about translation
    9721011
    9731012#ifndef QT_NO_FILEDIALOG
    9741013    const QList<QByteArray> imageFormats =
    9751014        QImageWriter::supportedImageFormats();
    976        
     1015
    9771016    QStringList filter;
    978 #ifndef QT_NO_PRINTER
     1017#if QWT_FORMAT_PDF
    9791018    filter += QString( "PDF " ) + tr( "Documents" ) + " (*.pdf)";
    9801019#endif
    981 #ifndef QWT_NO_SVG
     1020#if QWT_FORMAT_SVG
    9821021    filter += QString( "SVG " ) + tr( "Documents" ) + " (*.svg)";
    9831022#endif
    984 #ifndef QT_NO_PRINTER
     1023#if QWT_FORMAT_POSTSCRIPT
    9851024    filter += QString( "Postscript " ) + tr( "Documents" ) + " (*.ps)";
    9861025#endif
    987    
     1026
    9881027    if ( imageFormats.size() > 0 )
    9891028    {
     
    9941033            if ( i > 0 )
    9951034                imageFilter += " ";
    996             imageFilter += "*."; 
     1035            imageFilter += "*.";
    9971036            imageFilter += imageFormats[i];
    998         }   
     1037        }
    9991038        imageFilter += ")";
    1000        
     1039
    10011040        filter += imageFilter;
    1002     }   
    1003    
     1041    }
     1042
    10041043    fileName = QFileDialog::getSaveFileName(
    10051044        NULL, tr( "Export File Name" ), fileName,
    10061045        filter.join( ";;" ), NULL, QFileDialog::DontConfirmOverwrite );
    1007 #endif 
     1046#endif
    10081047    if ( fileName.isEmpty() )
    10091048        return false;
     
    10121051
    10131052    return true;
    1014 }   
     1053}
  • trunk/BNC/qwt/qwt_plot_renderer.h

    r8127 r9383  
    6161        DiscardFooter           = 0x10,
    6262
    63         /*! 
     63        /*!
    6464            Don't render the frame of the canvas
    6565
     
    128128#endif
    129129
    130     void renderTo( QwtPlot *, QPaintDevice &p ) const;
     130    void renderTo( QwtPlot *, QPaintDevice & ) const;
    131131
    132132    virtual void render( QwtPlot *,
    133         QPainter *, const QRectF &rect ) const;
     133        QPainter *, const QRectF &plotRect ) const;
    134134
    135135    virtual void renderTitle( const QwtPlot *,
    136         QPainter *, const QRectF & ) const;
     136        QPainter *, const QRectF &titleRect ) const;
    137137
    138138    virtual void renderFooter( const QwtPlot *,
    139         QPainter *, const QRectF & ) const;
     139        QPainter *, const QRectF &footerRect ) const;
    140140
    141141    virtual void renderScale( const QwtPlot *, QPainter *,
    142142        int axisId, int startDist, int endDist,
    143         int baseDist, const QRectF & ) const;
     143        int baseDist, const QRectF &scaleRect ) const;
    144144
    145145    virtual void renderCanvas( const QwtPlot *,
     
    147147        const QwtScaleMap* maps ) const;
    148148
    149     virtual void renderLegend( 
    150         const QwtPlot *, QPainter *, const QRectF & ) const;
     149    virtual void renderLegend(
     150        const QwtPlot *, QPainter *, const QRectF &legendRect ) const;
    151151
    152152    bool exportTo( QwtPlot *, const QString &documentName,
  • trunk/BNC/qwt/qwt_plot_rescaler.h

    r8127 r9383  
    117117
    118118    virtual void rescale( const QSize &oldSize, const QSize &newSize ) const;
    119     virtual QwtInterval expandScale( 
     119    virtual QwtInterval expandScale(
    120120        int axis, const QSize &oldSize, const QSize &newSize ) const;
    121121
  • trunk/BNC/qwt/qwt_plot_scaleitem.cpp

    r8127 r9383  
    350350    if ( d_data->scaleDivFromAxis )
    351351    {
    352         const QwtInterval interval = 
     352        const QwtInterval interval =
    353353            d_data->scaleInterval( canvasRect, xMap, yMap );
    354354
     
    448448    if ( d_data->scaleDivFromAxis && scaleDraw )
    449449    {
    450         const QwtScaleDiv &scaleDiv = 
     450        const QwtScaleDiv &scaleDiv =
    451451            scaleDraw->orientation() == Qt::Horizontal ? xScaleDiv : yScaleDiv;
    452452
     
    456456            const QRectF canvasRect = plt->canvas()->contentsRect();
    457457
    458             const QwtInterval interval = d_data->scaleInterval( 
     458            const QwtInterval interval = d_data->scaleInterval(
    459459                canvasRect, plt->canvasMap( xAxis() ), plt->canvasMap( yAxis() ) );
    460460
  • trunk/BNC/qwt/qwt_plot_scaleitem.h

    r4271 r9383  
    3333
    3434  \par Example
    35   The following example shows how to replace the left axis, by a scale item
    36   at the x position 0.0.
    37   \verbatim
    38 QwtPlotScaleItem *scaleItem =
    39     new QwtPlotScaleItem(QwtScaleDraw::RightScale, 0.0);
    40 scaleItem->setFont(plot->axisWidget(QwtPlot::yLeft)->font());
    41 scaleItem->attach(plot);
     35    The following example shows how to replace the left axis, by a scale item
     36    at the x position 0.0.
     37    \code
     38      QwtPlotScaleItem *scaleItem = new QwtPlotScaleItem( QwtScaleDraw::RightScale, 0.0 );
     39      scaleItem->setFont( plot->axisWidget( QwtPlot::yLeft )->font() );
     40      scaleItem->attach(plot);
    4241
    43 plot->enableAxis(QwtPlot::yLeft, false);
    44 \endverbatim
     42      plot->enableAxis( QwtPlot::yLeft, false );
     43    \endcode
     44  \endpar
    4545*/
    4646
     
    7676    double position() const;
    7777
    78     void setBorderDistance( int numPixels );
     78    void setBorderDistance( int );
    7979    int borderDistance() const;
    8080
    8181    void setAlignment( QwtScaleDraw::Alignment );
    8282
    83     virtual void draw( QPainter *p,
     83    virtual void draw( QPainter *,
    8484        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    85         const QRectF &rect ) const;
     85        const QRectF &canvasRect ) const;
    8686
    8787    virtual void updateScaleDiv( const QwtScaleDiv &, const QwtScaleDiv & );
  • trunk/BNC/qwt/qwt_plot_seriesitem.cpp

    r8127 r9383  
    4040{
    4141    d_data = new PrivateData();
     42    setItemInterest( QwtPlotItem::ScaleInterest, true );
    4243}
    4344
     
    99100void QwtPlotSeriesItem::updateScaleDiv(
    100101    const QwtScaleDiv &xScaleDiv, const QwtScaleDiv &yScaleDiv )
    101 {   
     102{
    102103    const QRectF rect = QRectF(
    103104        xScaleDiv.lowerBound(), yScaleDiv.lowerBound(),
    104105        xScaleDiv.range(), yScaleDiv.range() );
    105        
     106
    106107    setRectOfInterest( rect );
    107 }   
     108}
    108109
    109110void QwtPlotSeriesItem::dataChanged()
  • trunk/BNC/qwt/qwt_plot_seriesitem.h

    r8127 r9383  
    2424{
    2525public:
    26     explicit QwtPlotSeriesItem( const QString &title = QString::null );
     26    explicit QwtPlotSeriesItem( const QString &title = QString() );
    2727    explicit QwtPlotSeriesItem( const QwtText &title );
    2828
     
    3232    Qt::Orientation orientation() const;
    3333
    34     virtual void draw( QPainter *p,
     34    virtual void draw( QPainter *,
    3535        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    3636        const QRectF & ) const;
     
    5353    virtual QRectF boundingRect() const;
    5454
    55     virtual void updateScaleDiv( 
     55    virtual void updateScaleDiv(
    5656        const QwtScaleDiv &, const QwtScaleDiv & );
    5757
  • trunk/BNC/qwt/qwt_plot_shapeitem.cpp

    r8127 r9383  
    208208  \sa setShape(), setPolygon(), shape()
    209209 */
    210 void QwtPlotShapeItem::setRect( const QRectF &rect ) 
     210void QwtPlotShapeItem::setRect( const QRectF &rect )
    211211{
    212212    QPainterPath path;
     
    263263}
    264264
    265 /*! 
     265/*!
    266266  Build and assign a pen
    267    
     267
    268268  In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it
    269269  non cosmetic ( see QPen::isCosmetic() ). This method has been introduced
    270270  to hide this incompatibility.
    271    
     271
    272272  \param color Pen color
    273273  \param width Pen width
    274274  \param style Pen style
    275    
     275
    276276  \sa pen(), brush()
    277  */ 
     277 */
    278278void QwtPlotShapeItem::setPen( const QColor &color, qreal width, Qt::PenStyle style )
    279 {   
     279{
    280280    setPen( QPen( color, width, style ) );
    281281}
     
    336336  \brief Set the tolerance for the weeding optimization
    337337
    338   After translating the shape into target device coordinate 
     338  After translating the shape into target device coordinate
    339339  ( usually widget geometries ) the painter path can be simplified
    340340  by a point weeding algorithm ( Douglas-Peucker ).
     
    384384        return;
    385385
    386     if ( d_data->pen.style() == Qt::NoPen 
     386    if ( d_data->pen.style() == Qt::NoPen
    387387        && d_data->brush.style() == Qt::NoBrush )
    388388    {
     
    404404    const bool doAlign = QwtPainter::roundingAlignment( painter );
    405405
    406     QPainterPath path = qwtTransformPath( xMap, yMap, 
     406    QPainterPath path = qwtTransformPath( xMap, yMap,
    407407        d_data->shape, doAlign );
    408408
     
    451451  \return A rectangle filled with the color of the brush ( or the pen )
    452452
    453   \param index Index of the legend entry 
     453  \param index Index of the legend entry
    454454                ( usually there is only one )
    455455  \param size Icon size
  • trunk/BNC/qwt/qwt_plot_shapeitem.h

    r8127 r9383  
    1616
    1717/*!
    18   \brief A plot item, which displays any graphical shape, 
     18  \brief A plot item, which displays any graphical shape,
    1919         that can be defined by a QPainterPath
    2020
     
    6161        LegendShape,
    6262
    63         //! Display a filled rectangle 
     63        //! Display a filled rectangle
    6464        LegendColor
    6565    };
    6666
    67     explicit QwtPlotShapeItem( const QString &title = QString::null );
     67    explicit QwtPlotShapeItem( const QString &title = QString() );
    6868    explicit QwtPlotShapeItem( const QwtText &title );
    6969
     
    9494    virtual QRectF boundingRect() const;
    9595
    96     virtual void draw( QPainter *p,
     96    virtual void draw( QPainter *,
    9797        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    98         const QRectF &rect ) const;
     98        const QRectF &canvasRect ) const;
    9999
    100100    virtual QwtGraphic legendIcon( int index, const QSizeF & ) const;
  • trunk/BNC/qwt/qwt_plot_spectrocurve.cpp

    r8127 r9383  
    118118/*!
    119119  Assign a series of samples
    120    
     120
    121121  setSamples() is just a wrapper for setData() without any additional
    122122  value - beside that it is easier to find for the developer.
    123    
     123
    124124  \param data Data
    125125  \warning The item takes ownership of the data object, deleting
    126            it when its not used anymore. 
     126           it when its not used anymore.
    127127*/
    128128void QwtPlotSpectroCurve::setSamples(
     
    130130{
    131131    setData( data );
    132 } 
     132}
    133133
    134134/*!
     
    311311                d_data->colorRange, sample.z() );
    312312
    313             painter->setPen( QPen( QColor::fromRgba( d_data->colorTable[index] ), 
     313            painter->setPen( QPen( QColor::fromRgba( d_data->colorTable[index] ),
    314314                d_data->penWidth ) );
    315315        }
  • trunk/BNC/qwt/qwt_plot_spectrocurve.h

    r8127 r9383  
    2222           mapped to a color.
    2323*/
    24 class QWT_EXPORT QwtPlotSpectroCurve: 
    25     public QwtPlotSeriesItem, QwtSeriesStore<QwtPoint3D>
     24class QWT_EXPORT QwtPlotSpectroCurve:
     25    public QwtPlotSeriesItem, public QwtSeriesStore<QwtPoint3D>
    2626{
    2727public:
     
    3636    typedef QFlags<PaintAttribute> PaintAttributes;
    3737
    38     explicit QwtPlotSpectroCurve( const QString &title = QString::null );
     38    explicit QwtPlotSpectroCurve( const QString &title = QString() );
    3939    explicit QwtPlotSpectroCurve( const QwtText &title );
    4040
     
    6060        const QRectF &canvasRect, int from, int to ) const;
    6161
    62     void setPenWidth(double width);
     62    void setPenWidth( double );
    6363    double penWidth() const;
    6464
  • trunk/BNC/qwt/qwt_plot_spectrogram.cpp

    r8127 r9383  
    162162}
    163163
    164 /*! 
     164/*!
    165165  Build and assign the default pen for the contour lines
    166    
     166
    167167  In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it
    168168  non cosmetic ( see QPen::isCosmetic() ). This method has been introduced
    169169  to hide this incompatibility.
    170    
     170
    171171  \param color Pen color
    172172  \param width Pen width
    173173  \param style Pen style
    174    
     174
    175175  \sa pen(), brush()
    176  */ 
    177 void QwtPlotSpectrogram::setDefaultContourPen( 
     176 */
     177void QwtPlotSpectrogram::setDefaultContourPen(
    178178    const QColor &color, qreal width, Qt::PenStyle style )
    179 {   
     179{
    180180    setDefaultContourPen( QPen( color, width, style ) );
    181181}
     
    363363
    364364   The geometry of a pixel is used to calculated the resolution and
    365    alignment of the rendered image. 
     365   alignment of the rendered image.
    366366
    367367   The default implementation returns data()->pixelHint( rect );
     
    372372   \return Bounding rectangle of a pixel
    373373
    374    \sa QwtPlotRasterItem::pixelHint(), QwtRasterData::pixelHint(), 
     374   \sa QwtPlotRasterItem::pixelHint(), QwtRasterData::pixelHint(),
    375375       render(), renderImage()
    376376*/
     
    403403    const QRectF &area, const QSize &imageSize ) const
    404404{
    405     if ( imageSize.isEmpty() || d_data->data == NULL 
     405    if ( imageSize.isEmpty() || d_data->data == NULL
    406406        || d_data->colorMap == NULL )
    407407    {
     
    424424
    425425#if DEBUG_RENDER
    426         QElapsedTimer time;
    427         time.start();
     426    QElapsedTimer time;
     427    time.start();
    428428#endif
    429429
     
    547547   \sa drawContourLines(), QwtRasterData::contourLines()
    548548*/
    549 QSize QwtPlotSpectrogram::contourRasterSize( 
     549QSize QwtPlotSpectrogram::contourRasterSize(
    550550    const QRectF &area, const QRect &rect ) const
    551551{
  • trunk/BNC/qwt/qwt_plot_spectrogram.h

    r8127 r9383  
    5656    typedef QFlags<DisplayMode> DisplayModes;
    5757
    58     explicit QwtPlotSpectrogram( const QString &title = QString::null );
     58    explicit QwtPlotSpectrogram( const QString &title = QString() );
    5959    virtual ~QwtPlotSpectrogram();
    6060
     
    7272    virtual QRectF pixelHint( const QRectF & ) const;
    7373
    74     void setDefaultContourPen( const QColor &, 
     74    void setDefaultContourPen( const QColor &,
    7575        qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
    7676    void setDefaultContourPen( const QPen & );
     
    8787    virtual int rtti() const;
    8888
    89     virtual void draw( QPainter *p,
     89    virtual void draw( QPainter *,
    9090        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    91         const QRectF &rect ) const;
     91        const QRectF &canvasRect ) const;
    9292
    9393protected:
     
    102102        const QRectF &rect, const QSize &raster ) const;
    103103
    104     virtual void drawContourLines( QPainter *p,
     104    virtual void drawContourLines( QPainter *,
    105105        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    106         const QwtRasterData::ContourLines& lines ) const;
     106        const QwtRasterData::ContourLines& ) const;
    107107
    108108    void renderTile( const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    109         const QRect &imageRect, QImage *image ) const;
     109        const QRect &tile, QImage * ) const;
    110110
    111111private:
  • trunk/BNC/qwt/qwt_plot_svgitem.h

    r8127 r9383  
    2828{
    2929public:
    30     explicit QwtPlotSvgItem( const QString& title = QString::null );
     30    explicit QwtPlotSvgItem( const QString& title = QString() );
    3131    explicit QwtPlotSvgItem( const QwtText& title );
    3232    virtual ~QwtPlotSvgItem();
     
    3737    virtual QRectF boundingRect() const;
    3838
    39     virtual void draw( QPainter *p,
     39    virtual void draw( QPainter *,
    4040        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    41         const QRectF &rect ) const;
     41        const QRectF &canvasRect ) const;
    4242
    4343    virtual int rtti() const;
     
    4747    QSvgRenderer &renderer();
    4848
    49     void render( QPainter *painter,
     49    void render( QPainter *,
    5050        const QRectF &viewBox, const QRectF &rect ) const;
    5151
    52     QRectF viewBox( const QRectF &area ) const;
     52    QRectF viewBox( const QRectF &rect ) const;
    5353
    5454private:
  • trunk/BNC/qwt/qwt_plot_textlabel.cpp

    r8127 r9383  
    1616
    1717static QRect qwtItemRect( int renderFlags,
    18     const QRectF &rect, const QSizeF &itemSize ) 
     18    const QRectF &rect, const QSizeF &itemSize )
    1919{
    2020    int x;
     
    3333
    3434    int y;
    35     if ( renderFlags & Qt::AlignTop ) 
     35    if ( renderFlags & Qt::AlignTop )
    3636    {
    3737        y = rect.top();
     
    5050
    5151class QwtPlotTextLabel::PrivateData
    52 {   
     52{
    5353public:
    5454    PrivateData():
     
    6161
    6262    QPixmap pixmap;
    63 }; 
     63};
    6464
    6565/*!
     
    102102
    103103/*!
    104   Set the text 
     104  Set the text
    105105
    106106  The label will be aligned to the plot canvas according to
     
    211211            pw = qMax( d_data->text.borderPen().width(), 1 );
    212212
    213         QRect pixmapRect; 
     213        QRect pixmapRect;
    214214        pixmapRect.setLeft( qFloor( rect.left() ) - pw );
    215215        pixmapRect.setTop( qFloor( rect.top() ) - pw );
    216216        pixmapRect.setRight( qCeil( rect.right() ) + pw );
    217217        pixmapRect.setBottom( qCeil( rect.bottom() ) + pw );
    218        
     218
    219219#define QWT_HIGH_DPI 1
    220220
     
    225225        const QSize scaledSize = pixmapRect.size();
    226226#endif
    227         if ( d_data->pixmap.isNull() || 
     227        if ( d_data->pixmap.isNull() ||
    228228            ( scaledSize != d_data->pixmap.size() )  )
    229229        {
     
    234234            d_data->pixmap.fill( Qt::transparent );
    235235
    236             const QRect r( pw, pw, 
     236            const QRect r( pw, pw,
    237237                pixmapRect.width() - 2 * pw, pixmapRect.height() - 2 * pw );
    238238
     
    260260   \sa setMargin(), QwtText::renderFlags(), QwtText::textSize()
    261261 */
    262 QRectF QwtPlotTextLabel::textRect( 
     262QRectF QwtPlotTextLabel::textRect(
    263263    const QRectF &rect, const QSizeF &textSize ) const
    264264{
  • trunk/BNC/qwt/qwt_plot_textlabel.h

    r8127 r9383  
    2222  In opposite to QwtPlotMarker the position of the label is unrelated to
    2323  plot coordinates.
    24    
     24
    2525  As drawing a text is an expensive operation the label is cached
    2626  in a pixmap to speed up replots.
    2727
    2828  \par Example
    29   The following code shows how to add a title.
     29    The following code shows how to add a title.
     30    \code
     31      QwtText title( "Plot Title" );
     32      title.setRenderFlags( Qt::AlignHCenter | Qt::AlignTop );
    3033
    31 \verbatim
    32     QwtText title( "Plot Title" );
    33     title.setRenderFlags( Qt::AlignHCenter | Qt::AlignTop );
     34      QFont font;
     35      font.setBold( true );
     36      title.setFont( font );
    3437
    35     QFont font;
    36     font.setBold( true );
    37     title.setFont( font );
    38 
    39     QwtPlotTextLabel *titleItem = new QwtPlotTextLabel();
    40     titleItem->setText( title );
    41     titleItem->attach( this );
    42 \endverbatim
     38      QwtPlotTextLabel *titleItem = new QwtPlotTextLabel();
     39      titleItem->setText( title );
     40      titleItem->attach( plot );
     41    \endcode
     42  \endpar
    4343
    4444  \sa QwtPlotMarker
    45 */ 
     45*/
    4646
    4747class QWT_EXPORT QwtPlotTextLabel: public QwtPlotItem
  • 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() );
  • trunk/BNC/qwt/qwt_plot_tradingcurve.h

    r8127 r9383  
    2222  that are used in the domain of technical analysis.
    2323
    24   While the length ( height or width depending on orientation() ) 
     24  While the length ( height or width depending on orientation() )
    2525  of each symbol depends on the corresponding OHLC sample the size
    2626  of the other dimension can be controlled using:
     
    3232  The extent is a size in scale coordinates, so that the symbol width
    3333  is increasing when the plot is zoomed in. Minimum/Maximum width
    34   is in widget coordinates independent from the zoom level. 
    35   When setting the minimum and maximum to the same value, the width of 
    36   the symbol is fixed. 
     34  is in widget coordinates independent from the zoom level.
     35  When setting the minimum and maximum to the same value, the width of
     36  the symbol is fixed.
    3737*/
    38 class QWT_EXPORT QwtPlotTradingCurve: 
    39     public QwtPlotSeriesItem, QwtSeriesStore<QwtOHLCSample>
     38class QWT_EXPORT QwtPlotTradingCurve:
     39    public QwtPlotSeriesItem, public QwtSeriesStore<QwtOHLCSample>
    4040{
    4141public:
     
    102102    typedef QFlags<PaintAttribute> PaintAttributes;
    103103
    104     explicit QwtPlotTradingCurve( const QString &title = QString::null );
     104    explicit QwtPlotTradingCurve( const QString &title = QString() );
    105105    explicit QwtPlotTradingCurve( const QwtText &title );
    106106
     
    118118    SymbolStyle symbolStyle() const;
    119119
    120     void setSymbolPen( const QColor &, 
     120    void setSymbolPen( const QColor &,
    121121        qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
    122122    void setSymbolPen( const QPen & );
     
    126126    QBrush symbolBrush( Direction ) const;
    127127
    128     void setSymbolExtent( double width );
     128    void setSymbolExtent( double );
    129129    double symbolExtent() const;
    130130
     
    151151        const QRectF &canvasRect, int from, int to ) const;
    152152
    153     virtual void drawUserSymbol( QPainter *, 
     153    virtual void drawUserSymbol( QPainter *,
    154154        SymbolStyle, const QwtOHLCSample &,
     155        Qt::Orientation, bool inverted, double symbolWidth ) const;
     156
     157    void drawBar( QPainter *painter, const QwtOHLCSample &,
    155158        Qt::Orientation, bool inverted, double width ) const;
    156159
    157     void drawBar( QPainter *painter, const QwtOHLCSample &,
    158         Qt::Orientation, bool inverted, double width ) const;
    159 
    160     void drawCandleStick( QPainter *, const QwtOHLCSample &,
     160    void drawCandleStick( QPainter *, const QwtOHLCSample &,
    161161        Qt::Orientation, double width ) const;
    162162
  • trunk/BNC/qwt/qwt_plot_xml.cpp

    r8127 r9383  
    2929  from a specific editor in the Qwt designer plugin.
    3030
    31   \return QString::null
     31  \return QString()
    3232  \warning The plot editor has never been implemented.
    3333*/
     
    3838    return title().text();
    3939#else
    40     return QString::null;
     40    return QString();
    4141#endif
    4242}
  • trunk/BNC/qwt/qwt_plot_zoneitem.cpp

    r8127 r9383  
    1414
    1515class QwtPlotZoneItem::PrivateData
    16 {   
     16{
    1717public:
    1818    PrivateData():
     
    2424        brush = QBrush( c );
    2525    }
    26        
     26
    2727    Qt::Orientation orientation;
    2828    QPen pen;
    2929    QBrush brush;
    3030    QwtInterval interval;
    31 }; 
     31};
    3232
    3333/*!
     
    6868}
    6969
    70 /*! 
     70/*!
    7171  Build and assign a pen
    72    
     72
    7373  In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it
    7474  non cosmetic ( see QPen::isCosmetic() ). This method has been introduced
    7575  to hide this incompatibility.
    76    
     76
    7777  \param color Pen color
    7878  \param width Pen width
    7979  \param style Pen style
    80    
     80
    8181  \sa pen(), brush()
    82  */ 
     82 */
    8383void QwtPlotZoneItem::setPen( const QColor &color, qreal width, Qt::PenStyle style )
    84 {   
     84{
    8585    setPen( QPen( color, width, style ) );
    8686}
    8787
    8888/*!
    89   \brief Assign a pen 
     89  \brief Assign a pen
    9090
    9191  The pen is used to draw the border lines of the zone
     
    112112}
    113113
    114 /*! 
    115   \brief Assign a brush 
    116    
     114/*!
     115  \brief Assign a brush
     116
    117117  The brush is used to fill the zone
    118118
     
    141141  \brief Set the orientation of the zone
    142142
    143   A horizontal zone highlights an interval of the y axis, 
    144   a vertical zone of the x axis. It is unbounded in the 
     143  A horizontal zone highlights an interval of the y axis,
     144  a vertical zone of the x axis. It is unbounded in the
    145145  opposite direction.
    146146
     
    196196    {
    197197        d_data->interval = interval;
    198         itemChanged(); 
    199     }   
    200 }   
     198        itemChanged();
     199    }
     200}
    201201
    202202/*!
     
    207207{
    208208    return d_data->interval;
    209 }   
     209}
    210210
    211211/*!
     
    286286}
    287287
    288 /*! 
     288/*!
    289289  The bounding rectangle is build from the interval in one direction
    290290  and something invalid for the opposite direction.
  • trunk/BNC/qwt/qwt_plot_zoneitem.h

    r8127 r9383  
    2121  \brief A plot item, which displays a zone
    2222
    23   A horizontal zone highlights an interval of the y axis - a vertical 
     23  A horizontal zone highlights an interval of the y axis - a vertical
    2424  zone an interval of the x axis - and is unbounded in the opposite direction.
    25   It is filled with a brush and its border lines are optionally displayed with a pen. 
     25  It is filled with a brush and its border lines are optionally displayed with a pen.
    2626
    27   \note For displaying an area that is bounded for x and y coordinates 
     27  \note For displaying an area that is bounded for x and y coordinates
    2828        use QwtPlotShapeItem
    2929*/
    3030
    31 class QWT_EXPORT QwtPlotZoneItem: 
     31class QWT_EXPORT QwtPlotZoneItem:
    3232    public QwtPlotItem
    3333{
  • trunk/BNC/qwt/qwt_plot_zoomer.cpp

    r8127 r9383  
    1414#include <qalgorithms.h>
    1515
    16 static QwtInterval qwtExpandedZoomInterval( double v1, double v2, 
     16static QwtInterval qwtExpandedZoomInterval( double v1, double v2,
    1717    double minRange, const QwtTransform* transform )
    1818{
  • trunk/BNC/qwt/qwt_plot_zoomer.h

    r8127 r9383  
    2323  the coordinates of the current mouse position.
    2424
    25   Zooming can be repeated as often as possible, limited only by 
     25  Zooming can be repeated as often as possible, limited only by
    2626  maxStackDepth() or minZoomSize().  Each rectangle is pushed on a stack.
    2727
    28   The default setting how to select rectangles is 
     28  The default setting how to select rectangles is
    2929  a QwtPickerDragRectMachine with the following bindings:
    3030
    3131  - QwtEventPattern::MouseSelect1\n
    32     The first point of the zoom rectangle is selected by a mouse press, 
     32    The first point of the zoom rectangle is selected by a mouse press,
    3333    the second point from the position, where the mouse is released.
    3434
     
    4545  - QwtEventPattern::MouseSelect3, QwtEventPattern::KeyUndo\n
    4646    Zoom out one position on the zoom stack
    47    
     47
    4848  - QwtEventPattern::MouseSelect6, QwtEventPattern::KeyRedo\n
    4949    Zoom in one position on the zoom stack
     
    5353
    5454  The setKeyPattern() and setMousePattern() functions can be used
    55   to configure the zoomer actions. The following example 
    56   shows, how to configure the 'I' and 'O' keys for zooming in and out 
    57   one position on the zoom stack. The "Home" key is used to 
     55  to configure the zoomer actions. The following example
     56  shows, how to configure the 'I' and 'O' keys for zooming in and out
     57  one position on the zoom stack. The "Home" key is used to
    5858  "unzoom" the plot.
    5959
     
    103103
    104104public Q_SLOTS:
    105     void moveBy( double x, double y );
     105    void moveBy( double dx, double dy );
    106106    virtual void moveTo( const QPointF & );
    107107
    108108    virtual void zoom( const QRectF & );
    109     virtual void zoom( int up );
     109    virtual void zoom( int offset );
    110110
    111111Q_SIGNALS:
  • trunk/BNC/qwt/qwt_point_3d.cpp

    r4271 r9383  
    1414QDebug operator<<( QDebug debug, const QwtPoint3D &point )
    1515{
    16     debug.nospace() << "QwtPoint3D(" << point.x() 
     16    debug.nospace() << "QwtPoint3D(" << point.x()
    1717        << "," << point.y() << "," << point.z() << ")";
    1818    return debug.space();
  • trunk/BNC/qwt/qwt_point_data.cpp

    r8127 r9383  
    287287   interval is calculated from the "rectangle of interest".
    288288
    289    \param index Index of the requested point 
     289   \param index Index of the requested point
    290290   \return Calculated x coordinate
    291291
     
    297297        d_interval : d_intervalOfInterest;
    298298
    299     if ( !interval.isValid() ) 
     299    if ( !interval.isValid() )
    300300        return 0.0;
    301301
  • trunk/BNC/qwt/qwt_point_data.h

    r8127 r9383  
    2626
    2727    virtual size_t size() const;
    28     virtual QPointF sample( size_t i ) const;
     28    virtual QPointF sample( size_t index ) const;
    2929
    3030    const QVector<double> &xData() const;
     
    4646    virtual QRectF boundingRect() const;
    4747    virtual size_t size() const;
    48     virtual QPointF sample( size_t i ) const;
     48    virtual QPointF sample( size_t index ) const;
    4949
    5050    const double *xData() const;
     
    123123
    124124    virtual QRectF boundingRect() const;
    125     virtual QPointF sample( size_t i ) const;
     125    virtual QPointF sample( size_t index ) const;
    126126
    127127    /*!
  • trunk/BNC/qwt/qwt_point_mapper.cpp

    r8127 r9383  
    2323
    2424#if !defined(QT_NO_QFUTURE)
    25 #define QWT_USE_THREADS 0
     25#define QWT_USE_THREADS 1
    2626#endif
    2727
     
    4343static void qwtRenderDots(
    4444    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    45     const QwtDotsCommand command, const QPoint &pos, QImage *image ) 
     45    const QwtDotsCommand command, const QPoint &pos, QImage *image )
    4646{
    4747    const QRgb rgb = command.rgb;
     
    9595
    9696struct QwtNoRoundF
    97 {   
     97{
    9898    inline double operator()( double value )
    9999    {
     
    106106
    107107template<class Polygon, class Point, class Round>
    108 static inline Polygon qwtToPoints( 
     108static inline Polygon qwtToPoints(
    109109    const QRectF &boundingRect,
    110110    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    111     const QwtSeriesData<QPointF> *series, 
     111    const QwtSeriesData<QPointF> *series,
    112112    int from, int to, Round round )
    113113{
     
    169169    int from, int to )
    170170{
    171     return qwtToPoints<QPolygon, QPoint>( 
     171    return qwtToPoints<QPolygon, QPoint>(
    172172        boundingRect, xMap, yMap, series, from, to, QwtRoundI() );
    173173}
     
    180180    int from, int to, Round round )
    181181{
    182     return qwtToPoints<QPolygonF, QPointF>( 
     182    return qwtToPoints<QPolygonF, QPointF>(
    183183        boundingRect, xMap, yMap, series, from, to, round );
    184184}
     
    188188
    189189template<class Polygon, class Point, class Round>
    190 static inline Polygon qwtToPolylineFiltered( 
    191     const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    192     const QwtSeriesData<QPointF> *series, 
     190static inline Polygon qwtToPolylineFiltered(
     191    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
     192    const QwtSeriesData<QPointF> *series,
    193193    int from, int to, Round round )
    194194{
     
    239239    return qwtToPolylineFiltered<QPolygonF, QPointF>(
    240240        xMap, yMap, series, from, to, round );
    241 } 
     241}
    242242
    243243template<class Polygon, class Point>
     
    283283    return qwtToPointsFiltered<QPolygon, QPoint>(
    284284        boundingRect, xMap, yMap, series, from, to );
    285 } 
     285}
    286286
    287287static inline QPolygonF qwtToPointsFilteredF(
     
    390390
    391391  When the WeedOutPoints flag is enabled consecutive points,
    392   that are mapped to the same position will be one point. 
     392  that are mapped to the same position will be one point.
    393393
    394394  When RoundPoints is set all points are rounded to integers
     
    414414        if ( d_data->flags & RoundPoints )
    415415        {
    416             polyline = qwtToPolylineFilteredF( 
     416            polyline = qwtToPolylineFilteredF(
    417417                xMap, yMap, series, from, to, QwtRoundF() );
    418418        }
    419419        else
    420420        {
    421             polyline = qwtToPolylineFilteredF( 
     421            polyline = qwtToPolylineFilteredF(
    422422                xMap, yMap, series, from, to, QwtNoRoundF() );
    423423        }
     
    427427        if ( d_data->flags & RoundPoints )
    428428        {
    429             polyline = qwtToPointsF( qwtInvalidRect, 
     429            polyline = qwtToPointsF( qwtInvalidRect,
    430430                xMap, yMap, series, from, to, QwtRoundF() );
    431431        }
    432432        else
    433433        {
    434             polyline = qwtToPointsF( qwtInvalidRect, 
     434            polyline = qwtToPointsF( qwtInvalidRect,
    435435                xMap, yMap, series, from, to, QwtNoRoundF() );
    436436        }
     
    444444
    445445  When the WeedOutPoints flag is enabled consecutive points,
    446   that are mapped to the same position will be one point. 
     446  that are mapped to the same position will be one point.
    447447
    448448  \param xMap x map
     
    462462    if ( d_data->flags & WeedOutPoints )
    463463    {
    464         polyline = qwtToPolylineFilteredI( 
     464        polyline = qwtToPolylineFilteredI(
    465465            xMap, yMap, series, from, to );
    466466    }
    467467    else
    468468    {
    469         polyline = qwtToPointsI( 
     469        polyline = qwtToPointsI(
    470470            qwtInvalidRect, xMap, yMap, series, from, to );
    471471    }
     
    478478
    479479  - WeedOutPoints & RoundPoints & boundingRect().isValid()
    480     All points that are mapped to the same position 
     480    All points that are mapped to the same position
    481481    will be one point. Points outside of the bounding
    482482    rectangle are ignored.
    483  
     483
    484484  - WeedOutPoints & RoundPoints & !boundingRect().isValid()
    485     All consecutive points that are mapped to the same position 
     485    All consecutive points that are mapped to the same position
    486486    will one point
    487487
    488   - WeedOutPoints & !RoundPoints 
    489     All consecutive points that are mapped to the same position 
     488  - WeedOutPoints & !RoundPoints
     489    All consecutive points that are mapped to the same position
    490490    will one point
    491491
     
    516516        {
    517517            if ( d_data->boundingRect.isValid() )
    518             {   
     518            {
    519519                points = qwtToPointsFilteredF( d_data->boundingRect,
    520520                    xMap, yMap, series, from, to );
    521521            }
    522522            else
    523             {   
     523            {
    524524                // without a bounding rectangle all we can
    525525                // do is to filter out duplicates of
    526526                // consecutive points
    527527
    528                 points = qwtToPolylineFilteredF( 
     528                points = qwtToPolylineFilteredF(
    529529                    xMap, yMap, series, from, to, QwtRoundF() );
    530530            }
     
    535535            // qwtToPointsFilteredF
    536536
    537             points = qwtToPolylineFilteredF( 
     537            points = qwtToPolylineFilteredF(
    538538                xMap, yMap, series, from, to, QwtNoRoundF() );
    539539        }
     
    560560
    561561  - WeedOutPoints & boundingRect().isValid()
    562     All points that are mapped to the same position 
     562    All points that are mapped to the same position
    563563    will be one point. Points outside of the bounding
    564564    rectangle are ignored.
    565  
     565
    566566  - WeedOutPoints & !boundingRect().isValid()
    567     All consecutive points that are mapped to the same position 
     567    All consecutive points that are mapped to the same position
    568568    will one point
    569569
     
    597597            // we can do is to filter out consecutive duplicates
    598598
    599             points = qwtToPolylineFilteredI( 
     599            points = qwtToPolylineFilteredI(
    600600                xMap, yMap, series, from, to );
    601601        }
     
    603603    else
    604604    {
    605         points = qwtToPointsI( 
     605        points = qwtToPointsI(
    606606            d_data->boundingRect, xMap, yMap, series, from, to );
    607607    }
     
    631631QImage QwtPointMapper::toImage(
    632632    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    633     const QwtSeriesData<QPointF> *series, int from, int to, 
     633    const QwtSeriesData<QPointF> *series, int from, int to,
    634634    const QPen &pen, bool antialiased, uint numThreads ) const
    635635{
     
    681681                command.to = index0 + numPoints - 1;
    682682
    683                 futures += QtConcurrent::run( &qwtRenderDots, 
     683                futures += QtConcurrent::run( &qwtRenderDots,
    684684                    xMap, yMap, command, pos, &image );
    685685            }
  • trunk/BNC/qwt/qwt_point_mapper.h

    r8127 r9383  
    2323
    2424  QwtPointMapper is a collection of methods and optimizations
    25   for translating a series of points into paint device coordinates. 
    26   It is used by QwtPlotCurve but might also be useful for 
     25  for translating a series of points into paint device coordinates.
     26  It is used by QwtPlotCurve but might also be useful for
    2727  similar plot items displaying a QwtSeriesData<QPointF>.
    2828 */
     
    3030{
    3131public:
    32     /*! 
     32    /*!
    3333      \brief Flags affecting the transformation process
    3434      \sa setFlag(), setFlags()
     
    3939        RoundPoints = 0x01,
    4040
    41         /*! 
     41        /*!
    4242          Try to remove points, that are translated to the
    4343          same position.
     
    4646    };
    4747
    48     /*! 
     48    /*!
    4949      \brief Flags affecting the transformation process
    5050      \sa setFlag(), setFlags()
     
    7777
    7878    QImage toImage( const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    79         const QwtSeriesData<QPointF> *series, int from, int to, 
     79        const QwtSeriesData<QPointF> *series, int from, int to,
    8080        const QPen &, bool antialiased, uint numThreads ) const;
    8181
  • trunk/BNC/qwt/qwt_point_polar.cpp

    r8127 r9383  
    112112QDebug operator<<( QDebug debug, const QwtPointPolar &point )
    113113{
    114     debug.nospace() << "QwtPointPolar(" 
     114    debug.nospace() << "QwtPointPolar("
    115115        << point.azimuth() << "," << point.radius() << ")";
    116116
  • trunk/BNC/qwt/qwt_point_polar.h

    r8127 r9383  
    3131    QwtPointPolar();
    3232    QwtPointPolar( double azimuth, double radius );
    33     QwtPointPolar( const QwtPointPolar & );
    3433    QwtPointPolar( const QPointF & );
    3534
     
    8079    d_azimuth( azimuth ),
    8180    d_radius( radius )
    82 {
    83 }
    84 
    85 /*!
    86     Constructs a point using the values of the point specified.
    87     \param other Other point
    88 */
    89 inline QwtPointPolar::QwtPointPolar( const QwtPointPolar &other ):
    90     d_azimuth( other.d_azimuth ),
    91     d_radius( other.d_radius )
    9281{
    9382}
     
    191180inline QPointF qwtFastDegree2Pos( const QPointF &pole,
    192181    double radius, double angle )
    193 {   
     182{
    194183    return qwtFastPolar2Pos( pole, radius, angle / 180.0 * M_PI );
    195 } 
     184}
    196185
    197186inline QwtPointPolar qwtFastPos2Polar( const QPointF &pos )
     
    201190}
    202191
    203 #endif 
     192#endif
  • trunk/BNC/qwt/qwt_raster_data.cpp

    r8127 r9383  
    217217   \brief Pixel hint
    218218
    219    pixelHint() returns the geometry of a pixel, that can be used 
     219   pixelHint() returns the geometry of a pixel, that can be used
    220220   to calculate the resolution and alignment of the plot item, that is
    221    representing the data. 
    222    
    223    Width and height of the hint need to be the horizontal 
    224    and vertical distances between 2 neighbored points. 
    225    The center of the hint has to be the position of any point 
     221   representing the data.
     222
     223   Width and height of the hint need to be the horizontal
     224   and vertical distances between 2 neighbored points.
     225   The center of the hint has to be the position of any point
    226226   ( it doesn't matter which one ).
    227227
     
    230230   Limiting the resolution of the image might significantly improve
    231231   the performance and heavily reduce the amount of memory when rendering
    232    a QImage from the raster data. 
     232   a QImage from the raster data.
    233233
    234234   The default implementation returns an empty rectangle recommending
     
    238238               depend on the requested area.
    239239
    240    \return Bounding rectangle of a pixel 
     240   \return Bounding rectangle of a pixel
    241241*/
    242242QRectF QwtRasterData::pixelHint( const QRectF &area ) const
    243243{
    244244    Q_UNUSED( area );
    245     return QRectF(); 
     245    return QRectF();
    246246}
    247247
     
    281281    QwtRasterData *that = const_cast<QwtRasterData *>( this );
    282282    that->initRaster( rect, raster );
     283
     284#if __GNUC__ >= 9
     285#pragma GCC diagnostic push
     286#pragma GCC diagnostic ignored "-Wdeprecated-copy"
     287#endif
    283288
    284289    for ( int y = 0; y < raster.height() - 1; y++ )
     
    399404    }
    400405
     406#if __GNUC__ >= 9
     407#pragma GCC diagnostic pop
     408#endif
     409
    401410    that->discardRaster();
    402411
  • trunk/BNC/qwt/qwt_round_scale_draw.cpp

    r8127 r9383  
    185185   \param painter Painter
    186186   \param value Value of the tick
    187    \param len Lenght of the tick
     187   \param len Length of the tick
    188188
    189189   \sa drawBackbone(), drawLabel()
  • trunk/BNC/qwt/qwt_round_scale_draw.h

    r8127 r9383  
    4646
    4747protected:
    48     virtual void drawTick( QPainter *, double val, double len ) const;
     48    virtual void drawTick( QPainter *, double value, double len ) const;
    4949    virtual void drawBackbone( QPainter * ) const;
    5050    virtual void drawLabel( QPainter *, double val ) const;
  • trunk/BNC/qwt/qwt_sampling_thread.h

    r8127 r9383  
     1/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
     2 * Qwt Widget Library
     3 * Copyright (C) 1997   Josef Wilgen
     4 * Copyright (C) 2002   Uwe Rathmann
     5 *
     6 * This library is free software; you can redistribute it and/or
     7 * modify it under the terms of the Qwt License, Version 1.0
     8 *****************************************************************************/
     9
    110#ifndef _QWT_SAMPLING_THREAD_H_
    211#define _QWT_SAMPLING_THREAD_H_
  • trunk/BNC/qwt/qwt_scale_div.cpp

    r8127 r9383  
    7171*/
    7272QwtScaleDiv::QwtScaleDiv( double lowerBound, double upperBound,
    73         const QList<double> &minorTicks, 
     73        const QList<double> &minorTicks,
    7474        const QList<double> &mediumTicks,
    7575        const QList<double> &majorTicks ):
     
    133133{
    134134    return d_lowerBound;
    135 }   
     135}
    136136
    137137/*!
     
    144144{
    145145    d_upperBound = upperBound;
    146 } 
     146}
    147147
    148148/*!
     
    219219}
    220220
    221 /*! 
     221/*!
    222222   Invert the scale division
    223223   \sa inverted()
     
    239239}
    240240
    241 /*! 
     241/*!
    242242  \return A scale division with inverted boundaries and ticks
    243243  \sa invert()
     
    251251}
    252252
    253 /*! 
     253/*!
    254254   Return a scale division with an interval [lowerBound, upperBound]
    255255   where all ticks outside this interval are removed
     
    262262   \note lowerBound might be greater than upperBound for inverted scales
    263263*/
    264 QwtScaleDiv QwtScaleDiv::bounded( 
     264QwtScaleDiv QwtScaleDiv::bounded(
    265265    double lowerBound, double upperBound ) const
    266266{
  • trunk/BNC/qwt/qwt_scale_div.h

    r8127 r9383  
    5656    };
    5757
    58     explicit QwtScaleDiv( double lowerBound = 0.0, 
     58    explicit QwtScaleDiv( double lowerBound = 0.0,
    5959        double upperBound = 0.0 );
    6060
     
    6464        QList<double>[NTickTypes] );
    6565
    66     explicit QwtScaleDiv( double lowerBound, double upperBound, 
     66    explicit QwtScaleDiv( double lowerBound, double upperBound,
    6767        const QList<double> &minorTicks, const QList<double> &mediumTicks,
    6868        const QList<double> &majorTicks );
  • trunk/BNC/qwt/qwt_scale_draw.cpp

    r8127 r9383  
    118118  \param end End border distance
    119119*/
    120 void QwtScaleDraw::getBorderDistHint( 
     120void QwtScaleDraw::getBorderDistHint(
    121121    const QFont &font, int &start, int &end ) const
    122122{
     
    235235    }
    236236
    237     double angle = qwtRadians( labelRotation() ); 
     237    double angle = qwtRadians( labelRotation() );
    238238    if ( vertical )
    239239        angle += M_PI / 2;
     
    348348   Find the position, where to paint a label
    349349
    350    The position has a distance that depends on the length of the ticks 
     350   The position has a distance that depends on the length of the ticks
    351351   in direction of the alignment().
    352352
  • trunk/BNC/qwt/qwt_scale_draw.h

    r8127 r9383  
    3636        \sa setAlignment(), alignment()
    3737     */
    38     enum Alignment 
    39     { 
     38    enum Alignment
     39    {
    4040        //! The scale is below
    41         BottomScale, 
     41        BottomScale,
    4242
    4343        //! The scale is above
    44         TopScale, 
     44        TopScale,
    4545
    4646        //! The scale is left
    47         LeftScale, 
     47        LeftScale,
    4848
    4949        //! The scale is right
    50         RightScale 
     50        RightScale
    5151    };
    5252
     
    8181    int maxLabelWidth( const QFont & ) const;
    8282
    83     QPointF labelPosition( double val ) const;
     83    QPointF labelPosition( double value ) const;
    8484
    85     QRectF labelRect( const QFont &, double val ) const;
    86     QSizeF labelSize( const QFont &, double val ) const;
     85    QRectF labelRect( const QFont &, double value ) const;
     86    QSizeF labelSize( const QFont &, double value ) const;
    8787
    88     QRect boundingLabelRect( const QFont &, double val ) const;
     88    QRect boundingLabelRect( const QFont &, double value ) const;
    8989
    9090protected:
    9191    QTransform labelTransformation( const QPointF &, const QSizeF & ) const;
    9292
    93     virtual void drawTick( QPainter *, double val, double len ) const;
     93    virtual void drawTick( QPainter *, double value, double len ) const;
    9494    virtual void drawBackbone( QPainter * ) const;
    95     virtual void drawLabel( QPainter *, double val ) const;
     95    virtual void drawLabel( QPainter *, double value ) const;
    9696
    9797private:
  • trunk/BNC/qwt/qwt_scale_engine.cpp

    r8127 r9383  
    3232}
    3333
    34 static inline QwtInterval qwtPowInterval( double base, const QwtInterval &interval ) 
     34static inline QwtInterval qwtPowInterval( double base, const QwtInterval &interval )
    3535{
    3636    return QwtInterval( qPow( base, interval.minValue() ),
     
    5252static double qwtStepSize( double intervalSize, int maxSteps, uint base )
    5353{
    54     const double minStep = 
     54    const double minStep =
    5555        QwtScaleArithmetic::divideInterval( intervalSize, maxSteps, base );
    5656
     
    171171  \return Calculated step size
    172172 */
    173 double QwtScaleArithmetic::divideInterval( 
    174     double intervalSize, int numSteps, uint base ) 
     173double QwtScaleArithmetic::divideInterval(
     174    double intervalSize, int numSteps, uint base )
    175175{
    176176    if ( numSteps <= 0 )
     
    269269
    270270/*!
    271    Create and return a clone of the transformation 
     271   Create and return a clone of the transformation
    272272   of the engine. When the engine has no special transformation
    273273   NULL is returned, indicating no transformation.
     
    340340    double intervalSize, int numSteps ) const
    341341{
    342     return QwtScaleArithmetic::divideInterval( 
     342    return QwtScaleArithmetic::divideInterval(
    343343        intervalSize, numSteps, d_data->base );
    344344}
     
    468468/*!
    469469  \brief Specify a reference point
    470   \param r new reference value
     470  \param reference New reference value
    471471
    472472  The reference point is needed if options IncludeReference or
     
    475475  \sa Attribute
    476476*/
    477 void QwtScaleEngine::setReference( double r )
    478 {
    479     d_data->referenceValue = r;
     477void QwtScaleEngine::setReference( double reference )
     478{
     479    d_data->referenceValue = reference;
    480480}
    481481
     
    502502 */
    503503void QwtScaleEngine::setBase( uint base )
    504 { 
     504{
    505505    d_data->base = qMax( base, 2U );
    506506}
     
    559559        interval = buildInterval( interval.minValue() );
    560560
    561     stepSize = QwtScaleArithmetic::divideInterval( 
     561    stepSize = QwtScaleArithmetic::divideInterval(
    562562        interval.width(), qMax( maxNumSteps, 1 ), base() );
    563563
     
    607607            maxMajorSteps = 1;
    608608
    609         stepSize = QwtScaleArithmetic::divideInterval( 
     609        stepSize = QwtScaleArithmetic::divideInterval(
    610610            interval.width(), maxMajorSteps, base() );
    611611    }
     
    757757    double x2 = interval.maxValue();
    758758
    759     // when there is no rounding beside some effect, when 
     759    // when there is no rounding beside some effect, when
    760760    // calculating with doubles, we keep the original value
    761761
     
    868868        interval = buildInterval( interval.minValue() );
    869869
    870     stepSize = divideInterval( qwtLogInterval( logBase, interval ).width(), 
     870    stepSize = divideInterval( qwtLogInterval( logBase, interval ).width(),
    871871        qMax( maxNumSteps, 1 ) );
    872872    if ( stepSize < 1.0 )
     
    928928            maxMajorSteps = 1;
    929929
    930         stepSize = divideInterval( 
     930        stepSize = divideInterval(
    931931            qwtLogInterval( logBase, interval ).width(), maxMajorSteps );
    932932        if ( stepSize < 1.0 )
     
    10331033        if ( minStep == 0.0 )
    10341034            return;
    1035        
    1036         const int numSteps = qRound( stepSize / minStep ); 
     1035
     1036        const int numSteps = qRound( stepSize / minStep );
    10371037
    10381038        int mediumTickIndex = -1;
     
    10881088
    10891089        if ( numTicks < 1 )
    1090             return; 
     1090            return;
    10911091
    10921092        int mediumTickIndex = -1;
  • trunk/BNC/qwt/qwt_scale_engine.h

    r8127 r9383  
    2626    static double floorEps( double value, double intervalSize );
    2727
    28     static double divideEps( double interval, double steps );
    29 
    30     static double divideInterval( double interval,
     28    static double divideEps( double intervalSize, double numSteps );
     29
     30    static double divideInterval( double intervalSize,
    3131        int numSteps, uint base );
    3232};
     
    4040  The layout of the scale can be varied with setAttribute().
    4141
    42   Qwt offers implementations for logarithmic and linear scales. 
     42  Qwt offers implementations for logarithmic and linear scales.
    4343*/
    4444
     
    4646{
    4747public:
    48     /*! 
     48    /*!
    4949       Layout attributes
    5050       \sa setAttribute(), testAttribute(), reference(),
     
    6565        /*!
    6666           The endpoints of the scale are supposed to be equal the
    67            outmost included values plus the specified margins 
     67           outmost included values plus the specified margins
    6868           (see setMargins()).
    6969           If this attribute is *not* set, the endpoints of the scale will
     
    9191    Attributes attributes() const;
    9292
    93     void setReference( double reference );
     93    void setReference( double );
    9494    double reference() const;
    9595
     
    129129
    130130protected:
    131     bool contains( const QwtInterval &, double val ) const;
     131    bool contains( const QwtInterval &, double value ) const;
    132132    QList<double> strip( const QList<double>&, const QwtInterval & ) const;
    133133
    134     double divideInterval( double interval, int numSteps ) const;
    135 
    136     QwtInterval buildInterval( double v ) const;
     134    double divideInterval( double intervalSize, int numSteps ) const;
     135
     136    QwtInterval buildInterval( double value ) const;
    137137
    138138private:
     
    154154    virtual ~QwtLinearScaleEngine();
    155155
    156     virtual void autoScale( int maxSteps,
     156    virtual void autoScale( int maxNumSteps,
    157157        double &x1, double &x2, double &stepSize ) const;
    158158
    159159    virtual QwtScaleDiv divideScale( double x1, double x2,
    160         int numMajorSteps, int numMinorSteps,
    161                                      double stepSize = 0.0 ) const;
     160        int maxMajorSteps, int maxMinorSteps,
     161        double stepSize = 0.0 ) const;
    162162
    163163
     
    166166
    167167    void buildTicks(
    168         const QwtInterval &, double stepSize, int maxMinSteps,
     168        const QwtInterval &, double stepSize, int maxMinorSteps,
    169169        QList<double> ticks[QwtScaleDiv::NTickTypes] ) const;
    170170
     
    194194    virtual ~QwtLogScaleEngine();
    195195
    196     virtual void autoScale( int maxSteps,
     196    virtual void autoScale( int maxNumSteps,
    197197        double &x1, double &x2, double &stepSize ) const;
    198198
    199199    virtual QwtScaleDiv divideScale( double x1, double x2,
    200         int numMajorSteps, int numMinorSteps,
     200        int maxMajorSteps, int maxMinorSteps,
    201201        double stepSize = 0.0 ) const;
    202202
     
    205205
    206206    void buildTicks(
    207         const QwtInterval &, double stepSize, int maxMinSteps,
     207        const QwtInterval &, double stepSize, int maxMinorSteps,
    208208        QList<double> ticks[QwtScaleDiv::NTickTypes] ) const;
    209209
  • trunk/BNC/qwt/qwt_scale_map.cpp

    r8127 r9383  
    9494  \param s1 first border
    9595  \param s2 second border
    96   \warning scales might be aligned to 
     96  \warning scales might be aligned to
    9797           transformation depending boundaries
    9898*/
     
    187187    const QwtScaleMap &yMap, const QPointF &pos )
    188188{
    189     return QPointF( 
    190         xMap.invTransform( pos.x() ), 
    191         yMap.invTransform( pos.y() ) 
     189    return QPointF(
     190        xMap.invTransform( pos.x() ),
     191        yMap.invTransform( pos.y() )
    192192    );
    193193}
     
    206206    const QwtScaleMap &yMap, const QPointF &pos )
    207207{
    208     return QPointF( 
    209         xMap.transform( pos.x() ), 
     208    return QPointF(
     209        xMap.transform( pos.x() ),
    210210        yMap.transform( pos.y() )
    211211    );
  • trunk/BNC/qwt/qwt_scale_map.h

    r8127 r9383  
    2525
    2626   QwtScaleMap offers transformations from the coordinate system
    27    of a scale into the linear coordinate system of a paint device 
     27   of a scale into the linear coordinate system of a paint device
    2828   and vice versa.
    2929*/
  • trunk/BNC/qwt/qwt_scale_widget.cpp

    r8127 r9383  
    2121#include <qstyle.h>
    2222#include <qstyleoption.h>
     23#include <qapplication.h>
    2324
    2425class QwtScaleWidget::PrivateData
     
    146147        else
    147148            d_data->layoutFlags &= ~flag;
     149
     150        update();
    148151    }
    149152}
     
    574577    {
    575578        updateGeometry();
     579
     580#if 1
     581        /*
     582            for some reason updateGeometry does not send a LayoutRequest event
     583            when the parent is not visible and has no layout
     584         */
     585
     586        if ( QWidget* w = parentWidget() )
     587        {
     588            if ( !w->isVisible() && w->layout() == NULL )
     589            {
     590                if ( w->testAttribute( Qt::WA_WState_Polished ) )
     591                    QApplication::postEvent( w, new QEvent( QEvent::LayoutRequest ) );
     592            }
     593        }
     594#endif
     595
    576596        update();
    577597    }
     
    768788  is returned.
    769789
    770   \param start Return parameter for the border width at 
     790  \param start Return parameter for the border width at
    771791               the beginning of the scale
    772   \param end Return parameter for the border width at the 
     792  \param end Return parameter for the border width at the
    773793             end of the scale
    774794
     
    808828  the widget borders.
    809829
    810   \param start Return parameter for the border width at 
     830  \param start Return parameter for the border width at
    811831               the beginning of the scale
    812   \param end Return parameter for the border width at the 
     832  \param end Return parameter for the border width at the
    813833             end of the scale
    814834
  • trunk/BNC/qwt/qwt_scale_widget.h

    r8127 r9383  
    4040    {
    4141        /*!
    42           The title of vertical scales is painted from top to bottom. 
     42          The title of vertical scales is painted from top to bottom.
    4343          Otherwise it is painted from bottom to top.
    4444         */
     
    6565    bool testLayoutFlag( LayoutFlag ) const;
    6666
    67     void setBorderDist( int start, int end );
     67    void setBorderDist( int dist1, int dist2 );
    6868    int startBorderDist() const;
    6969    int endBorderDist() const;
     
    7777    int margin() const;
    7878
    79     void setSpacing( int td );
     79    void setSpacing( int );
    8080    int spacing() const;
    8181
    82     void setScaleDiv( const QwtScaleDiv &sd );
     82    void setScaleDiv( const QwtScaleDiv & );
    8383    void setTransformation( QwtTransform * );
    8484
     
    120120    virtual void resizeEvent( QResizeEvent * );
    121121
    122     void draw( QPainter *p ) const;
     122    void draw( QPainter * ) const;
    123123
    124124    void scaleChange();
    125     void layoutScale( bool update = true );
     125    void layoutScale( bool update_geometry = true );
    126126
    127127private:
  • trunk/BNC/qwt/qwt_series_data.cpp

    r8127 r9383  
    3434static inline QRectF qwtBoundingRect( const QwtSetSample &sample )
    3535{
     36    if ( sample.set.empty() )
     37        return QRectF( sample.value, 0.0, 0.0, -1.0 );
     38
    3639    double minY = sample.set[0];
    3740    double maxY = sample.set[0];
     
    4144        if ( sample.set[i] < minY )
    4245            minY = sample.set[i];
     46
    4347        if ( sample.set[i] > maxY )
    4448            maxY = sample.set[i];
    4549    }
    4650
    47     double minX = sample.value;
    48     double maxX = sample.value;
    49 
    50     return QRectF( minX, minY, maxX - minX, maxY - minY );
     51    return QRectF( sample.value, minY, 0.0, maxY - minY );
    5152}
    5253
  • trunk/BNC/qwt/qwt_series_data.h

    r8127 r9383  
    2626   to implement an individual data access.
    2727
    28    A subclass of QwtSeriesData<QPointF> must implement: 
    29 
    30    - size()\n 
     28   A subclass of QwtSeriesData<QPointF> must implement:
     29
     30   - size()\n
    3131     Should return number of data points.
    3232
     
    3535     as QPointF object.
    3636
    37    - boundingRect()\n 
     37   - boundingRect()\n
    3838     Should return the bounding rectangle of the data series.
    3939     It is used for autoscaling and might help certain algorithms for displaying
    4040     the data. You can use qwtBoundingRect() for an implementation
    41      but often it is possible to implement a more efficient algorithm 
     41     but often it is possible to implement a more efficient algorithm
    4242     depending on the characteristics of the series.
    4343     The member d_boundingRect is intended for caching the calculated rectangle.
    44    
     44
    4545*/
    4646template <typename T>
     
    5353    //! Destructor
    5454    virtual ~QwtSeriesData();
     55
     56#ifndef QWT_PYTHON_WRAPPER
    5557
    5658    //! \return Number of samples
     
    7880    virtual QRectF boundingRect() const = 0;
    7981
     82#else
     83    // Needed for generating the python bindings, but not for using them !
     84    virtual size_t size() const { return 0; }
     85    virtual T sample( size_t i ) const { return T(); }
     86    virtual QRectF boundingRect() const { return d_boundingRect; }
     87#endif
     88
    8089    /*!
    8190       Set a the "rect of interest"
     
    8695
    8796       The default implementation does nothing.
    88    
     97
    8998       \param rect Rectangle of interest
    9099    */
     
    275284    The following example shows finds a point of curve from an x
    276285    coordinate
    277 
    278   \verbatim
    279 #include <qwt_series_data.h>
    280 #include <qwt_plot_curve.h>
    281 
    282 struct compareX
    283 {
    284     inline bool operator()( const double x, const QPointF &pos ) const
    285     {
    286         return ( x < pos.x() );
    287     }
    288 };
    289 
    290 QLineF curveLineAt( const QwtPlotCurve *curve, double x )
    291 {
    292     int index = qwtUpperSampleIndex<QPointF>(
    293         *curve->data(), x, compareX() );
    294            
    295     if ( index == -1 &&
    296         x == curve->sample( curve->dataSize() - 1 ).x() )
    297     {   
    298         // the last sample is excluded from qwtUpperSampleIndex
    299         index = curve->dataSize() - 1;
    300     }
    301 
    302     QLineF line; // invalid
    303     if ( index > 0 )
    304     {
    305         line.setP1( curve->sample( index - 1 ) );
    306         line.setP2( curve->sample( index ) );
    307     }
    308 
    309     return line;
    310 }
    311 
    312 \endverbatim
    313 
    314 
    315     \param series Series of samples
    316     \param value Value
    317     \param lessThan Compare operation
    318 
    319     \note The samples must be sorted according to the order specified
    320           by the lessThan object
    321 
    322 of the range [begin, end) and returns the position of the one-past-the-last occurrence of value. If no such item is found, returns the position where the item should be inserted.
     286    \code
     287      #include <qwt_series_data.h>
     288      #include <qwt_plot_curve.h>
     289
     290      struct compareX
     291      {
     292          inline bool operator()( const double x, const QPointF &pos ) const
     293          {
     294              return ( x < pos.x() );
     295          }
     296      };
     297
     298      QLineF curveLineAt( const QwtPlotCurve *curve, double x )
     299      {
     300          int index = qwtUpperSampleIndex<QPointF>(
     301              *curve->data(), x, compareX() );
     302
     303          if ( index == -1 &&
     304              x == curve->sample( curve->dataSize() - 1 ).x() )
     305          {
     306              // the last sample is excluded from qwtUpperSampleIndex
     307              index = curve->dataSize() - 1;
     308          }
     309
     310          QLineF line; // invalid
     311          if ( index > 0 )
     312          {
     313              line.setP1( curve->sample( index - 1 ) );
     314              line.setP2( curve->sample( index ) );
     315          }
     316
     317          return line;
     318      }
     319
     320    \endcode
     321  \endpar
     322
     323  \param series Series of samples
     324  \param value Value
     325  \param lessThan Compare operation
     326
     327  \note The samples must be sorted according to the order specified
     328        by the lessThan object
    323329 */
    324330template <typename T, typename LessThan>
    325331inline int qwtUpperSampleIndex( const QwtSeriesData<T> &series,
    326     double value, LessThan lessThan  ) 
     332    double value, LessThan lessThan  )
    327333{
    328334    const int indexMax = series.size() - 1;
  • trunk/BNC/qwt/qwt_series_store.h

    r8127 r9383  
    2828    virtual ~QwtAbstractSeriesStore() {}
    2929
     30#ifndef QWT_PYTHON_WRAPPER
    3031    //! dataChanged() indicates, that the series has been changed.
    3132    virtual void dataChanged() = 0;
     
    4243    //! \return Number of samples
    4344    virtual size_t dataSize() const = 0;
     45#else
     46    // Needed for generating the python bindings, but not for using them !
     47    virtual void dataChanged() {}
     48    virtual void setRectOfInterest( const QRectF & ) {}
     49    virtual QRectF dataRect() const { return  QRectF( 0.0, 0.0, -1.0, -1.0 ); }
     50    virtual size_t dataSize() const { return 0; }
     51#endif
    4452};
    4553
  • trunk/BNC/qwt/qwt_slider.cpp

    r8127 r9383  
    2121#include <qapplication.h>
    2222
    23 static QSize qwtHandleSize( const QSize &size, 
     23static QSize qwtHandleSize( const QSize &size,
    2424    Qt::Orientation orientation, bool hasTrough )
    2525{
     
    4242}
    4343
    44 static QwtScaleDraw::Alignment qwtScaleDrawAlignment( 
     44static QwtScaleDraw::Alignment qwtScaleDrawAlignment(
    4545    Qt::Orientation orientation, QwtSlider::ScalePosition scalePos )
    4646{
     
    108108/*!
    109109  Construct vertical slider in QwtSlider::Trough style
    110   with a scale to the left. 
     110  with a scale to the left.
    111111
    112112  The scale is initialized to [0.0, 100.0] and the value set to 0.0.
     
    131131
    132132  \param parent Parent widget
    133   \param orientation Orientation of the slider. 
     133  \param orientation Orientation of the slider.
    134134*/
    135135QwtSlider::QwtSlider( Qt::Orientation orientation, QWidget *parent ):
     
    158158    d_data->orientation = orientation;
    159159
    160     scaleDraw()->setAlignment( 
     160    scaleDraw()->setAlignment(
    161161        qwtScaleDrawAlignment( orientation, d_data->scalePosition ) );
    162162    scaleDraw()->setLength( 100 );
     
    179179    d_data->orientation = orientation;
    180180
    181     scaleDraw()->setAlignment( 
     181    scaleDraw()->setAlignment(
    182182        qwtScaleDrawAlignment( orientation, d_data->scalePosition ) );
    183183
     
    216216
    217217    d_data->scalePosition = scalePosition;
    218     scaleDraw()->setAlignment( 
     218    scaleDraw()->setAlignment(
    219219        qwtScaleDrawAlignment( d_data->orientation, scalePosition ) );
    220220
     
    223223}
    224224
    225 /*! 
     225/*!
    226226  \return Position of the scale
    227227  \sa setScalePosition()
     
    412412   \param sliderRect Bounding rectangle of the slider
    413413*/
    414 void QwtSlider::drawSlider( 
     414void QwtSlider::drawSlider(
    415415    QPainter *painter, const QRect &sliderRect ) const
    416416{
     
    434434        const int slotMargin = 4;
    435435
    436         QRect slotRect; 
     436        QRect slotRect;
    437437        if ( orientation() == Qt::Horizontal )
    438438        {
     
    470470  \param pos Position of the handle marker in widget coordinates
    471471*/
    472 void QwtSlider::drawHandle( QPainter *painter, 
     472void QwtSlider::drawHandle( QPainter *painter,
    473473    const QRect &handleRect, int pos ) const
    474474{
    475475    const int bw = d_data->borderWidth;
    476476
    477     qDrawShadePanel( painter, 
     477    qDrawShadePanel( painter,
    478478        handleRect, palette(), false, bw,
    479479        &palette().brush( QPalette::Button ) );
     
    497497  \param pos Mouse position
    498498
    499   \retval True, when handleRect() contains pos 
     499  \retval True, when handleRect() contains pos
    500500  \sa scrolledTo()
    501501*/
     
    504504    if ( handleRect().contains( pos ) )
    505505    {
    506         const double v = ( orientation() == Qt::Horizontal ) 
     506        const double v = ( orientation() == Qt::Horizontal )
    507507            ? pos.x() : pos.y();
    508508
     
    525525double QwtSlider::scrolledTo( const QPoint &pos ) const
    526526{
    527     int p = ( orientation() == Qt::Horizontal ) 
     527    int p = ( orientation() == Qt::Horizontal )
    528528        ? pos.x() : pos.y();
    529529
     
    629629
    630630   \param event Mouse event
    631 */ 
     631*/
    632632void QwtSlider::timerEvent( QTimerEvent *event )
    633633{
     
    663663        killTimer( d_data->repeatTimerId );
    664664        d_data->repeatTimerId = startTimer( updateInterval() );
    665        
     665
    666666        d_data->timerTick = true;
    667     }   
     667    }
    668668}
    669669
     
    710710void QwtSlider::changeEvent( QEvent *event )
    711711{
    712     if ( event->type() == QEvent::StyleChange || 
     712    if ( event->type() == QEvent::StyleChange ||
    713713        event->type() == QEvent::FontChange )
    714714    {
     
    740740    /*
    741741       The marker line of the handle needs to be aligned to
    742        the scale. But the marker is in the center 
     742       the scale. But the marker is in the center
    743743       and we need space enough to display the rest of the handle.
    744744
     
    878878    {
    879879        d_data->hasGroove = on;
    880        
     880
    881881        if ( testAttribute( Qt::WA_WState_Polished ) )
    882882            layoutSlider( true );
     
    891891{
    892892    return d_data->hasGroove;
    893 } 
     893}
    894894
    895895/*!
     
    918918        bw = d_data->borderWidth;
    919919
    920     int sliderLength = 0; 
     920    int sliderLength = 0;
    921921    int scaleExtent = 0;
    922922
  • trunk/BNC/qwt/qwt_slider.h

    r8127 r9383  
    8484    QSize handleSize() const;
    8585
    86     void setBorderWidth( int bw );
     86    void setBorderWidth( int );
    8787    int borderWidth() const;
    8888
  • trunk/BNC/qwt/qwt_symbol.cpp

    r8127 r9383  
    3232}
    3333
    34 static QwtGraphic qwtPathGraphic( const QPainterPath &path, 
     34static QwtGraphic qwtPathGraphic( const QPainterPath &path,
    3535    const QPen &pen, const QBrush& brush )
    3636{
     
    4747}
    4848
    49 static inline QRectF qwtScaledBoundingRect( 
     49static inline QRectF qwtScaledBoundingRect(
    5050    const QwtGraphic &graphic, const QSizeF size )
    5151{
     
    5353    if ( scaledSize.isEmpty() )
    5454        scaledSize = graphic.defaultSize();
    55        
     55
    5656    const QSizeF sz = graphic.controlPointRect().size();
    5757
     
    5959    if ( sz.width() > 0.0 )
    6060        sx = scaledSize.width() / sz.width();
    61    
     61
    6262    double sy = 1.0;
    6363    if ( sz.height() > 0.0 )
     
    8484    if ( pm.size() != size )
    8585        pm = pm.scaled( size );
    86    
     86
    8787    QPointF pinPoint( 0.5 * size.width(), 0.5 * size.height() );
    8888    if ( symbol.isPinPointEnabled() )
     
    9595        const QPointF pos = transform.map( points[i] ) - pinPoint;
    9696
    97         QwtPainter::drawPixmap( painter, 
     97        QwtPainter::drawPixmap( painter,
    9898            QRect( pos.toPoint(), pm.size() ), pm );
    9999    }
     
    102102#ifndef QWT_NO_SVG
    103103
    104 static inline void qwtDrawSvgSymbols( QPainter *painter, 
    105     const QPointF *points, int numPoints, 
     104static inline void qwtDrawSvgSymbols( QPainter *painter,
     105    const QPointF *points, int numPoints,
    106106    QSvgRenderer *renderer, const QwtSymbol &symbol )
    107107{
     
    132132        const double y = points[i].y() - dy;
    133133
    134         renderer->render( painter, 
     134        renderer->render( painter,
    135135            QRectF( x, y, sz.width(), sz.height() ) );
    136136    }
     
    139139#endif
    140140
    141 static inline void qwtDrawGraphicSymbols( QPainter *painter, 
     141static inline void qwtDrawGraphicSymbols( QPainter *painter,
    142142    const QPointF *points, int numPoints, const QwtGraphic &graphic,
    143143    const QwtSymbol &symbol )
     
    876876*/
    877877
    878 QwtSymbol::QwtSymbol( const QPainterPath &path, 
     878QwtSymbol::QwtSymbol( const QPainterPath &path,
    879879    const QBrush &brush, const QPen &pen )
    880880{
     
    919919  \brief Set a painter path as symbol
    920920
    921   The symbol is represented by a painter path, where the 
     921  The symbol is represented by a painter path, where the
    922922  origin ( 0, 0 ) of the path coordinate system is mapped to
    923923  the position of the symbol.
     
    927927  the bounding rectangle of the path.
    928928
    929   The following code defines a symbol drawing an arrow:
    930 
    931   \verbatim
    932 #include <qwt_symbol.h>
    933 
    934 QwtSymbol *symbol = new QwtSymbol();
    935 
    936 QPen pen( Qt::black, 2 );
    937 pen.setJoinStyle( Qt::MiterJoin );
    938 
    939 symbol->setPen( pen );
    940 symbol->setBrush( Qt::red );
    941 
    942 QPainterPath path;
    943 path.moveTo( 0, 8 );
    944 path.lineTo( 0, 5 );
    945 path.lineTo( -3, 5 );
    946 path.lineTo( 0, 0 );
    947 path.lineTo( 3, 5 );
    948 path.lineTo( 0, 5 );
    949 
    950 QTransform transform;
    951 transform.rotate( -30.0 );
    952 path = transform.map( path );
    953 
    954 symbol->setPath( path );
    955 symbol->setPinPoint( QPointF( 0.0, 0.0 ) );
    956 
    957 setSize( 10, 14 );
    958 \endverbatim
     929  \par Example
     930    The following code defines a symbol drawing an arrow:
     931
     932    \code
     933      #include <qwt_symbol.h>
     934
     935      QwtSymbol *symbol = new QwtSymbol();
     936
     937      QPen pen( Qt::black, 2 );
     938      pen.setJoinStyle( Qt::MiterJoin );
     939
     940      symbol->setPen( pen );
     941      symbol->setBrush( Qt::red );
     942
     943      QPainterPath path;
     944      path.moveTo( 0, 8 );
     945      path.lineTo( 0, 5 );
     946      path.lineTo( -3, 5 );
     947      path.lineTo( 0, 0 );
     948      path.lineTo( 3, 5 );
     949      path.lineTo( 0, 5 );
     950
     951      QTransform transform;
     952      transform.rotate( -30.0 );
     953      path = transform.map( path );
     954
     955      symbol->setPath( path );
     956      symbol->setPinPoint( QPointF( 0.0, 0.0 ) );
     957
     958      setSize( 10, 14 );
     959    \endcode
     960  \endpar
    959961
    960962  \param path Painter path
     
    12371239  The position of a complex symbol is not always aligned to its center
    12381240  ( f.e an arrow, where the peak points to a position ). The pin point
    1239   defines the position inside of a Pixmap, Graphic, SvgDocument 
     1241  defines the position inside of a Pixmap, Graphic, SvgDocument
    12401242  or PainterPath symbol where the represented point has to
    12411243  be aligned to.
    1242  
     1244
    12431245  \param pos Position
    12441246  \param enable En/Disable the pin point alignment
     
    13411343                    {
    13421344                        if ( !d_data->size.isEmpty() &&
    1343                             d_data->size != d_data->pixmap.pixmap.size() ) 
     1345                            d_data->size != d_data->pixmap.pixmap.size() )
    13441346                        {
    13451347                            useCache = true;
    13461348                        }
    13471349                        break;
    1348                     }                       
     1350                    }
    13491351                    default:
    13501352                        useCache = true;
     
    13581360        const QRect br = boundingRect();
    13591361
    1360         const QRect rect( 0, 0, br.width(), br.height() );
    1361        
    13621362        if ( d_data->cache.pixmap.isNull() )
    13631363        {
     
    14021402
    14031403  \param painter Painter
    1404   \param rect Target rectangle for the symbol 
     1404  \param rect Target rectangle for the symbol
    14051405*/
    14061406void QwtSymbol::drawSymbol( QPainter *painter, const QRectF &rect ) const
     
    14111411    if ( d_data->style == QwtSymbol::Graphic )
    14121412    {
    1413         d_data->graphic.graphic.render( 
     1413        d_data->graphic.graphic.render(
    14141414            painter, rect, Qt::KeepAspectRatio );
    14151415    }
     
    14181418        if ( d_data->path.graphic.isNull() )
    14191419        {
    1420             d_data->path.graphic = qwtPathGraphic( 
     1420            d_data->path.graphic = qwtPathGraphic(
    14211421                d_data->path.path, d_data->pen, d_data->brush );
    14221422        }
    14231423
    1424         d_data->path.graphic.render( 
     1424        d_data->path.graphic.render(
    14251425            painter, rect, Qt::KeepAspectRatio );
    14261426        return;
     
    14451445            }
    14461446
    1447             d_data->svg.renderer->render( 
     1447            d_data->svg.renderer->render(
    14481448                painter, scaledRect );
    14491449        }
     
    14561456        // scale the symbol size to fit into rect.
    14571457
    1458         const double ratio = qMin( rect.width() / br.width(), 
     1458        const double ratio = qMin( rect.width() / br.width(),
    14591459            rect.height() / br.height() );
    14601460
     
    14691469        const QPointF pos;
    14701470        renderSymbols( painter, &pos, 1 );
    1471    
     1471
    14721472        d_data->isPinPointEnabled = isPinPointEnabled;
    14731473
     
    15701570            if ( d_data->path.graphic.isNull() )
    15711571            {
    1572                 d_data->path.graphic = qwtPathGraphic( d_data->path.path, 
     1572                d_data->path.graphic = qwtPathGraphic( d_data->path.path,
    15731573                    d_data->pen, d_data->brush );
    15741574            }
    15751575
    1576             qwtDrawGraphicSymbols( painter, points, numPoints, 
     1576            qwtDrawGraphicSymbols( painter, points, numPoints,
    15771577                d_data->path.graphic, *this );
    15781578            break;
     
    15851585        case QwtSymbol::Graphic:
    15861586        {
    1587             qwtDrawGraphicSymbols( painter, points, numPoints, 
     1587            qwtDrawGraphicSymbols( painter, points, numPoints,
    15881588                d_data->graphic.graphic, *this );
    15891589            break;
     
    15921592        {
    15931593#ifndef QWT_NO_SVG
    1594             qwtDrawSvgSymbols( painter, points, numPoints, 
     1594            qwtDrawSvgSymbols( painter, points, numPoints,
    15951595                d_data->svg.renderer, *this );
    15961596#endif
     
    16541654            }
    16551655
    1656             rect = qwtScaledBoundingRect( 
     1656            rect = qwtScaledBoundingRect(
    16571657                d_data->path.graphic, d_data->size );
    16581658            pinPointTranslation = true;
     
    16661666            else
    16671667                rect.setSize( d_data->size );
    1668            
     1668
    16691669            pinPointTranslation = true;
    16701670
     
    16731673        case QwtSymbol::Graphic:
    16741674        {
    1675             rect = qwtScaledBoundingRect( 
     1675            rect = qwtScaledBoundingRect(
    16761676                d_data->graphic.graphic, d_data->size );
    16771677            pinPointTranslation = true;
  • trunk/BNC/qwt/qwt_symbol.h

    r8127 r9383  
    8686
    8787        /*!
    88           The symbol is represented by a painter path, where the 
     88          The symbol is represented by a painter path, where the
    8989          origin ( 0, 0 ) of the path coordinate system is mapped to
    9090          the position of the symbol.
     
    132132
    133133      F.e. the raster paint engine is a pure software renderer
    134       where in cache mode a draw operation usually ends in 
     134      where in cache mode a draw operation usually ends in
    135135      raster operation with the the backing store, that are usually
    136136      faster, than the algorithms for rendering polygons.
     
    142142      \sa setCachePolicy(), cachePolicy()
    143143
    144       \note The policy has no effect, when the symbol is painted 
     144      \note The policy has no effect, when the symbol is painted
    145145            to a vector graphics format ( PDF, SVG ).
    146146      \warning Since Qt 4.8 raster is the default backend on X11
     
    155155        Cache,
    156156
    157         /*! 
     157        /*!
    158158           Use a cache when one of the following conditions is true:
    159159
    160            - The symbol is rendered with the software 
     160           - The symbol is rendered with the software
    161161             renderer ( QPaintEngine::Raster )
    162162         */
     
    176176    void setSize( const QSize & );
    177177    void setSize( int width, int height = -1 );
    178     const QSize& size() const;
     178    const QSize &size() const;
    179179
    180180    void setPinPoint( const QPointF &pos, bool enable = true );
     
    186186    virtual void setColor( const QColor & );
    187187
    188     void setBrush( const QBrush& b );
    189     const QBrush& brush() const;
     188    void setBrush( const QBrush & );
     189    const QBrush &brush() const;
    190190
    191191    void setPen( const QColor &, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
    192192    void setPen( const QPen & );
    193     const QPen& pen() const;
     193    const QPen &pen() const;
    194194
    195195    void setStyle( Style );
  • trunk/BNC/qwt/qwt_system_clock.cpp

    r8127 r9383  
    3333    delete d_data;
    3434}
    35    
     35
    3636bool QwtSystemClock::isNull() const
    3737{
    3838    return d_data->timer.isValid();
    3939}
    40        
     40
    4141void QwtSystemClock::start()
    4242{
     
    5555    return nsecs / 1e6;
    5656}
    57    
     57
    5858#else // !USE_ELAPSED_TIMER
    5959
     
    357357
    358358/*!
    359   Set the start time to the current time 
     359  Set the start time to the current time
    360360  \return Time, that is elapsed since the previous start time.
    361361*/
  • trunk/BNC/qwt/qwt_system_clock.h

    r8127 r9383  
    2323  Precision and time intervals are multiples of milliseconds (ms).
    2424
     25  ( QwtSystemClock is obsolete since Qt 4.8 as QElapsedTimer offers the same
     26    precision )
     27
    2528  \note The implementation uses high-resolution performance counter on Windows,
    26         mach_absolute_time() on the Mac or POSIX timers on other systems. 
     29        mach_absolute_time() on the Mac or POSIX timers on other systems.
    2730        If none is available it falls back on QTimer.
    2831*/
  • trunk/BNC/qwt/qwt_text.cpp

    r8127 r9383  
    6262QwtTextEngineDict::~QwtTextEngineDict()
    6363{
    64     for ( EngineMap::const_iterator it = d_map.begin();
    65         it != d_map.end(); ++it )
     64    for ( EngineMap::const_iterator it = d_map.constBegin();
     65        it != d_map.constEnd(); ++it )
    6666    {
    6767        const QwtTextEngine *textEngine = engine( it );
     
    108108        return;
    109109
    110     EngineMap::const_iterator it = d_map.find( format );
    111     if ( it != d_map.end() )
    112     {
    113         const QwtTextEngine *e = this->engine( it );
    114         if ( e )
    115             delete e;
    116 
     110    EngineMap::const_iterator it = d_map.constFind( format );
     111    if ( it != d_map.constEnd() )
     112    {
     113        delete this->engine( it );
    117114        d_map.remove( format );
    118115    }
  • trunk/BNC/qwt/qwt_text.h

    r8127 r9383  
    8181          Use a MathML (http://en.wikipedia.org/wiki/MathML) render engine
    8282          to display the text. The Qwt MathML extension offers such an engine
    83           based on the MathML renderer of the Qt solutions package.
     83          based on the MathML renderer of the former Qt solutions package.
    8484          To enable MathML support the following code needs to be added to the
    8585          application:
    86 \verbatim QwtText::setTextEngine(QwtText::MathMLText, new QwtMathMLTextEngine()); \endverbatim
     86
     87          \code
     88            QwtText::setTextEngine( QwtText::MathMLText, new QwtMathMLTextEngine() );
     89          \endcode
    8790         */
    8891        MathMLText,
     
    140143    typedef QFlags<LayoutAttribute> LayoutAttributes;
    141144
    142     QwtText( const QString & = QString::null,
     145    QwtText( const QString & = QString(),
    143146             TextFormat textFormat = AutoText );
    144147    QwtText( const QwtText & );
     
    162165    QFont usedFont( const QFont & ) const;
    163166
    164     void setRenderFlags( int flags );
     167    void setRenderFlags( int );
    165168    int renderFlags() const;
    166169
     
    190193    void draw( QPainter *painter, const QRectF &rect ) const;
    191194
    192     static const QwtTextEngine *textEngine( 
     195    static const QwtTextEngine *textEngine(
    193196        const QString &text, QwtText::TextFormat = AutoText );
    194197
  • trunk/BNC/qwt/qwt_text_engine.cpp

    r8127 r9383  
    8686
    8787        QMap<QString, int>::const_iterator it =
    88             d_ascentCache.find( fontKey );
    89         if ( it == d_ascentCache.end() )
    90         {
    91             int ascent = findAscent( font );
    92             it = d_ascentCache.insert( fontKey, ascent );
    93         }
    94 
    95         return ( *it );
     88            d_ascentCache.constFind( fontKey );
     89
     90        if ( it != d_ascentCache.constEnd() )
     91            return *it;
     92
     93        const int ascent = findAscent( font );
     94        d_ascentCache.insert( fontKey, ascent );
     95
     96        return ascent;
    9697    }
    9798
     
    116117        for ( row = 0; row < img.height(); row++ )
    117118        {
    118             const QRgb *line = reinterpret_cast<const QRgb *>( 
     119            const QRgb *line = reinterpret_cast<const QRgb *>(
    119120                img.scanLine( row ) );
    120121
  • trunk/BNC/qwt/qwt_text_engine.h

    r8127 r9383  
    2626
    2727  QwtPlainTextEngine and QwtRichTextEngine are part of the Qwt library.
    28   The implementation of QwtMathMLTextEngine uses code from the 
     28  The implementation of QwtMathMLTextEngine uses code from the
    2929  Qt solution package. Because of license implications it is built into
    3030  a separate library.
    31  
     31
    3232  \sa QwtText::setTextEngine()
    3333*/
  • trunk/BNC/qwt/qwt_text_label.cpp

    r8127 r9383  
    9090  \sa QwtText
    9191*/
    92 void QwtTextLabel::setText( const QString &text, 
     92void QwtTextLabel::setText( const QString &text,
    9393    QwtText::TextFormat textFormat )
    9494{
  • trunk/BNC/qwt/qwt_text_label.h

    r8127 r9383  
    6464
    6565protected:
    66     virtual void paintEvent( QPaintEvent *e );
     66    virtual void paintEvent( QPaintEvent * );
    6767    virtual void drawContents( QPainter * );
    6868
  • trunk/BNC/qwt/qwt_thermo.cpp

    r8127 r9383  
    2020#include <qmath.h>
    2121
    22 static inline void qwtDrawLine( QPainter *painter, int pos, 
     22static inline void qwtDrawLine( QPainter *painter, int pos,
    2323    const QColor &color, const QRect &pipeRect, const QRect &liquidRect,
    2424    Qt::Orientation orientation )
     
    5959            if ( v > lowerLimit && v < upperLimit )
    6060                values += v;
    61         }       
    62     }   
     61        }
     62    }
    6363
    6464    values += upperLimit;
    65    
     65
    6666    return values;
    6767}
     
    249249
    250250    const QBrush brush = palette().brush( QPalette::Base );
    251     qDrawShadePanel( &painter, 
     251    qDrawShadePanel( &painter,
    252252        tRect.adjusted( -bw, -bw, bw, bw ),
    253         palette(), true, bw, 
     253        palette(), true, bw,
    254254        d_data->autoFillPipe ? &brush : NULL );
    255255
     
    257257}
    258258
    259 /*! 
     259/*!
    260260  Resize event handler
    261261  \param event Resize event
     
    267267}
    268268
    269 /*! 
     269/*!
    270270  Qt change event handler
    271271  \param event Event
     
    411411        if ( d_data->scalePosition == QwtThermo::LeadingScale )
    412412            pipeRect.setLeft( bw );
    413         else 
     413        else
    414414            pipeRect.setLeft( cr.left() + cr.width() - bw - d_data->pipeWidth );
    415415
     
    540540   \param pipeRect Bounding rectangle of the pipe without borders
    541541*/
    542 void QwtThermo::drawLiquid( 
     542void QwtThermo::drawLiquid(
    543543    QPainter *painter, const QRect &pipeRect ) const
    544544{
     
    582582                const double v = scaleMap.invTransform( pos );
    583583
    584                 qwtDrawLine( painter, pos, 
     584                qwtDrawLine( painter, pos,
    585585                    d_data->colorMap->color( interval, v ),
    586586                    pipeRect, liquidRect, d_data->orientation );
     
    708708/*!
    709709  \brief Change the brush of the liquid.
    710  
     710
    711711  Changes the QPalette::ButtonText brush of the palette.
    712712
    713   \param brush New brush. 
     713  \param brush New brush.
    714714  \sa fillBrush(), QWidget::setPalette()
    715715*/
     
    722722
    723723/*!
    724   \return Liquid ( QPalette::ButtonText ) brush. 
     724  \return Liquid ( QPalette::ButtonText ) brush.
    725725  \sa setFillBrush(), QWidget::palette()
    726726*/
     
    735735  Changes the QPalette::Highlight brush of the palette.
    736736
    737   \param brush New brush. 
     737  \param brush New brush.
    738738  \sa alarmBrush(), QWidget::setPalette()
    739739
     
    825825}
    826826
    827 /*! 
     827/*!
    828828  \return True, when the alarm threshold is enabled.
    829829
     
    894894QRect QwtThermo::fillRect( const QRect &pipeRect ) const
    895895{
    896     double origin;       
     896    double origin;
    897897    if ( d_data->originMode == OriginMinimum )
    898898    {
     
    915915    if ( to < from )
    916916        qSwap( from, to );
    917    
     917
    918918    QRect fillRect = pipeRect;
    919919    if ( d_data->orientation == Qt::Horizontal )
     
    947947
    948948    const bool inverted = ( upperBound() < lowerBound() );
    949    
     949
    950950    bool increasing;
    951951    if ( d_data->originMode == OriginCustom )
     
    961961    const int alarmPos = qRound( map.transform( d_data->alarmLevel ) );
    962962    const int valuePos = qRound( map.transform( d_data->value ) );
    963    
     963
    964964    if ( d_data->orientation == Qt::Horizontal )
    965965    {
     
    10031003
    10041004    return alarmRect;
    1005 } 
     1005}
  • trunk/BNC/qwt/qwt_thermo.h

    r8127 r9383  
    3030
    3131  The fill colors might be calculated from an optional color map
    32   If no color map has been assigned QwtThermo uses the 
     32  If no color map has been assigned QwtThermo uses the
    3333  following colors/brushes from the widget palette:
    3434
     
    5353    Q_PROPERTY( Qt::Orientation orientation
    5454        READ orientation WRITE setOrientation )
    55     Q_PROPERTY( ScalePosition scalePosition 
     55    Q_PROPERTY( ScalePosition scalePosition
    5656        READ scalePosition WRITE setScalePosition )
    5757    Q_PROPERTY( OriginMode originMode READ originMode WRITE setOriginMode )
     
    113113    int spacing() const;
    114114
    115     void setBorderWidth( int w );
     115    void setBorderWidth( int );
    116116    int borderWidth() const;
    117117
     
    122122    double origin() const;
    123123
    124     void setFillBrush( const QBrush &b );
     124    void setFillBrush( const QBrush & );
    125125    QBrush fillBrush() const;
    126126
    127     void setAlarmBrush( const QBrush &b );
     127    void setAlarmBrush( const QBrush & );
    128128    QBrush alarmBrush() const;
    129129
    130     void setAlarmLevel( double v );
     130    void setAlarmLevel( double );
    131131    double alarmLevel() const;
    132132
    133     void setAlarmEnabled( bool tf );
     133    void setAlarmEnabled( bool );
    134134    bool alarmEnabled() const;
    135135
     
    138138    const QwtColorMap *colorMap() const;
    139139
    140     void setPipeWidth( int w );
     140    void setPipeWidth( int );
    141141    int pipeWidth() const;
    142142
     
    153153
    154154public Q_SLOTS:
    155     virtual void setValue( double val );
     155    virtual void setValue( double );
    156156
    157157protected:
  • trunk/BNC/qwt/qwt_transform.cpp

    r8127 r9383  
    1919//! Smallest allowed value for logarithmic scales: 1.0e-150
    2020const double QwtLogTransform::LogMin = 1.0e-150;
    21    
     21
    2222//! Largest allowed value for logarithmic scales: 1.0e150
    2323const double QwtLogTransform::LogMax = 1.0e150;
     
    4343}
    4444
    45 /*! 
     45/*!
    4646  \param value Value to be bounded
    4747  \return value unmodified
     
    6363}
    6464
    65 /*! 
     65/*!
    6666  \param value Value to be transformed
    6767  \return value unmodified
     
    7272}
    7373
    74 /*! 
     74/*!
    7575  \param value Value to be transformed
    7676  \return value unmodified
     
    9898}
    9999
    100 /*! 
     100/*!
    101101  \param value Value to be transformed
    102102  \return log( value )
     
    107107}
    108108
    109 /*! 
     109/*!
    110110  \param value Value to be transformed
    111111  \return exp( value )
     
    116116}
    117117
    118 /*! 
     118/*!
    119119  \param value Value to be bounded
    120120  \return qBound( LogMin, value, LogMax )
     
    146146}
    147147
    148 /*! 
     148/*!
    149149  \param value Value to be transformed
    150150  \return Exponentiation preserving the sign
     
    156156    else
    157157        return qPow( value, 1.0 / d_exponent );
    158    
     158
    159159}
    160160
    161 /*! 
     161/*!
    162162  \param value Value to be transformed
    163163  \return Inverse exponentiation preserving the sign
  • trunk/BNC/qwt/qwt_transform.h

    r8127 r9383  
    7373
    7474   QwtNullTransform returns the values unmodified.
    75    
     75
    7676 */
    7777class QWT_EXPORT QwtNullTransform: public QwtTransform
     
    9292
    9393   \note In the calculations of QwtScaleMap the base of the log function
    94          has no effect on the mapping. So QwtLogTransform can be used 
     94         has no effect on the mapping. So QwtLogTransform can be used
    9595         for log2(), log10() or any other logarithmic scale.
    9696 */
    9797class QWT_EXPORT QwtLogTransform: public QwtTransform
    98 {   
     98{
    9999public:
    100100    QwtLogTransform();
    101101    virtual ~QwtLogTransform();
    102    
     102
    103103    virtual double transform( double value ) const;
    104104    virtual double invTransform( double value ) const;
     
    120120   \brief A transformation using pow()
    121121
    122    QwtPowerTransform preserves the sign of a value. 
     122   QwtPowerTransform preserves the sign of a value.
    123123   F.e. a transformation with a factor of 2
    124124   transforms a value of -3 to -9 and v.v. Thus QwtPowerTransform
  • trunk/BNC/qwt/qwt_wheel.cpp

    r8127 r9383  
    5555        wrapping( false )
    5656    {
    57     };
     57    }
    5858
    5959    Qt::Orientation orientation;
     
    114114  \brief En/Disable tracking
    115115
    116   If tracking is enabled (the default), the wheel emits the valueChanged() 
    117   signal while the wheel is moving. If tracking is disabled, the wheel 
     116  If tracking is enabled (the default), the wheel emits the valueChanged()
     117  signal while the wheel is moving. If tracking is disabled, the wheel
    118118  emits the valueChanged() signal only when the wheel movement is terminated.
    119119
     
    162162   \brief Mouse press event handler
    163163
    164    Start movement of the wheel. 
     164   Start movement of the wheel.
    165165
    166166   \param event Mouse event
     
    209209        d_data->speed = ( mouseValue - d_data->mouseValue ) / ms;
    210210    }
    211    
    212     d_data->mouseValue = mouseValue; 
     211
     212    d_data->mouseValue = mouseValue;
    213213
    214214    double value = boundedValue( mouseValue - d_data->mouseOffset );
    215215    if ( d_data->stepAlignment )
    216216        value = alignedValue( value );
    217        
     217
    218218    if ( value != d_data->value )
    219219    {
     
    238238
    239239   \param event Mouse event
    240 */ 
     240*/
    241241
    242242void QwtWheel::mouseReleaseEvent( QMouseEvent *event )
     
    260260    if ( startFlying )
    261261    {
    262         d_data->flyingValue = 
     262        d_data->flyingValue =
    263263            boundedValue( d_data->mouseValue - d_data->mouseOffset );
    264264
     
    281281
    282282  The flying wheel effect is implemented using a timer
    283    
     283
    284284  \param event Timer event
    285285
     
    323323  \brief Handle wheel events
    324324
    325   In/Decrement the value 
     325  In/Decrement the value
    326326
    327327  \param event Wheel event
     
    342342    double increment = 0.0;
    343343
    344     if ( ( event->modifiers() & Qt::ControlModifier) || 
     344    if ( ( event->modifiers() & Qt::ControlModifier) ||
    345345        ( event->modifiers() & Qt::ShiftModifier ) )
    346346    {
     
    384384
    385385  - Qt::Key_Up\n
    386     In case of a horizontal or not inverted vertical wheel the value 
     386    In case of a horizontal or not inverted vertical wheel the value
    387387    will be incremented by the step size. For an inverted vertical wheel
    388388    the value will be decremented by the step size.
    389389
    390390  - Qt::Key_Down\n
    391     In case of a horizontal or not inverted vertical wheel the value 
     391    In case of a horizontal or not inverted vertical wheel the value
    392392    will be decremented by the step size. For an inverted vertical wheel
    393393    the value will be incremented by the step size.
     
    482482    if ( event->isAccepted() )
    483483        stopFlying();
    484    
     484
    485485    if ( increment != 0.0 )
    486486    {
     
    552552
    553553/*!
    554    \return Wheel border width 
     554   \return Wheel border width
    555555   \sa setWheelBorderWidth()
    556556*/
     
    561561
    562562/*!
    563   \brief Set the border width 
     563  \brief Set the border width
    564564
    565565  The border defaults to 2.
     
    575575
    576576/*!
    577    \return Border width 
     577   \return Border width
    578578   \sa setBorderWidth()
    579579*/
     
    683683}
    684684
    685 /*! 
     685/*!
    686686  Determine the value corresponding to a specified point
    687687
     
    724724}
    725725
    726 /*! 
     726/*!
    727727   \brief Qt Paint Event
    728728   \param event Paint event
     
    737737    style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
    738738
    739     qDrawShadePanel( &painter, 
     739    qDrawShadePanel( &painter,
    740740        contentsRect(), palette(), true, d_data->borderWidth );
    741741
     
    753753   \param rect Geometry for the wheel
    754754*/
    755 void QwtWheel::drawWheelBackground( 
     755void QwtWheel::drawWheelBackground(
    756756    QPainter *painter, const QRectF &rect )
    757757{
     
    761761
    762762    //  draw shaded background
    763     QLinearGradient gradient( rect.topLeft(), 
     763    QLinearGradient gradient( rect.topLeft(),
    764764        ( d_data->orientation == Qt::Horizontal ) ? rect.topRight() : rect.bottomLeft() );
    765765    gradient.setColorAt( 0.0, pal.color( QPalette::Button ) );
     
    772772    // draw internal border
    773773
    774     const QPen lightPen( palette().color( QPalette::Light ), 
     774    const QPen lightPen( palette().color( QPalette::Light ),
    775775        d_data->wheelBorderWidth, Qt::SolidLine, Qt::FlatCap );
    776     const QPen darkPen( pal.color( QPalette::Dark ), 
     776    const QPen darkPen( pal.color( QPalette::Dark ),
    777777        d_data->wheelBorderWidth, Qt::SolidLine, Qt::FlatCap );
    778778
     
    782782    {
    783783        painter->setPen( lightPen );
    784         painter->drawLine( QPointF( rect.left(), rect.top() + bw2 ), 
     784        painter->drawLine( QPointF( rect.left(), rect.top() + bw2 ),
    785785            QPointF( rect.right(), rect.top() + bw2 ) );
    786786
    787787        painter->setPen( darkPen );
    788         painter->drawLine( QPointF( rect.left(), rect.bottom() - bw2 ), 
     788        painter->drawLine( QPointF( rect.left(), rect.bottom() - bw2 ),
    789789            QPointF( rect.right(), rect.bottom() - bw2 ) );
    790790    }
     
    792792    {
    793793        painter->setPen( lightPen );
    794         painter->drawLine( QPointF( rect.left() + bw2, rect.top() ), 
     794        painter->drawLine( QPointF( rect.left() + bw2, rect.top() ),
    795795            QPointF( rect.left() + bw2, rect.bottom() ) );
    796796
    797797        painter->setPen( darkPen );
    798         painter->drawLine( QPointF( rect.right() - bw2, rect.top() ), 
     798        painter->drawLine( QPointF( rect.right() - bw2, rect.top() ),
    799799            QPointF( rect.right() - bw2, rect.bottom() ) );
    800800    }
     
    818818    }
    819819
    820     const QPen lightPen( palette().color( QPalette::Light ), 
     820    const QPen lightPen( palette().color( QPalette::Light ),
    821821        0, Qt::SolidLine, Qt::FlatCap );
    822     const QPen darkPen( palette().color( QPalette::Dark ), 
     822    const QPen darkPen( palette().color( QPalette::Dark ),
    823823        0, Qt::SolidLine, Qt::FlatCap );
    824824
     
    857857
    858858            double tickPos;
    859             if ( d_data->inverted ) 
     859            if ( d_data->inverted )
    860860                tickPos = rect.left() + off;
    861861            else
     
    865865            {
    866866                painter->setPen( darkPen );
    867                 painter->drawLine( QPointF( tickPos - 1 , l1 ), 
     867                painter->drawLine( QPointF( tickPos - 1 , l1 ),
    868868                    QPointF( tickPos - 1,  l2 ) );
    869869                painter->setPen( lightPen );
    870                 painter->drawLine( QPointF( tickPos, l1 ), 
     870                painter->drawLine( QPointF( tickPos, l1 ),
    871871                    QPointF( tickPos, l2 ) );
    872872            }
     
    907907            {
    908908                painter->setPen( darkPen );
    909                 painter->drawLine( QPointF( l1, tickPos - 1 ), 
     909                painter->drawLine( QPointF( l1, tickPos - 1 ),
    910910                    QPointF( l2, tickPos - 1 ) );
    911911                painter->setPen( lightPen );
    912                 painter->drawLine( QPointF( l1, tickPos ), 
     912                painter->drawLine( QPointF( l1, tickPos ),
    913913                    QPointF( l2, tickPos ) );
    914914            }
     
    10141014
    10151015/*!
    1016   \brief Set the page step count 
    1017    
     1016  \brief Set the page step count
     1017
    10181018  pageStepCount is a multiplicator for the single step size
    10191019  that typically corresponds to the user pressing PageUp or PageDown.
    1020    
    1021   A value of 0 disables page stepping. 
     1020
     1021  A value of 0 disables page stepping.
    10221022
    10231023  The default value is 1.
     
    10311031}
    10321032
    1033 /*! 
     1033/*!
    10341034  \return Page step count
    10351035  \sa setPageStepCount(), singleStep()
     
    11501150  The direction of an inverted horizontal wheel will be from right to left
    11511151  an inverted vertical wheel will increase from bottom to top.
    1152  
     1152
    11531153  \param on En/Disable inverted appearance
    11541154  \sa isInverted()
    1155  
     1155
    11561156 */
    11571157void QwtWheel::setInverted( bool on )
     
    11761176  \brief En/Disable wrapping
    11771177
    1178   If wrapping is true stepping up from maximum() value will take 
    1179   you to the minimum() value and vice versa. 
     1178  If wrapping is true stepping up from maximum() value will take
     1179  you to the minimum() value and vice versa.
    11801180
    11811181  \param on En/Disable wrapping
     
    12511251{
    12521252    const double range = d_data->maximum - d_data->minimum;
    1253    
     1253
    12541254    if ( d_data->wrapping && range >= 0.0 )
    12551255    {
     
    12571257        {
    12581258            value += ::ceil( ( d_data->minimum - value ) / range ) * range;
    1259         }       
     1259        }
    12601260        else if ( value > d_data->maximum )
    12611261        {
     
    12931293            }
    12941294        }
    1295     }       
     1295    }
    12961296
    12971297    return value;
  • trunk/BNC/qwt/qwt_wheel.h

    r8127 r9383  
    7878    int borderWidth() const;
    7979
    80     void setInverted( bool tf );
     80    void setInverted( bool );
    8181    bool isInverted() const;
    8282
    83     void setWrapping( bool tf );
     83    void setWrapping( bool );
    8484    bool wrapping() const;
    8585
     
    9393    bool stepAlignment() const;
    9494
    95     void setRange( double vmin, double vmax );
     95    void setRange( double min, double max );
    9696
    97     void setMinimum( double min );
     97    void setMinimum( double );
    9898    double minimum() const;
    9999
    100     void setMaximum( double max );
     100    void setMaximum( double );
    101101    double maximum() const;
    102102
     
    104104    int updateInterval() const;
    105105
    106     void setTracking( bool enable );
     106    void setTracking( bool );
    107107    bool isTracking() const;
    108108
     
    121121
    122122      When tracking is enabled this signal will be emitted every
    123       time the value changes. 
     123      time the value changes.
    124124
    125125      \param value new value
  • trunk/BNC/qwt/qwt_widget_overlay.cpp

    r8127 r9383  
    1212#include <qpainter.h>
    1313#include <qpaintengine.h>
     14#include <qpainterpath.h>
    1415#include <qimage.h>
    1516#include <qevent.h>
     
    2324}
    2425
    25 static QRegion qwtAlphaMask( 
    26     const QImage& image, const QVector<QRect> rects )
     26static QRegion qwtAlphaMask(
     27    const QImage& image, const QVector<QRect> &rects )
    2728{
    2829    const int w = image.width();
     
    4243        y2 = qMin( y2, h - 1 );
    4344
    44         for ( int y = y1; y <= y2; ++y ) 
     45        for ( int y = y1; y <= y2; ++y )
    4546        {
    4647            bool inRect = false;
    4748            int rx0 = -1;
    4849
    49             const uint *line = 
     50            const uint *line =
    5051                reinterpret_cast<const uint *> ( image.scanLine( y ) ) + x1;
    51             for ( int x = x1; x <= x2; x++ ) 
     52            for ( int x = x1; x <= x2; x++ )
    5253            {
    5354                const bool on = ( ( *line++ >> 24 ) != 0 );
    54                 if ( on != inRect ) 
     55                if ( on != inRect )
    5556                {
    56                     if ( inRect  ) 
     57                    if ( inRect  )
    5758                    {
    5859                        rect.setCoords( rx0, y, x - 1, y );
    5960                        region += rect;
    60                     } 
    61                     else 
     61                    }
     62                    else
    6263                    {
    6364                        rx0 = x;
     
    6566
    6667                    inRect = on;
    67                 } 
     68                }
    6869            }
    6970
    70             if ( inRect ) 
     71            if ( inRect )
    7172            {
    7273                rect.setCoords( rx0, y, x2, y );
     
    212213        d_data->rgbaBuffer = ( uchar* )::calloc( width() * height(), 4 );
    213214
    214         QImage image( d_data->rgbaBuffer, 
     215        QImage image( d_data->rgbaBuffer,
    215216            width(), height(), qwtMaskImageFormat() );
    216217
     
    249250void QwtWidgetOverlay::paintEvent( QPaintEvent* event )
    250251{
    251     const QRegion clipRegion = event->region();
     252    const QRegion &clipRegion = event->region();
    252253
    253254    QPainter painter( this );
     
    266267    if ( d_data->rgbaBuffer && useRgbaBuffer )
    267268    {
    268         const QImage image( d_data->rgbaBuffer, 
     269        const QImage image( d_data->rgbaBuffer,
    269270            width(), height(), qwtMaskImageFormat() );
    270271
  • trunk/BNC/qwt/qwt_widget_overlay.h

    r8127 r9383  
    2323   heavy repaint operation of the widget below.
    2424
    25    F.e. in combination with the plot canvas an overlay 
    26    avoid replots as the content of the canvas can be restored from 
     25   F.e. in combination with the plot canvas an overlay
     26   avoid replots as the content of the canvas can be restored from
    2727   its backing store.
    2828
     
    3333   - maskHint()
    3434
    35    Internally QwtPlotPicker uses overlays for displaying 
     35   Internally QwtPlotPicker uses overlays for displaying
    3636   the rubber band and the tracker text.
    3737
     
    4747       the masked regions of the overlay only. Otherwise
    4848       Qt triggers full repaints. On less powerful hardware
    49        ( f.e embedded systems ) - or when using the raster paint 
     49       ( f.e embedded systems ) - or when using the raster paint
    5050       engine on a remote desktop - bit blitting is a noticeable
    5151       operation, that needs to be avoided.
    52        
    53        If and how to mask depends on how expensive the calculation 
     52
     53       If and how to mask depends on how expensive the calculation
    5454       of the mask is and how many pixels can be excluded by the mask.
    5555
     
    6666           \brief Use maskHint() as mask
    6767
    68            For many situations a fast approximation is good enough 
     68           For many situations a fast approximation is good enough
    6969           and it is not necessary to build a more detailed mask
    7070           ( f.e the bounding rectangle of a text ).
     
    7878           and the mask needs to be calculated by drawing the overlay
    7979           and testing the result.
    80          
     80
    8181           When a valid maskHint() is available
    8282           only pixels inside this approximation are checked.
  • trunk/BNC/qwt/src.pri

    r8127 r9383  
    181181        qwt_series_data.cpp \
    182182        qwt_point_data.cpp \
    183         qwt_scale_widget.cpp
     183        qwt_scale_widget.cpp
     184
     185    contains(QWT_CONFIG, QwtOpenGL) {
     186
     187        HEADERS += \
     188            qwt_plot_glcanvas.h
     189
     190        SOURCES += \
     191            qwt_plot_glcanvas.cpp
     192    }
     193
     194    contains(QWT_CONFIG, QwtSvg) {
     195
     196        HEADERS += \
     197            qwt_plot_svgitem.h
     198
     199        SOURCES += \
     200            qwt_plot_svgitem.cpp
     201    }
    184202}
    185203
     
    192210contains(QWT_CONFIG, QwtSvg) {
    193211
    194     QT += svg
    195 
    196     HEADERS += qwt_plot_svgitem.h
    197     SOURCES += qwt_plot_svgitem.cpp
     212    greaterThan(QT_MAJOR_VERSION, 4) {
     213
     214        qtHaveModule(svg) {
     215            QT += svg
     216        }
     217        else {
     218            warning("QwtSvg is enabled in qwtconfig.pri, but Qt has not been built with svg support")
     219        }
     220    }
     221    else {
     222        QT += svg
     223    }
    198224}
    199225else {
     
    205231
    206232    QT += opengl
    207 
    208     HEADERS += qwt_plot_glcanvas.h
    209     SOURCES += qwt_plot_glcanvas.cpp
    210233}
    211234else {
  • trunk/BNC/qwtpolar/qwt_polar_canvas.cpp

    r8127 r9383  
    215215                    QWidget *bgWidget = qwtBackgroundWidget( plot() );
    216216
    217                                         QwtPainter::fillPixmap( bgWidget, bs,
    218                                                 mapTo( bgWidget, rect().topLeft() ) );
     217                    QwtPainter::fillPixmap( bgWidget, bs,
     218                        mapTo( bgWidget, rect().topLeft() ) );
    219219
    220220                    p.begin( &bs );
Note: See TracChangeset for help on using the changeset viewer.