Qwt User's Guide: qwt_plot_scaleitem.h Source File

Qwt User's Guide 6.2.0

qwt_plot_scaleitem.h
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_PLOT_SCALE_ITEM_H
11 #define QWT_PLOT_SCALE_ITEM_H
12
13 #include "qwt_global.h"
14 #include "qwt_plot_item.h"
15 #include "qwt_scale_draw.h"
16
17 class QPalette;
18
46 class QWT_EXPORT QwtPlotScaleItem : public QwtPlotItem
47 {
48 public:
49 explicit QwtPlotScaleItem(
50 QwtScaleDraw::Alignment = QwtScaleDraw::BottomScale,
51 const double pos = 0.0 );
52
53 virtual ~QwtPlotScaleItem();
54
55 virtual int rtti() const QWT_OVERRIDE;
56
57 void setScaleDiv( const QwtScaleDiv& );
58 const QwtScaleDiv& scaleDiv() const;
59
60 void setScaleDivFromAxis( bool on );
61 bool isScaleDivFromAxis() const;
62
63 void setPalette( const QPalette& );
64 QPalette palette() const;
65
66 void setFont( const QFont& );
67 QFont font() const;
68
69 void setScaleDraw( QwtScaleDraw* );
70
71 const QwtScaleDraw* scaleDraw() const;
72 QwtScaleDraw* scaleDraw();
73
74 void setPosition( double pos );
75 double position() const;
76
77 void setBorderDistance( int );
78 int borderDistance() const;
79
80 void setAlignment( QwtScaleDraw::Alignment );
81
82 virtual void draw( QPainter*,
83 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
84 const QRectF& canvasRect ) const QWT_OVERRIDE;
85
86 virtual void updateScaleDiv(
87 const QwtScaleDiv&, const QwtScaleDiv& ) QWT_OVERRIDE;
88
89 private:
90 class PrivateData;
91 PrivateData* m_data;
92 };
93
94 #endif
QwtPlotItem
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:67
QwtPlotItem::draw
virtual void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const =0
Draw the item.
QwtPlotItem::rtti
virtual int rtti() const
Definition: qwt_plot_item.cpp:136
QwtPlotItem::updateScaleDiv
virtual void updateScaleDiv(const QwtScaleDiv &, const QwtScaleDiv &)
Update the item to changes of the axes scale division.
Definition: qwt_plot_item.cpp:665
QwtPlotScaleItem
A class which draws a scale inside the plot canvas.
Definition: qwt_plot_scaleitem.h:47
QwtScaleDiv
A class representing a scale division.
Definition: qwt_scale_div.h:34
QwtScaleDraw
A class for drawing scales.
Definition: qwt_scale_draw.h:36
QwtScaleDraw::Alignment
Alignment
Definition: qwt_scale_draw.h:43
QwtScaleDraw::BottomScale
@ BottomScale
The scale is below.
Definition: qwt_scale_draw.h:45
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:27