QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_dial_needle.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_DIAL_NEEDLE_H
28#define QWT_DIAL_NEEDLE_H
29
30#include "qwt_global.h"
31#include <qpalette.h>
32
33class QPainter;
34
49class QWT_EXPORT QwtDialNeedle
50{
51 public:
55 virtual ~QwtDialNeedle();
56
58 virtual void setPalette( const QPalette& );
60 const QPalette& palette() const;
61
63 virtual void draw( QPainter*, const QPointF& center,
64 double length, double direction,
65 QPalette::ColorGroup = QPalette::Active ) const;
66
67 protected:
83 virtual void drawNeedle( QPainter* painter,
84 double length, QPalette::ColorGroup colorGroup ) const = 0;
85
86 virtual void drawKnob( QPainter*, double width,
87 const QBrush&, bool sunken ) const;
88
89 private:
90 Q_DISABLE_COPY(QwtDialNeedle)
91
92 QPalette m_palette;
93};
94
112class QWT_EXPORT QwtDialSimpleNeedle : public QwtDialNeedle
113{
114 public:
123 enum Style
124 {
134
143 Ray
144 };
145
147 QwtDialSimpleNeedle( Style, bool hasKnob = true,
148 const QColor& mid = Qt::gray, const QColor& base = Qt::darkGray );
149
151 void setWidth( double width );
153 double width() const;
154
155 protected:
156 virtual void drawNeedle( QPainter*, double length,
157 QPalette::ColorGroup ) const override;
158
159 private:
160 Style m_style;
161 bool m_hasKnob;
162 double m_width;
163};
164
187class QWT_EXPORT QwtCompassMagnetNeedle : public QwtDialNeedle
188{
189 public:
198 enum Style
199 {
209
218 ThinStyle
219 };
220
222 QwtCompassMagnetNeedle( Style = TriangleStyle,
223 const QColor& light = Qt::white, const QColor& dark = Qt::red );
224
225 protected:
226 virtual void drawNeedle( QPainter*,
227 double length, QPalette::ColorGroup ) const override;
228
229 private:
230 Style m_style;
231};
232
252class QWT_EXPORT QwtCompassWindArrow : public QwtDialNeedle
253{
254 public:
263 enum Style
264 {
274
283 Style2
284 };
285
287 QwtCompassWindArrow( Style, const QColor& light = Qt::white,
288 const QColor& dark = Qt::gray );
289
290 protected:
291 virtual void drawNeedle( QPainter*,
292 double length, QPalette::ColorGroup ) const override;
293
294 private:
295 Style m_style;
296};
297
298#endif
罗盘控件的磁针
Definition qwt_dial_needle.h:188
Style
指针样式
Definition qwt_dial_needle.h:199
@ TriangleStyle
三角形指针
Definition qwt_dial_needle.h:208
风向指示器
Definition qwt_dial_needle.h:253
Style
箭头样式
Definition qwt_dial_needle.h:264
@ Style1
指向中心的指针
Definition qwt_dial_needle.h:273
可用于 QwtDial 的指针基类
Definition qwt_dial_needle.h:50
virtual void drawNeedle(QPainter *painter, double length, QPalette::ColorGroup colorGroup) const =0
Draw the needle
表盘控件的指针
Definition qwt_dial_needle.h:113
Style
指针样式
Definition qwt_dial_needle.h:124
@ Arrow
箭头样式
Definition qwt_dial_needle.h:133