qwt_scale_draw.h
Go to the documentation of this file.
1 /******************************************************************************
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;
108 };
109 
118 inline void QwtScaleDraw::move( double x, double y )
119 {
120  move( QPointF( x, y ) );
121 }
122 
123 #endif
QwtScaleDraw
A class for drawing scales.
Definition: qwt_scale_draw.h:35
QwtAbstractScaleDraw::drawTick
virtual void drawTick(QPainter *painter, double value, double len) const =0
QwtScaleDraw::m_data
PrivateData * m_data
Definition: qwt_scale_draw.h:106
QwtScaleDraw::LeftScale
@ LeftScale
The scale is left.
Definition: qwt_scale_draw.h:51
QwtScaleDraw::PrivateData
Definition: qwt_scale_draw.cpp:266
qwt_global.h
mqtt_test_proto.x
x
Definition: mqtt_test_proto.py:34
mqtt_test_proto.y
y
Definition: mqtt_test_proto.py:35
QwtAbstractScaleDraw::extent
virtual double extent(const QFont &font) const =0
QwtAbstractScaleDraw::drawBackbone
virtual void drawBackbone(QPainter *painter) const =0
QwtScaleDraw::TopScale
@ TopScale
The scale is above.
Definition: qwt_scale_draw.h:48
backward::details::move
const T & move(const T &v)
Definition: backward.hpp:394
QwtScaleDraw::Alignment
Alignment
Definition: qwt_scale_draw.h:42
qwt_abstract_scale_draw.h
QwtAbstractScaleDraw
A abstract base class for drawing scales.
Definition: qwt_abstract_scale_draw.h:31
QwtScaleDraw::move
void move(double x, double y)
Definition: qwt_scale_draw.h:118
QwtAbstractScaleDraw::drawLabel
virtual void drawLabel(QPainter *painter, double value) const =0
QwtScaleDraw::BottomScale
@ BottomScale
The scale is below.
Definition: qwt_scale_draw.h:45
QWT_OVERRIDE
#define QWT_OVERRIDE
Definition: qwt_global.h:53
QWT_EXPORT
#define QWT_EXPORT
Definition: qwt_global.h:38


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46