Qwt User's Guide 6.1.0

- Main Page
- Related Pages
- Classes

All Classes Functions Variables Typedefs Enumerations Enumerator Pages
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 val ) const;
84
85 QRectF labelRect( const QFont &, double val ) const;
86 QSizeF labelSize( const QFont &, double val ) const;
87
88 QRect boundingLabelRect( const QFont &, double val ) const;
89
90 protected:
91 QTransform labelTransformation( const QPointF &, const QSizeF & ) const;
92
93 virtual void drawTick( QPainter *, double val, double len ) const;
94 virtual void drawBackbone( QPainter * ) const;
95 virtual void drawLabel( QPainter *, double val ) 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