QWT 7.0.1
Loading...
Searching...
No Matches
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
53class QWT_EXPORT QwtAbstractScale : public QWidget
54{
55 Q_OBJECT
56
57 Q_PROPERTY( double lowerBound READ lowerBound WRITE setLowerBound )
58 Q_PROPERTY( double upperBound READ upperBound WRITE setUpperBound )
59
60 Q_PROPERTY( int scaleMaxMajor READ scaleMaxMajor WRITE setScaleMaxMajor )
61 Q_PROPERTY( int scaleMaxMinor READ scaleMaxMinor WRITE setScaleMaxMinor )
62
63 Q_PROPERTY( double scaleStepSize READ scaleStepSize WRITE setScaleStepSize )
64
65 public:
66 explicit QwtAbstractScale( QWidget* parent = NULL );
67 virtual ~QwtAbstractScale();
68
69 void setScale( double lowerBound, double upperBound );
70 void setScale( const QwtInterval& );
71 void setScale( const QwtScaleDiv& );
72
73 const QwtScaleDiv& scaleDiv() const;
74
75 void setLowerBound( double value );
76 double lowerBound() const;
77
78 void setUpperBound( double value );
79 double upperBound() const;
80
81 void setScaleStepSize( double stepSize );
82 double scaleStepSize() const;
83
84 void setScaleMaxMajor( int ticks );
85 int scaleMaxMinor() const;
86
87 void setScaleMaxMinor( int ticks );
88 int scaleMaxMajor() const;
89
90 void setScaleEngine( QwtScaleEngine* );
91 const QwtScaleEngine* scaleEngine() const;
92 QwtScaleEngine* scaleEngine();
93
94 int transform( double ) const;
95 double invTransform( int ) const;
96
97 bool isInverted() const;
98
99 double minimum() const;
100 double maximum() const;
101
102 const QwtScaleMap& scaleMap() const;
103
104 protected:
105 virtual void changeEvent( QEvent* ) QWT_OVERRIDE;
106
107 void rescale( double lowerBound,
108 double upperBound, double stepSize );
109
110 void setAbstractScaleDraw( QwtAbstractScaleDraw* );
111
112 const QwtAbstractScaleDraw* abstractScaleDraw() const;
113 QwtAbstractScaleDraw* abstractScaleDraw();
114
115 void updateScaleDraw();
116 virtual void scaleChange();
117
118 private:
119 class PrivateData;
120 PrivateData* m_data;
121};
122
123#endif
A abstract base class for drawing scales.
Definition qwt_abstract_scale_draw.h:49
An abstract base class for widgets having a scale.
Definition qwt_abstract_scale.h:54
A class representing an interval.
Definition qwt_interval.h:40
A class representing a scale division/表示刻度划分的类
Definition qwt_scale_div.h:53
Base class for scale engines./刻度引擎的基类
Definition qwt_scale_engine.h:67
A scale map.
Definition qwt_scale_map.h:44