Qwt User's Guide 6.0.2

- Main Page
- Related Pages
- Classes

qwt_plot_scaleitem.h
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_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
47 class QWT_EXPORT QwtPlotScaleItem: public QwtPlotItem
48 {
49 public:
50 explicit QwtPlotScaleItem(
51 QwtScaleDraw::Alignment = QwtScaleDraw::BottomScale,
52 const double pos = 0.0 );
53
54 virtual ~QwtPlotScaleItem();
55
56 virtual int rtti() const;
57
58 void setScaleDiv( const QwtScaleDiv& );
59 const QwtScaleDiv& scaleDiv() const;
60
61 void setScaleDivFromAxis( bool on );
62 bool isScaleDivFromAxis() const;
63
64 void setPalette( const QPalette & );
65 QPalette palette() const;
66
67 void setFont( const QFont& );
68 QFont font() const;
69
70 void setScaleDraw( QwtScaleDraw * );
71
72 const QwtScaleDraw *scaleDraw() const;
73 QwtScaleDraw *scaleDraw();
74
75 void setPosition( double pos );
76 double position() const;
77
78 void setBorderDistance( int numPixels );
79 int borderDistance() const;
80
81 void setAlignment( QwtScaleDraw::Alignment );
82
83 virtual void draw( QPainter *p,
84 const QwtScaleMap &xMap, const QwtScaleMap &yMap,
85 const QRectF &rect ) const;
86
87 virtual void updateScaleDiv( const QwtScaleDiv &, const QwtScaleDiv & );
88
89 private:
90 class PrivateData;
91 PrivateData *d_data;
92 };
93
94 #endif