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 #include <qpoint.h>
16 #include <qrect.h>
17 #include <qtransform.h>
18 
32 {
33 public:
38  enum Alignment
39  {
42 
45 
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  void updateMap();
99 
100  class PrivateData;
102 };
103 
112 inline void QwtScaleDraw::move( double x, double y )
113 {
114  move( QPointF( x, y ) );
115 }
116 
117 #endif
A abstract base class for drawing scales.
virtual void drawBackbone(QPainter *painter) const =0
#define QWT_EXPORT
Definition: qwt_global.h:38
The scale is above.
virtual void drawTick(QPainter *painter, double value, double len) const =0
virtual void drawLabel(QPainter *painter, double value) const =0
PrivateData * d_data
The scale is left.
virtual double extent(const QFont &font) const =0
A class for drawing scales.
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
std::size_t length
The scale is below.
void move(double x, double y)


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:17