QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_compass.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_COMPASS_H
28#define QWT_COMPASS_H
29
30#include "qwt_global.h"
31#include "qwt_dial.h"
32#include "qwt_round_scale_draw.h"
33
34class QwtCompassRose;
35class QString;
36template< class Key, class T > class QMap;
37
38
55class QWT_EXPORT QwtCompassScaleDraw : public QwtRoundScaleDraw
56{
57 public:
58 // Constructs a compass scale draw with default label map (N, NE, E, SE, S, SW, W, NW)
59 explicit QwtCompassScaleDraw();
60 // Constructs a compass scale draw with a custom label map
61 explicit QwtCompassScaleDraw( const QMap< double, QString >& map );
62
63 // Destructor
64 virtual ~QwtCompassScaleDraw();
65
66 // Sets the map that maps values to labels
67 void setLabelMap( const QMap< double, QString >& map );
68 // Returns the map that maps values to labels
69 QMap< double, QString > labelMap() const;
70
71 // Returns the label for a given value by looking up the label map
72 virtual QwtText label( double value ) const override;
73
74 private:
75 class PrivateData;
76 PrivateData* m_data;
77};
78
96class QWT_EXPORT QwtCompass : public QwtDial
97{
98 Q_OBJECT
99
100 public:
101 // Constructs a compass widget with a scale, no needle and no rose
102 explicit QwtCompass( QWidget* parent = nullptr );
103 // Destructor
104 virtual ~QwtCompass();
105
106 // Sets a compass rose that will be drawn inside the compass
107 void setRose( QwtCompassRose* rose );
108 // Returns the compass rose (const version)
109 const QwtCompassRose* rose() const;
110 // Returns the compass rose
111 QwtCompassRose* rose();
112
113 protected:
114 virtual void drawRose( QPainter*, const QPointF& center,
115 double radius, double north, QPalette::ColorGroup ) const;
116
117 virtual void drawScaleContents( QPainter*,
118 const QPointF& center, double radius ) const override;
119
120 virtual void keyPressEvent( QKeyEvent* ) override;
121
122 private:
123 class PrivateData;
124 PrivateData* m_data;
125};
126
127#endif
Definition qwt_compass.h:36
virtual QwtText label(double) const
将值转换为表示标签
Definition qwt_abstract_scale_draw.cpp:585
罗盘花的抽象基类
Definition qwt_compass_rose.h:47
专为QwtCompass设计的特殊刻度绘制类
Definition qwt_compass.h:56
指南针控件
Definition qwt_compass.h:97
QwtDial 类提供圆形范围控件
Definition qwt_dial.h:78
用于绘制圆形刻度的类
Definition qwt_round_scale_draw.h:58
表示文本的类
Definition qwt_text.h:93