Qwt User's Guide: qwt_thermo.h Source File

Qwt User's Guide 6.3.0

Loading...
Searching...
No Matches
qwt_thermo.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_THERMO_H
11#define QWT_THERMO_H
12
13#include "qwt_global.h"
14#include "qwt_abstract_scale.h"
15#include "qwt_interval.h"
16
17class QwtScaleDraw;
18class QwtColorMap;
19
46 class QWT_EXPORT QwtThermo : public QwtAbstractScale
47{
48 Q_OBJECT
49
50 Q_ENUMS( ScalePosition )
51 Q_ENUMS( OriginMode )
52
53 Q_PROPERTY( Qt::Orientation orientation
54 READ orientation WRITE setOrientation )
55 Q_PROPERTY( ScalePosition scalePosition
56 READ scalePosition WRITE setScalePosition )
57 Q_PROPERTY( OriginMode originMode READ originMode WRITE setOriginMode )
58
59 Q_PROPERTY( bool alarmEnabled READ alarmEnabled WRITE setAlarmEnabled )
60 Q_PROPERTY( double alarmLevel READ alarmLevel WRITE setAlarmLevel )
61 Q_PROPERTY( double origin READ origin WRITE setOrigin )
62 Q_PROPERTY( int spacing READ spacing WRITE setSpacing )
63 Q_PROPERTY( int borderWidth READ borderWidth WRITE setBorderWidth )
64 Q_PROPERTY( int pipeWidth READ pipeWidth WRITE setPipeWidth )
65 Q_PROPERTY( double value READ value WRITE setValue USER true )
66
67 public:
68
73 enum ScalePosition
74 {
76 NoScale,
77
79 LeadingScale,
80
82 TrailingScale
83 };
84
91 enum OriginMode
92 {
94 OriginMinimum,
95
97 OriginMaximum,
98
100 OriginCustom
101 };
102
103 explicit QwtThermo( QWidget* parent = NULL );
104 virtual ~QwtThermo();
105
106 void setOrientation( Qt::Orientation );
107 Qt::Orientation orientation() const;
108
109 void setScalePosition( ScalePosition );
110 ScalePosition scalePosition() const;
111
112 void setSpacing( int );
113 int spacing() const;
114
115 void setBorderWidth( int );
116 int borderWidth() const;
117
118 void setOriginMode( OriginMode );
119 OriginMode originMode() const;
120
121 void setOrigin( double );
122 double origin() const;
123
124 void setFillBrush( const QBrush& );
125 QBrush fillBrush() const;
126
127 void setAlarmBrush( const QBrush& );
128 QBrush alarmBrush() const;
129
130 void setAlarmLevel( double );
131 double alarmLevel() const;
132
133 void setAlarmEnabled( bool );
134 bool alarmEnabled() const;
135
136 void setColorMap( QwtColorMap* );
137 QwtColorMap* colorMap();
138 const QwtColorMap* colorMap() const;
139
140 void setPipeWidth( int );
141 int pipeWidth() const;
142
143 void setRangeFlags( QwtInterval::BorderFlags );
144 QwtInterval::BorderFlags rangeFlags() const;
145
146 double value() const;
147
148 virtual QSize sizeHint() const QWT_OVERRIDE;
149 virtual QSize minimumSizeHint() const QWT_OVERRIDE;
150
151 void setScaleDraw( QwtScaleDraw* );
152 const QwtScaleDraw* scaleDraw() const;
153
154 public Q_SLOTS:
155 virtual void setValue( double );
156
157 protected:
158 virtual void drawLiquid( QPainter*, const QRect& ) const;
159 virtual void scaleChange() QWT_OVERRIDE;
160
161 virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE;
162 virtual void resizeEvent( QResizeEvent* ) QWT_OVERRIDE;
163 virtual void changeEvent( QEvent* ) QWT_OVERRIDE;
164
165 QwtScaleDraw* scaleDraw();
166
167 QRect pipeRect() const;
168 QRect fillRect( const QRect& ) const;
169 QRect alarmRect( const QRect& ) const;
170
171 private:
172 void layoutThermo( bool );
173
174 class PrivateData;
175 PrivateData* m_data;
176};
177
178#endif
QwtAbstractScale
An abstract base class for widgets having a scale.
Definition qwt_abstract_scale.h:37
QwtColorMap
QwtColorMap is used to map values into colors.
Definition qwt_color_map.h:38
QwtInterval::BorderFlags
QFlags< BorderFlag > BorderFlags
Border flags.
Definition qwt_interval.h:45
QwtScaleDraw
A class for drawing scales.
Definition qwt_scale_draw.h:36
QwtThermo
The Thermometer Widget.
Definition qwt_thermo.h:47
QwtThermo::ScalePosition
ScalePosition
Definition qwt_thermo.h:74
QwtThermo::NoScale
@ NoScale
The slider has no scale.
Definition qwt_thermo.h:76
QwtThermo::LeadingScale
@ LeadingScale
The scale is right of a vertical or below of a horizontal slider.
Definition qwt_thermo.h:79
QwtThermo::OriginMode
OriginMode
Definition qwt_thermo.h:92
QwtThermo::OriginMaximum
@ OriginMaximum
The origin is the maximum of the scale.
Definition qwt_thermo.h:97
QwtThermo::OriginMinimum
@ OriginMinimum
The origin is the minimum of the scale.
Definition qwt_thermo.h:94