QWT API (中文) 7.0.1
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
78class QWT_EXPORT QwtPlotMarker : public QwtPlotItem
79{
80 public:
81
94 {
97
100
103
105 Cross
106 };
107
109 explicit QwtPlotMarker();
111 explicit QwtPlotMarker( const QString& title );
113 explicit QwtPlotMarker( const QwtText& title );
114
116 virtual ~QwtPlotMarker();
117
119 virtual int rtti() const override;
120
122 double xValue() const;
124 double yValue() const;
126 QPointF value() const;
127
129 void setXValue( double );
131 void setYValue( double );
133 void setValue( double, double );
135 void setValue( const QPointF& );
136
138 void setLineStyle( LineStyle );
140 LineStyle lineStyle() const;
141
143 void setLinePen( const QColor&, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
145 void setLinePen( const QPen& );
147 const QPen& linePen() const;
148
150 void setSymbol( const QwtSymbol* );
152 const QwtSymbol* symbol() const;
153
155 void setLabel( const QwtText& );
157 QwtText label() const;
158
160 void setLabelAlignment( Qt::Alignment );
162 Qt::Alignment labelAlignment() const;
163
165 void setLabelOrientation( Qt::Orientation );
167 Qt::Orientation labelOrientation() const;
168
170 void setSpacing( int );
172 int spacing() const;
173
175 virtual void draw( QPainter*,
176 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
177 const QRectF& ) const override;
178
180 virtual QRectF boundingRect() const override;
181
183 virtual QwtGraphic legendIcon(
184 int index, const QSizeF& ) const override;
185
186 protected:
188 virtual void drawLines( QPainter*,
189 const QRectF&, const QPointF& ) const;
190
192 virtual void drawSymbol( QPainter*,
193 const QRectF&, const QPointF& ) const;
194
196 virtual void drawLabel( QPainter*,
197 const QRectF&, const QPointF& ) const;
198
199 private:
200
201 class PrivateData;
202 PrivateData* m_data;
203};
204
205#endif
可缩放图形的绘制设备
Definition qwt_graphic.h:128
绘图画布上项目的基类
Definition qwt_plot_item.h:119
virtual void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const =0
绘制项目
virtual QwtGraphic legendIcon(int index, const QSizeF &) const
Return a legend icon
Definition qwt_plot_item.cpp:621
virtual int rtti() const
Runtime type information
Definition qwt_plot_item.cpp:215
virtual QRectF boundingRect() const
Get the bounding rectangle
Definition qwt_plot_item.cpp:883
用于绘制标记的类
Definition qwt_plot_marker.h:79
LineStyle
线条样式
Definition qwt_plot_marker.h:94
@ HLine
A horizontal line
Definition qwt_plot_marker.h:99
@ NoLine
No line
Definition qwt_plot_marker.h:96
@ VLine
A vertical line
Definition qwt_plot_marker.h:102
刻度映射
Definition qwt_scale_map.h:52
用于绘制符号的类
Definition qwt_symbol.h:56
表示文本的类
Definition qwt_text.h:93