QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_abstract_scale.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_ABSTRACT_SCALE_H
28#define QWT_ABSTRACT_SCALE_H
29
30#include "qwt_global.h"
31#include <qwidget.h>
32
33class QwtScaleEngine;
35class QwtScaleDiv;
36class QwtScaleMap;
37class QwtInterval;
38
61class QWT_EXPORT QwtAbstractScale : public QWidget
62{
63 Q_OBJECT
64
65 Q_PROPERTY( double lowerBound READ lowerBound WRITE setLowerBound )
66 Q_PROPERTY( double upperBound READ upperBound WRITE setUpperBound )
67
68 Q_PROPERTY( int scaleMaxMajor READ scaleMaxMajor WRITE setScaleMaxMajor )
69 Q_PROPERTY( int scaleMaxMinor READ scaleMaxMinor WRITE setScaleMaxMinor )
70
71 Q_PROPERTY( double scaleStepSize READ scaleStepSize WRITE setScaleStepSize )
72
73 public:
74 // Constructor for QwtAbstractScale
75 explicit QwtAbstractScale( QWidget* parent = nullptr );
76
77 // Destructor for QwtAbstractScale
78 virtual ~QwtAbstractScale();
79
80 // Set scale by lower and upper bounds
81 void setScale( double lowerBound, double upperBound );
82
83 // Set scale by interval
84 void setScale( const QwtInterval& );
85
86 // Set scale by scale division
87 void setScale( const QwtScaleDiv& );
88
89 // Return the current scale division
90 const QwtScaleDiv& scaleDiv() const;
91
92 // Set the lower bound of the scale
93 void setLowerBound( double value );
94
95 // Return the lower bound of the scale
96 double lowerBound() const;
97
98 // Set the upper bound of the scale
99 void setUpperBound( double value );
100
101 // Return the upper bound of the scale
102 double upperBound() const;
103
104 // Set the step size for scale calculation
105 void setScaleStepSize( double stepSize );
106
107 // Return the current step size hint
108 double scaleStepSize() const;
109
110 // Set the maximum number of major tick intervals
111 void setScaleMaxMajor( int ticks );
112
113 // Return the maximum number of minor tick intervals
114 int scaleMaxMinor() const;
115
116 // Set the maximum number of minor tick intervals
117 void setScaleMaxMinor( int ticks );
118
119 // Return the maximum number of major tick intervals
120 int scaleMaxMajor() const;
121
122 // Set the scale engine
123 void setScaleEngine( QwtScaleEngine* );
124
125 // Return the scale engine (const version)
126 const QwtScaleEngine* scaleEngine() const;
127
128 // Return the scale engine (non-const version)
129 QwtScaleEngine* scaleEngine();
130
131 // Transform a scale value to widget coordinates
132 int transform( double ) const;
133
134 // Transform a widget coordinate to scale value
135 double invTransform( int ) const;
136
137 // Return true if scale is inverted
138 bool isInverted() const;
139
140 // Return the minimum boundary value
141 double minimum() const;
142
143 // Return the maximum boundary value
144 double maximum() const;
145
146 // Return the scale map
147 const QwtScaleMap& scaleMap() const;
148
149 protected:
151 virtual void changeEvent( QEvent* ) override;
152
154 void rescale( double lowerBound,
155 double upperBound, double stepSize );
156
158 void setAbstractScaleDraw( QwtAbstractScaleDraw* );
159
161 const QwtAbstractScaleDraw* abstractScaleDraw() const;
162
164 QwtAbstractScaleDraw* abstractScaleDraw();
165
167 void updateScaleDraw();
168
170 virtual void scaleChange();
171
172 private:
173 class PrivateData;
174 PrivateData* m_data;
175};
176
177#endif
绘制刻度的抽象基类
Definition qwt_abstract_scale_draw.h:55
具有刻度的控件的抽象基类
Definition qwt_abstract_scale.h:62
表示区间的类
Definition qwt_interval.h:45
A class representing a scale division/表示刻度划分的类
Definition qwt_scale_div.h:53
刻度引擎的基类
Definition qwt_scale_engine.h:76
刻度映射
Definition qwt_scale_map.h:52