QWT API (中文)
7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
src
plot
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
34
class
QwtCompassRose
;
35
class
QString;
36
template
<
class
Key,
class
T >
37
class
QMap
;
38
46
class
QWT_EXPORT
QwtCompassScaleDraw
:
public
QwtRoundScaleDraw
47
{
48
public
:
49
// Constructs a compass scale draw with default label map (N, NE, E, SE, S, SW, W, NW)
50
explicit
QwtCompassScaleDraw
();
51
// Constructs a compass scale draw with a custom label map
52
explicit
QwtCompassScaleDraw
(
const
QMap< double, QString >
& map);
53
54
// Destructor
55
~QwtCompassScaleDraw
()
override
;
56
57
// Sets the map that maps values to labels
58
void
setLabelMap(
const
QMap< double, QString >
& map);
59
// Returns the map that maps values to labels
60
QMap< double, QString >
labelMap()
const
;
61
62
// Returns the label for a given value by looking up the label map
63
virtual
QwtText
label
(
double
value)
const override
;
64
65
private
:
66
QWT_DECLARE_PRIVATE(
QwtCompassScaleDraw
)
67
};
68
77
class
QWT_EXPORT
QwtCompass
:
public
QwtDial
78
{
79
Q_OBJECT
80
81
public
:
82
// Constructs a compass widget with a scale, no needle and no rose
83
explicit
QwtCompass
(QWidget* parent =
nullptr
);
84
// Destructor
85
~QwtCompass
()
override
;
86
87
// Sets a compass rose that will be drawn inside the compass
88
void
setRose(
QwtCompassRose
* rose);
89
// Returns the compass rose (const version)
90
const
QwtCompassRose
* rose()
const
;
91
// Returns the compass rose
92
QwtCompassRose
* rose();
93
94
protected
:
95
virtual
void
drawRose(QPainter*,
const
QPointF& center,
double
radius,
double
north, QPalette::ColorGroup)
const
;
96
97
virtual
void
drawScaleContents(QPainter*,
const
QPointF& center,
double
radius)
const override
;
98
99
virtual
void
keyPressEvent(QKeyEvent*)
override
;
100
101
private
:
102
QWT_DECLARE_PRIVATE(
QwtCompass
)
103
};
104
105
#endif
QMap
Definition
qwt_raster_data.h:40
QwtAbstractScaleDraw::label
virtual QwtText label(double) const
Convert a value into its representing label
Definition
qwt_abstract_scale_draw.cpp:431
QwtCompassRose
Abstract base class for a compass rose
Definition
qwt_compass_rose.h:41
QwtCompassScaleDraw
A special scale draw made for QwtCompass
Definition
qwt_compass.h:47
QwtCompass
A Compass Widget
Definition
qwt_compass.h:78
QwtDial
QwtDial class provides a rounded range control
Definition
qwt_dial.h:62
QwtRoundScaleDraw
A class for drawing round scales
Definition
qwt_round_scale_draw.h:47
QwtText
A class representing a text
Definition
qwt_text.h:70
制作者
1.9.8