48
\sa enableComponent(), hasComponent
38
\sa enableComponent(), hasComponent
51
40
enum ScaleComponent
42
//! Backbone = the line where the ticks are located
53
typedef QFlags<ScaleComponent> ScaleComponents;
58
55
QwtAbstractScaleDraw();
59
QwtAbstractScaleDraw( const QwtAbstractScaleDraw & );
60
56
virtual ~QwtAbstractScaleDraw();
62
QwtAbstractScaleDraw &operator=(const QwtAbstractScaleDraw &);
64
void setScaleDiv(const QwtScaleDiv &s);
58
void setScaleDiv( const QwtScaleDiv &s );
65
59
const QwtScaleDiv& scaleDiv() const;
67
void setTransformation(QwtScaleTransformation *);
68
const QwtScaleMap &map() const;
70
void enableComponent(ScaleComponent, bool enable = true);
71
bool hasComponent(ScaleComponent) const;
73
void setTickLength(QwtScaleDiv::TickType, int length);
74
int tickLength(QwtScaleDiv::TickType) const;
75
int majTickLength() const;
77
void setSpacing(int margin);
80
#if QT_VERSION < 0x040000
81
virtual void draw(QPainter *, const QColorGroup &) const;
83
virtual void draw(QPainter *, const QPalette &) const;
86
virtual QwtText label(double) const;
61
void setTransformation( QwtScaleTransformation * );
62
const QwtScaleMap &scaleMap() const;
63
QwtScaleMap &scaleMap();
65
void enableComponent( ScaleComponent, bool enable = true );
66
bool hasComponent( ScaleComponent ) const;
68
void setTickLength( QwtScaleDiv::TickType, double length );
69
double tickLength( QwtScaleDiv::TickType ) const;
70
double maxTickLength() const;
72
void setSpacing( double margin );
73
double spacing() const;
75
void setPenWidth( int width );
78
virtual void draw( QPainter *, const QPalette & ) const;
80
virtual QwtText label( double ) const;
91
85
The extent is the distcance from the baseline to the outermost
92
86
pixel of the scale draw in opposite to its orientation.
93
87
It is at least minimumExtent() pixels.
95
89
\sa setMinimumExtent(), minimumExtent()
97
virtual int extent(const QPen &, const QFont &) const = 0;
99
void setMinimumExtent(int);
100
int minimumExtent() const;
102
QwtScaleMap &scaleMap();
91
virtual double extent( const QFont & ) const = 0;
93
void setMinimumExtent( double );
94
double minimumExtent() const;
108
100
\param painter Painter
109
101
\param value Value of the tick
110
102
\param len Lenght of the tick
112
104
\sa drawBackbone(), drawLabel()
114
virtual void drawTick(QPainter *painter, double value, int len) const = 0;
106
virtual void drawTick( QPainter *painter, double value, double len ) const = 0;
117
109
Draws the baseline of the scale
120
112
\sa drawTick(), drawLabel()
122
virtual void drawBackbone(QPainter *painter) const = 0;
114
virtual void drawBackbone( QPainter *painter ) const = 0;
125
117
Draws the label for a major scale tick
127
119
\param painter Painter
128
120
\param value Value
130
\sa drawTick, drawBackbone
132
virtual void drawLabel(QPainter *painter, double value) const = 0;
122
\sa drawTick(), drawBackbone()
124
virtual void drawLabel( QPainter *painter, double value ) const = 0;
134
126
void invalidateCache();
135
const QwtText &tickLabel(const QFont &, double value) const;
127
const QwtText &tickLabel( const QFont &, double value ) const;
138
int operator==(const QwtAbstractScaleDraw &) const;
139
int operator!=(const QwtAbstractScaleDraw &) const;
130
QwtAbstractScaleDraw( const QwtAbstractScaleDraw & );
131
QwtAbstractScaleDraw &operator=( const QwtAbstractScaleDraw & );
141
133
class PrivateData;
142
134
PrivateData *d_data;
137
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtAbstractScaleDraw::ScaleComponents )