Qwt User's Guide 6.3.0
Loading...
Searching...
No Matches
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
17class QPalette;
18
46class QWT_EXPORT QwtPlotScaleItem : public QwtPlotItem
47{
48 public:
49 explicit QwtPlotScaleItem(
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
Base class for items on the plot canvas.
virtual void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const =0
Draw the item.
virtual int rtti() const
virtual void updateScaleDiv(const QwtScaleDiv &, const QwtScaleDiv &)
Update the item to changes of the axes scale division.
A class which draws a scale inside the plot canvas.
A class representing a scale division.
A class for drawing scales.
@ BottomScale
The scale is below.
A scale map.