Qwt User's Guide 5.2.3

- Main Page
- Related Pages
- Classes

qwt_plot_marker.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 // vim: expandtab
11
12 #ifndef QWT_PLOT_MARKER_H
13 #define QWT_PLOT_MARKER_H
14
15 #include <qpen.h>
16 #include <qfont.h>
17 #include <qstring.h>
18 #include <qbrush.h>
19 #include "qwt_global.h"
20 #include "qwt_plot_item.h"
21
22 class QRect;
23 class QwtText;
24 class QwtSymbol;
25
45 class QWT_EXPORT QwtPlotMarker: public QwtPlotItem
46 {
47 public:
48
53 enum LineStyle
54 {
55 NoLine,
56 HLine,
57 VLine,
58 Cross
59 };
60
61 explicit QwtPlotMarker();
62 virtual ~QwtPlotMarker();
63
64 virtual int rtti() const;
65
66 double xValue() const;
67 double yValue() const;
68 QwtDoublePoint value() const;
69
70 void setXValue(double);
71 void setYValue(double);
72 void setValue(double, double);
73 void setValue(const QwtDoublePoint &);
74
75 void setLineStyle(LineStyle st);
76 LineStyle lineStyle() const;
77
78 void setLinePen(const QPen &p);
79 const QPen &linePen() const;
80
81 void setSymbol(const QwtSymbol &s);
82 const QwtSymbol &symbol() const;
83
84 void setLabel(const QwtText&);
85 QwtText label() const;
86
87 #if QT_VERSION < 0x040000
88 void setLabelAlignment(int align);
89 int labelAlignment() const;
90 #else
91 void setLabelAlignment(Qt::Alignment);
92 Qt::Alignment labelAlignment() const;
93 #endif
94
95 void setLabelOrientation(Qt::Orientation);
96 Qt::Orientation labelOrientation() const;
97
98 void setSpacing(int);
99 int spacing() const;
100
101 virtual void draw(QPainter *p,
102 const QwtScaleMap &xMap, const QwtScaleMap &yMap,
103 const QRect &) const;
104
105 virtual QwtDoubleRect boundingRect() const;
106
107 protected:
108 void drawAt(QPainter *,const QRect &, const QPoint &) const;
109
110 private:
111 void drawLabel(QPainter *, const QRect &, const QPoint &) const;
112
113 class PrivateData;
114 PrivateData *d_data;
115 };
116
117 #endif