QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
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{
64public:
71 {
74
77
80
82 Cross
83 };
84
86 explicit QwtPlotMarker();
88 explicit QwtPlotMarker(const QString& title);
90 explicit QwtPlotMarker(const QwtText& title);
91
93 ~QwtPlotMarker() override;
94
96 virtual int rtti() const override;
97
99 double xValue() const;
101 double yValue() const;
103 QPointF value() const;
104
106 void setXValue(double);
108 void setYValue(double);
110 void setValue(double, double);
112 void setValue(const QPointF&);
113
115 void setLineStyle(LineStyle);
117 LineStyle lineStyle() const;
118
120 void setLinePen(const QColor&, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine);
122 void setLinePen(const QPen&);
124 const QPen& linePen() const;
125
127 void setSymbol(const QwtSymbol*);
129 const QwtSymbol* symbol() const;
130
132 void setLabel(const QwtText&);
134 QwtText label() const;
135
137 void setLabelAlignment(Qt::Alignment);
139 Qt::Alignment labelAlignment() const;
140
142 void setLabelOrientation(Qt::Orientation);
144 Qt::Orientation labelOrientation() const;
145
147 void setSpacing(int);
149 int spacing() const;
150
152 virtual void draw(QPainter*, const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QRectF&) const override;
153
155 virtual QRectF boundingRect() const override;
156
158 virtual QwtGraphic legendIcon(int index, const QSizeF&) const override;
159
160protected:
162 virtual void drawLines(QPainter*, const QRectF&, const QPointF&) const;
163
165 virtual void drawSymbol(QPainter*, const QRectF&, const QPointF&) const;
166
168 virtual void drawLabel(QPainter*, const QRectF&, const QPointF&) const;
169
170private:
171 QWT_DECLARE_PRIVATE(QwtPlotMarker)
172};
173
174#endif
A paint device for scalable graphics
Definition qwt_graphic.h:85
Base class for items on the plot canvas
Definition qwt_plot_item.h:85
virtual void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const =0
Draw the item
virtual QwtGraphic legendIcon(int index, const QSizeF &) const
Return a legend icon
Definition qwt_plot_item.cpp:420
virtual int rtti() const
Runtime type information
Definition qwt_plot_item.cpp:155
virtual QRectF boundingRect() const
Get the bounding rectangle
Definition qwt_plot_item.cpp:593
A class for drawing markers
Definition qwt_plot_marker.h:63
QwtPlotMarker(const QwtText &title)
Constructor with QwtText title
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
~QwtPlotMarker() override
Destructor
QwtPlotMarker(const QString &title)
Constructor with title
A scale map
Definition qwt_scale_map.h:44
A class for drawing symbols
Definition qwt_symbol.h:51
A class representing a text
Definition qwt_text.h:70