QWT 7.0.1
Loading...
Searching...
No Matches
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
49class QWT_EXPORT QwtCompassScaleDraw : public QwtRoundScaleDraw
50{
51 public:
52 explicit QwtCompassScaleDraw();
53 explicit QwtCompassScaleDraw( const QMap< double, QString >& map );
54
55 virtual ~QwtCompassScaleDraw();
56
57 void setLabelMap( const QMap< double, QString >& map );
58 QMap< double, QString > labelMap() const;
59
60 virtual QwtText label( double value ) const QWT_OVERRIDE;
61
62 private:
63 class PrivateData;
64 PrivateData* m_data;
65};
66
78class QWT_EXPORT QwtCompass : public QwtDial
79{
80 Q_OBJECT
81
82 public:
83 explicit QwtCompass( QWidget* parent = NULL );
84 virtual ~QwtCompass();
85
86 void setRose( QwtCompassRose* rose );
87 const QwtCompassRose* rose() const;
88 QwtCompassRose* rose();
89
90 protected:
91 virtual void drawRose( QPainter*, const QPointF& center,
92 double radius, double north, QPalette::ColorGroup ) const;
93
94 virtual void drawScaleContents( QPainter*,
95 const QPointF& center, double radius ) const QWT_OVERRIDE;
96
97 virtual void keyPressEvent( QKeyEvent* ) QWT_OVERRIDE;
98
99 private:
100 class PrivateData;
101 PrivateData* m_data;
102};
103
104#endif
Definition qwt_compass.h:36
virtual QwtText label(double) const
Convert a value into its representing label.
Definition qwt_abstract_scale_draw.cpp:426
Abstract base class for a compass rose.
Definition qwt_compass_rose.h:39
A special scale draw made for QwtCompass.
Definition qwt_compass.h:50
A Compass Widget.
Definition qwt_compass.h:79
QwtDial class provides a rounded range control.
Definition qwt_dial.h:68
A class for drawing round scales.
Definition qwt_round_scale_draw.h:49
A class representing a text.
Definition qwt_text.h:69