QWT 7.0.1
Loading...
Searching...
No Matches
qwt_plot_marker.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 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
27#ifndef QWT_PLOT_MARKER_H
28#define QWT_PLOT_MARKER_H
29
30#include "qwt_global.h"
31#include "qwt_plot_item.h"
32
33class QString;
34class QRectF;
35class QwtText;
36class QwtSymbol;
37
62class QWT_EXPORT QwtPlotMarker : public QwtPlotItem
63{
64 public:
65
71 {
74
77
80
82 Cross
83 };
84
85 explicit QwtPlotMarker();
86 explicit QwtPlotMarker( const QString& title );
87 explicit QwtPlotMarker( const QwtText& title );
88
89 virtual ~QwtPlotMarker();
90
91 virtual int rtti() const QWT_OVERRIDE;
92
93 double xValue() const;
94 double yValue() const;
95 QPointF value() const;
96
97 void setXValue( double );
98 void setYValue( double );
99 void setValue( double, double );
100 void setValue( const QPointF& );
101
102 void setLineStyle( LineStyle );
103 LineStyle lineStyle() const;
104
105 void setLinePen( const QColor&, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
106 void setLinePen( const QPen& );
107 const QPen& linePen() const;
108
109 void setSymbol( const QwtSymbol* );
110 const QwtSymbol* symbol() const;
111
112 void setLabel( const QwtText& );
113 QwtText label() const;
114
115 void setLabelAlignment( Qt::Alignment );
116 Qt::Alignment labelAlignment() const;
117
118 void setLabelOrientation( Qt::Orientation );
119 Qt::Orientation labelOrientation() const;
120
121 void setSpacing( int );
122 int spacing() const;
123
124 virtual void draw( QPainter*,
125 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
126 const QRectF& ) const QWT_OVERRIDE;
127
128 virtual QRectF boundingRect() const QWT_OVERRIDE;
129
130 virtual QwtGraphic legendIcon(
131 int index, const QSizeF& ) const QWT_OVERRIDE;
132
133 protected:
134 virtual void drawLines( QPainter*,
135 const QRectF&, const QPointF& ) const;
136
137 virtual void drawSymbol( QPainter*,
138 const QRectF&, const QPointF& ) const;
139
140 virtual void drawLabel( QPainter*,
141 const QRectF&, const QPointF& ) const;
142
143 private:
144
145 class PrivateData;
146 PrivateData* m_data;
147};
148
149#endif
A paint device for scalable graphics.
Definition qwt_graphic.h:93
Base class for items on the plot canvas.
Definition qwt_plot_item.h:85
virtual int rtti() const
Return rtti for the specific class represented.
Definition qwt_plot_item.cpp:153
A class for drawing markers.
Definition qwt_plot_marker.h:63
LineStyle
Line styles.
Definition qwt_plot_marker.h:71
@ HLine
A horizontal line.
Definition qwt_plot_marker.h:76
@ NoLine
No line.
Definition qwt_plot_marker.h:73
@ VLine
A vertical line.
Definition qwt_plot_marker.h:79
A scale map.
Definition qwt_scale_map.h:44
A class for drawing symbols.
Definition qwt_symbol.h:49
A class representing a text.
Definition qwt_text.h:69