Qwt User's Guide: qwt_scale_draw.h Source File

Qwt User's Guide 6.1.6

qwt_scale_draw.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_SCALE_DRAW_H
11 #define QWT_SCALE_DRAW_H
12
13 #include "qwt_global.h"
14 #include "qwt_abstract_scale_draw.h"
15 #include <qpoint.h>
16 #include <qrect.h>
17 #include <qtransform.h>
18
31 class QWT_EXPORT QwtScaleDraw: public QwtAbstractScaleDraw
32 {
33 public:
38 enum Alignment
39 {
41 BottomScale,
42
44 TopScale,
45
47 LeftScale,
48
50 RightScale
51 };
52
53 QwtScaleDraw();
54 virtual ~QwtScaleDraw();
55
56 void getBorderDistHint( const QFont &, int &start, int &end ) const;
57 int minLabelDist( const QFont & ) const;
58
59 int minLength( const QFont & ) const;
60 virtual double extent( const QFont & ) const;
61
62 void move( double x, double y );
63 void move( const QPointF & );
64 void setLength( double length );
65
66 Alignment alignment() const;
67 void setAlignment( Alignment );
68
69 Qt::Orientation orientation() const;
70
71 QPointF pos() const;
72 double length() const;
73
74 void setLabelAlignment( Qt::Alignment );
75 Qt::Alignment labelAlignment() const;
76
77 void setLabelRotation( double rotation );
78 double labelRotation() const;
79
80 int maxLabelHeight( const QFont & ) const;
81 int maxLabelWidth( const QFont & ) const;
82
83 QPointF labelPosition( double value ) const;
84
85 QRectF labelRect( const QFont &, double value ) const;
86 QSizeF labelSize( const QFont &, double value ) const;
87
88 QRect boundingLabelRect( const QFont &, double value ) const;
89
90 protected:
91 QTransform labelTransformation( const QPointF &, const QSizeF & ) const;
92
93 virtual void drawTick( QPainter *, double value, double len ) const;
94 virtual void drawBackbone( QPainter * ) const;
95 virtual void drawLabel( QPainter *, double value ) const;
96
97 private:
98 QwtScaleDraw( const QwtScaleDraw & );
99 QwtScaleDraw &operator=( const QwtScaleDraw &other );
100
101 void updateMap();
102
103 class PrivateData;
104 PrivateData *d_data;
105 };
106
115 inline void QwtScaleDraw::move( double x, double y )
116 {
117 move( QPointF( x, y ) );
118 }
119
120 #endif
QwtScaleDraw::TopScale
@ TopScale
The scale is above.
Definition: qwt_scale_draw.h:44
QwtAbstractScaleDraw
A abstract base class for drawing scales.
Definition: qwt_abstract_scale_draw.h:32
QwtScaleDraw
A class for drawing scales.
Definition: qwt_scale_draw.h:32
QwtScaleDraw::BottomScale
@ BottomScale
The scale is below.
Definition: qwt_scale_draw.h:41
QwtScaleDraw::move
void move(double x, double y)
Definition: qwt_scale_draw.h:115
QwtScaleDraw::Alignment
Alignment
Definition: qwt_scale_draw.h:39
QwtAbstractScaleDraw::extent
virtual double extent(const QFont &font) const =0
QwtAbstractScaleDraw::drawLabel
virtual void drawLabel(QPainter *painter, double value) const =0
QwtAbstractScaleDraw::drawBackbone
virtual void drawBackbone(QPainter *painter) const =0
QwtAbstractScaleDraw::drawTick
virtual void drawTick(QPainter *painter, double value, double len) const =0
QwtScaleDraw::LeftScale
@ LeftScale
The scale is left.
Definition: qwt_scale_draw.h:47