Qwt User's Guide 6.3.0
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
10#ifndef QWT_ABSTRACT_SCALE_H
11#define QWT_ABSTRACT_SCALE_H
12
13#include "qwt_global.h"
14#include <qwidget.h>
15
16class QwtScaleEngine;
18class QwtScaleDiv;
19class QwtScaleMap;
20class QwtInterval;
21
36class QWT_EXPORT QwtAbstractScale : public QWidget
37{
38 Q_OBJECT
39
40 Q_PROPERTY( double lowerBound READ lowerBound WRITE setLowerBound )
41 Q_PROPERTY( double upperBound READ upperBound WRITE setUpperBound )
42
43 Q_PROPERTY( int scaleMaxMajor READ scaleMaxMajor WRITE setScaleMaxMajor )
44 Q_PROPERTY( int scaleMaxMinor READ scaleMaxMinor WRITE setScaleMaxMinor )
45
46 Q_PROPERTY( double scaleStepSize READ scaleStepSize WRITE setScaleStepSize )
47
48 public:
49 explicit QwtAbstractScale( QWidget* parent = NULL );
50 virtual ~QwtAbstractScale();
51
52 void setScale( double lowerBound, double upperBound );
53 void setScale( const QwtInterval& );
54 void setScale( const QwtScaleDiv& );
55
56 const QwtScaleDiv& scaleDiv() const;
57
58 void setLowerBound( double value );
59 double lowerBound() const;
60
61 void setUpperBound( double value );
62 double upperBound() const;
63
64 void setScaleStepSize( double stepSize );
65 double scaleStepSize() const;
66
67 void setScaleMaxMajor( int ticks );
68 int scaleMaxMinor() const;
69
70 void setScaleMaxMinor( int ticks );
71 int scaleMaxMajor() const;
72
73 void setScaleEngine( QwtScaleEngine* );
74 const QwtScaleEngine* scaleEngine() const;
75 QwtScaleEngine* scaleEngine();
76
77 int transform( double ) const;
78 double invTransform( int ) const;
79
80 bool isInverted() const;
81
82 double minimum() const;
83 double maximum() const;
84
85 const QwtScaleMap& scaleMap() const;
86
87 protected:
88 virtual void changeEvent( QEvent* ) QWT_OVERRIDE;
89
90 void rescale( double lowerBound,
91 double upperBound, double stepSize );
92
93 void setAbstractScaleDraw( QwtAbstractScaleDraw* );
94
95 const QwtAbstractScaleDraw* abstractScaleDraw() const;
96 QwtAbstractScaleDraw* abstractScaleDraw();
97
98 void updateScaleDraw();
99 virtual void scaleChange();
100
101 private:
102 class PrivateData;
103 PrivateData* m_data;
104};
105
106#endif
A abstract base class for drawing scales.
An abstract base class for widgets having a scale.
A class representing an interval.
A class representing a scale division.
Base class for scale engines.
A scale map.