qwt_scale_draw.h
Go to the documentation of this file.
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"
15 
16 #include <qpoint.h>
17 
18 class QTransform;
19 class QSizeF;
20 class QRectF;
21 class QRect;
22 
36 {
37 public:
42  enum Alignment
43  {
46 
49 
52 
54  RightScale
55  };
56 
57  QwtScaleDraw();
58  virtual ~QwtScaleDraw();
59 
60  void getBorderDistHint( const QFont &, int &start, int &end ) const;
61  int minLabelDist( const QFont & ) const;
62 
63  int minLength( const QFont & ) const;
64  virtual double extent( const QFont & ) const QWT_OVERRIDE;
65 
66  void move( double x, double y );
67  void move( const QPointF & );
68  void setLength( double length );
69 
70  Alignment alignment() const;
71  void setAlignment( Alignment );
72 
73  Qt::Orientation orientation() const;
74 
75  QPointF pos() const;
76  double length() const;
77 
78  void setLabelAlignment( Qt::Alignment );
79  Qt::Alignment labelAlignment() const;
80 
81  void setLabelRotation( double rotation );
82  double labelRotation() const;
83 
84  int maxLabelHeight( const QFont & ) const;
85  int maxLabelWidth( const QFont & ) const;
86 
87  QPointF labelPosition( double value ) const;
88 
89  QRectF labelRect( const QFont &, double value ) const;
90  QSizeF labelSize( const QFont &, double value ) const;
91 
92  QRect boundingLabelRect( const QFont &, double value ) const;
93 
94 protected:
95  QTransform labelTransformation( const QPointF &, const QSizeF & ) const;
96 
97  virtual void drawTick( QPainter *,
98  double value, double len ) const QWT_OVERRIDE;
99 
100  virtual void drawBackbone( QPainter * ) const QWT_OVERRIDE;
101  virtual void drawLabel( QPainter *, double value ) const QWT_OVERRIDE;
102 
103 private:
104  void updateMap();
105 
106  class PrivateData;
107  PrivateData *d_data;
108 };
109 
118 inline void QwtScaleDraw::move( double x, double y )
119 {
120  move( QPointF( x, y ) );
121 }
122 
123 #endif
A abstract base class for drawing scales.
enum MQTTPropertyCodes value
#define QWT_EXPORT
Definition: qwt_global.h:38
The scale is above.
void drawBackbone(QPainter *painter, const QwtScaleDraw *scaleDraw)
The scale is left.
const T & move(const T &v)
Definition: backward.hpp:394
virtual double extent(const QFont &font) const =0
A class for drawing scales.
void drawTick(QPainter *painter, const QwtScaleDraw *scaleDraw, qreal tickPos, qreal tickLength)
The scale is below.
#define QWT_OVERRIDE
Definition: qwt_global.h:53
int len
Definition: utf-8.c:46


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:48:10