Qwt User's Guide 6.1.4

qwt_abstract_scale.h
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
10 #ifndef QWT_ABSTRACT_SCALE_H
11 #define QWT_ABSTRACT_SCALE_H
12
13 #include "qwt_global.h"
14 #include <qwidget.h>
15
16 class QwtScaleEngine;
17 class QwtAbstractScaleDraw;
18 class QwtScaleDiv;
19 class QwtScaleMap;
20 class QwtInterval;
21
36 class QWT_EXPORT QwtAbstractScale: public QWidget
37 {
38 Q_OBJECT
39
40 Q_PROPERTY( double lowerBound READ lowerBound WRITE setLowerBound )
41 Q_PROPERTY( double upperBound READ upperBound WRITE setUpperBound )
42
43 Q_PROPERTY( int scaleMaxMajor READ scaleMaxMajor WRITE setScaleMaxMajor )
44 Q_PROPERTY( int scaleMaxMinor READ scaleMaxMinor WRITE setScaleMaxMinor )
45
46 Q_PROPERTY( double scaleStepSize READ scaleStepSize WRITE setScaleStepSize )
47
48 public:
49 QwtAbstractScale( QWidget *parent = NULL );
50 virtual ~QwtAbstractScale();
51
52 void setScale( double lowerBound, double upperBound );
53 void setScale( const QwtInterval & );
54 void setScale( const QwtScaleDiv & );
55
56 const QwtScaleDiv& scaleDiv() const;
57
58 void setLowerBound( double value );
59 double lowerBound() const;
60
61 void setUpperBound( double value );
62 double upperBound() const;
63
64 void setScaleStepSize( double stepSize );
65 double scaleStepSize() const;
66
67 void setScaleMaxMajor( int ticks );
68 int scaleMaxMinor() const;
69
70 void setScaleMaxMinor( int ticks );
71 int scaleMaxMajor() const;
72
73 void setScaleEngine( QwtScaleEngine * );
74 const QwtScaleEngine *scaleEngine() const;
75 QwtScaleEngine *scaleEngine();
76
77 int transform( double ) const;
78 double invTransform( int ) const;
79
80 bool isInverted() const;
81
82 double minimum() const;
83 double maximum() const;
84
85 const QwtScaleMap &scaleMap() const;
86
87 protected:
88 void rescale( double lowerBound,
89 double upperBound, double stepSize );
90
91 void setAbstractScaleDraw( QwtAbstractScaleDraw * );
92
93 const QwtAbstractScaleDraw *abstractScaleDraw() const;
94 QwtAbstractScaleDraw *abstractScaleDraw();
95
96 virtual void scaleChange();
97
98 private:
99 void updateScaleDraw();
100
101 class PrivateData;
102 PrivateData *d_data;
103 };
104
105 #endif
QwtAbstractScaleDraw
A abstract base class for drawing scales.
Definition: qwt_abstract_scale_draw.h:31
QwtScaleEngine
Base class for scale engines.
Definition: qwt_scale_engine.h:45
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:30
QwtScaleDiv
A class representing a scale division.
Definition: qwt_scale_div.h:36
QwtAbstractScale
An abstract base class for widgets having a scale.
Definition: qwt_abstract_scale.h:36
QwtInterval
A class representing an interval.
Definition: qwt_interval.h:26