QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_text_scale_draw.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_TEXT_SCALE_DRAW_H
28#define QWT_TEXT_SCALE_DRAW_H
29
30#include "qwt_global.h"
31#include "qwt_scale_draw.h"
32
33class QString;
34template< class Key, class T >
35class QMap;
36
61class QWT_EXPORT QwtTextScaleDraw : public QwtScaleDraw
62{
63public:
64 // Constructs an empty text scale draw (no labels are displayed)
65 explicit QwtTextScaleDraw();
66
67 // Constructs a text scale draw with a custom value-to-label map
68 explicit QwtTextScaleDraw(const QMap< double, QString >& map);
69
70 // Destructor
71 ~QwtTextScaleDraw() override;
72
73 // Sets the map that maps numeric values to text labels
74 void setLabelMap(const QMap< double, QString >& map);
75
76 // Returns the map that maps numeric values to text labels
77 QMap< double, QString > labelMap() const;
78
79 // Returns the label for a given value by looking up the label map
80 virtual QwtText label(double value) const override;
81
82private:
83 QWT_DECLARE_PRIVATE(QwtTextScaleDraw)
84};
85
86#endif
Definition qwt_raster_data.h:40
virtual QwtText label(double) const
Convert a value into its representing label
Definition qwt_abstract_scale_draw.cpp:431
A class for drawing scales
Definition qwt_scale_draw.h:52
A scale draw that maps values to arbitrary text labels
Definition qwt_text_scale_draw.h:62
A class representing a text
Definition qwt_text.h:70