Qwt User's Guide: qwt_plot_scaleitem.h Source File

Qwt User's Guide 5.2.3

- 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 #if QT_VERSION < 0x040000
18 class QColorGroup;
19 #else
20 class QPalette;
21 #endif
22
51 class QWT_EXPORT QwtPlotScaleItem: public QwtPlotItem
52 {
53 public:
54 explicit QwtPlotScaleItem(
55 QwtScaleDraw::Alignment = QwtScaleDraw::BottomScale,
56 const double pos = 0.0);
57 virtual ~QwtPlotScaleItem();
58
59 virtual int rtti() const;
60
61 void setScaleDiv(const QwtScaleDiv& );
62 const QwtScaleDiv& scaleDiv() const;
63
64 void setScaleDivFromAxis(bool on);
65 bool isScaleDivFromAxis() const;
66
67 #if QT_VERSION < 0x040000
68 void setColorGroup(const QColorGroup &);
69 QColorGroup colorGroup() const;
70 #else
71 void setPalette(const QPalette &);
72 QPalette palette() const;
73 #endif
74
75 void setFont(const QFont&);
76 QFont font() const;
77
78 void setScaleDraw(QwtScaleDraw *);
79
80 const QwtScaleDraw *scaleDraw() const;
81 QwtScaleDraw *scaleDraw();
82
83 void setPosition(double pos);
84 double position() const;
85
86 void setBorderDistance(int numPixels);
87 int borderDistance() const;
88
89 void setAlignment(QwtScaleDraw::Alignment);
90
91 virtual void draw(QPainter *p,
92 const QwtScaleMap &xMap, const QwtScaleMap &yMap,
93 const QRect &rect) const;
94
95 virtual void updateScaleDiv(const QwtScaleDiv&,
96 const QwtScaleDiv&);
97
98 private:
99 void updateBorders();
100
101 class PrivateData;
102 PrivateData *d_data;
103 };
104
105 #endif