Ignore:
Timestamp:
May 10, 2017, 3:20:54 PM (7 years ago)
Author:
stoecker
Message:

update qwt and qwtpolar, many QT5 fixes (unfinished)

File:
1 edited

Legend:

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

    r4271 r8127  
    3838
    3939    QwtScaleMap map;
    40     QwtScaleDiv scldiv;
     40    QwtScaleDiv scaleDiv;
    4141
    4242    double spacing;
     
    8686/*!
    8787  Check if a component is enabled
     88
     89  \param component Component type
     90  \return true, when component is enabled
    8891  \sa enableComponent()
    8992*/
     
    9598/*!
    9699  Change the scale division
    97   \param sd New scale division
    98 */
    99 void QwtAbstractScaleDraw::setScaleDiv( const QwtScaleDiv &sd )
    100 {
    101     d_data->scldiv = sd;
    102     d_data->map.setScaleInterval( sd.lowerBound(), sd.upperBound() );
     100  \param scaleDiv New scale division
     101*/
     102void QwtAbstractScaleDraw::setScaleDiv( const QwtScaleDiv &scaleDiv )
     103{
     104    d_data->scaleDiv = scaleDiv;
     105    d_data->map.setScaleInterval( scaleDiv.lowerBound(), scaleDiv.upperBound() );
    103106    d_data->labelCache.clear();
    104107}
     
    109112*/
    110113void QwtAbstractScaleDraw::setTransformation(
    111     QwtScaleTransformation *transformation )
     114    QwtTransform *transformation )
    112115{
    113116    d_data->map.setTransformation( transformation );
     
    129132const QwtScaleDiv& QwtAbstractScaleDraw::scaleDiv() const
    130133{
    131     return d_data->scldiv;
     134    return d_data->scaleDiv;
    132135}
    133136
     
    179182
    180183        const QList<double> &majorTicks =
    181             d_data->scldiv.ticks( QwtScaleDiv::MajorTick );
     184            d_data->scaleDiv.ticks( QwtScaleDiv::MajorTick );
    182185
    183186        for ( int i = 0; i < majorTicks.count(); i++ )
    184187        {
    185188            const double v = majorTicks[i];
    186             if ( d_data->scldiv.contains( v ) )
    187                 drawLabel( painter, majorTicks[i] );
     189            if ( d_data->scaleDiv.contains( v ) )
     190                drawLabel( painter, v );
    188191        }
    189192
     
    204207            tickType < QwtScaleDiv::NTickTypes; tickType++ )
    205208        {
    206             const QList<double> &ticks = d_data->scldiv.ticks( tickType );
     209            const double tickLen = d_data->tickLength[tickType];
     210            if ( tickLen <= 0.0 )
     211                continue;
     212
     213            const QList<double> &ticks = d_data->scaleDiv.ticks( tickType );
    207214            for ( int i = 0; i < ticks.count(); i++ )
    208215            {
    209216                const double v = ticks[i];
    210                 if ( d_data->scldiv.contains( v ) )
    211                     drawTick( painter, v, d_data->tickLength[tickType] );
     217                if ( d_data->scaleDiv.contains( v ) )
     218                    drawTick( painter, v, tickLen );
    212219            }
    213220        }
     
    258265  The default spacing is 4 pixels.
    259266
     267  \return Spacing
    260268  \sa setSpacing()
    261269*/
     
    268276  \brief Set a minimum for the extent
    269277
    270   The extent is calculated from the coomponents of the
     278  The extent is calculated from the components of the
    271279  scale draw. In situations, where the labels are
    272280  changing and the layout depends on the extent (f.e scrolling
     
    288296/*!
    289297  Get the minimum extent
     298  \return Minimum extent
    290299  \sa extent(), setMinimumExtent()
    291300*/
     
    323332
    324333/*!
    325     Return the length of the ticks
    326 
     334    \return Length of the ticks
    327335    \sa setTickLength(), maxTickLength()
    328336*/
     
    357365
    358366  The value is converted to a plain text using
    359   QLocale::system().toString(value).
     367  QLocale().toString(value).
    360368  This method is often overloaded by applications to have individual
    361369  labels.
     
    401409
    402410/*!
    403    Invalidate the cache used by QwtAbstractScaleDraw::tickLabel
     411   Invalidate the cache used by tickLabel()
    404412
    405413   The cache is invalidated, when a new QwtScaleDiv is set. If
Note: See TracChangeset for help on using the changeset viewer.