Changeset 8127 in ntrip for trunk/BNC/qwt/qwt_scale_div.h


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_scale_div.h

    r4271 r8127  
    1515#include <qlist.h>
    1616
    17 class QwtInterval;
     17#ifndef QT_NO_DEBUG_STREAM
     18#include <qdebug.h>
     19#endif
    1820
    1921/*!
    2022  \brief A class representing a scale division
    2123
    22   A scale division consists of its limits and 3 list
    23   of tick values qualified as major, medium and minor ticks.
     24  A Qwt scale is defined by its boundaries and 3 list
     25  for the positions of the major, medium and minor ticks.
    2426
    25   In most cases scale divisions are calculated by a QwtScaleEngine.
     27  The upperBound() might be smaller than the lowerBound()
     28  to indicate inverted scales.
    2629
    27   \sa subDivideInto(), subDivide()
     30  Scale divisions can be calculated from a QwtScaleEngine.
     31
     32  \sa QwtScaleEngine::divideScale(), QwtPlot::setAxisScaleDiv(),
     33      QwtAbstractSlider::setScaleDiv()
    2834*/
    2935
     
    5056    };
    5157
    52     explicit QwtScaleDiv();
     58    explicit QwtScaleDiv( double lowerBound = 0.0,
     59        double upperBound = 0.0 );
     60
    5361    explicit QwtScaleDiv( const QwtInterval &, QList<double>[NTickTypes] );
    54     explicit QwtScaleDiv(
    55         double lowerBound, double upperBound, QList<double>[NTickTypes] );
    5662
    57     bool operator==( const QwtScaleDiv &s ) const;
    58     bool operator!=( const QwtScaleDiv &s ) const;
     63    explicit QwtScaleDiv( double lowerBound, double upperBound,
     64        QList<double>[NTickTypes] );
     65
     66    explicit QwtScaleDiv( double lowerBound, double upperBound,
     67        const QList<double> &minorTicks, const QList<double> &mediumTicks,
     68        const QList<double> &majorTicks );
     69
     70    bool operator==( const QwtScaleDiv & ) const;
     71    bool operator!=( const QwtScaleDiv & ) const;
    5972
    6073    void setInterval( double lowerBound, double upperBound );
     
    6275    QwtInterval interval() const;
    6376
     77    void setLowerBound( double );
    6478    double lowerBound() const;
     79
     80    void setUpperBound( double );
    6581    double upperBound() const;
     82
    6683    double range() const;
    6784
    68     bool contains( double v ) const;
     85    bool contains( double value ) const;
    6986
    70     void setTicks( int type, const QList<double> & );
    71     const QList<double> &ticks( int type ) const;
     87    void setTicks( int tickType, const QList<double> & );
     88    QList<double> ticks( int tickType ) const;
    7289
    73     void invalidate();
    74     bool isValid() const;
     90    bool isEmpty() const;
     91    bool isIncreasing() const;
    7592
    7693    void invert();
     94    QwtScaleDiv inverted() const;
     95
     96    QwtScaleDiv bounded( double lowerBound, double upperBound ) const;
    7797
    7898private:
     
    80100    double d_upperBound;
    81101    QList<double> d_ticks[NTickTypes];
    82 
    83     bool d_isValid;
    84102};
    85103
    86 Q_DECLARE_TYPEINFO(QwtScaleDiv, Q_MOVABLE_TYPE);
     104Q_DECLARE_TYPEINFO( QwtScaleDiv, Q_MOVABLE_TYPE );
    87105
    88 /*!
    89    Change the interval
    90    \param lowerBound lower bound
    91    \param upperBound upper bound
    92 */
    93 inline void QwtScaleDiv::setInterval( double lowerBound, double upperBound )
    94 {
    95     d_lowerBound = lowerBound;
    96     d_upperBound = upperBound;
    97 }
     106#ifndef QT_NO_DEBUG_STREAM
     107QWT_EXPORT QDebug operator<<( QDebug, const QwtScaleDiv & );
     108#endif
    98109
    99 /*!
    100   \return lowerBound -> upperBound
    101 */
    102 inline QwtInterval QwtScaleDiv::interval() const
    103 {
    104     return QwtInterval( d_lowerBound, d_upperBound );
    105 }
    106 
    107 /*!
    108   \return lower bound
    109   \sa upperBound()
    110 */
    111 inline double QwtScaleDiv::lowerBound() const
    112 {
    113     return d_lowerBound;
    114 }
    115 
    116 /*!
    117   \return upper bound
    118   \sa lowerBound()
    119 */
    120 inline double QwtScaleDiv::upperBound() const
    121 {
    122     return d_upperBound;
    123 }
    124 
    125 /*!
    126   \return upperBound() - lowerBound()
    127 */
    128 inline double QwtScaleDiv::range() const
    129 {
    130     return d_upperBound - d_lowerBound;
    131 }
    132110#endif
Note: See TracChangeset for help on using the changeset viewer.