Loading...
Searching...
No Matches
qwt_thermo.h
/******************************************************************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_THERMO_H
#define QWT_THERMO_H
#include "qwt_global.h"
#include "qwt_abstract_scale.h"
#include "qwt_interval.h"
class QwtScaleDraw;
class QwtColorMap;
class QWT_EXPORT QwtThermo : public QwtAbstractScale
{
Q_OBJECT
Q_ENUMS( ScalePosition )
Q_ENUMS( OriginMode )
Q_PROPERTY( Qt::Orientation orientation
READ orientation WRITE setOrientation )
Q_PROPERTY( ScalePosition scalePosition
READ scalePosition WRITE setScalePosition )
Q_PROPERTY( OriginMode originMode READ originMode WRITE setOriginMode )
Q_PROPERTY( bool alarmEnabled READ alarmEnabled WRITE setAlarmEnabled )
Q_PROPERTY( double alarmLevel READ alarmLevel WRITE setAlarmLevel )
Q_PROPERTY( double origin READ origin WRITE setOrigin )
Q_PROPERTY( int spacing READ spacing WRITE setSpacing )
Q_PROPERTY( int borderWidth READ borderWidth WRITE setBorderWidth )
Q_PROPERTY( int pipeWidth READ pipeWidth WRITE setPipeWidth )
Q_PROPERTY( double value READ value WRITE setValue USER true )
public:
enum ScalePosition
{
NoScale,
LeadingScale,
TrailingScale
};
enum OriginMode
{
OriginMinimum,
OriginMaximum,
OriginCustom
};
explicit QwtThermo( QWidget* parent = NULL );
virtual ~QwtThermo();
void setOrientation( Qt::Orientation );
Qt::Orientation orientation() const;
void setScalePosition( ScalePosition );
ScalePosition scalePosition() const;
void setSpacing( int );
int spacing() const;
void setBorderWidth( int );
int borderWidth() const;
void setOriginMode( OriginMode );
OriginMode originMode() const;
void setOrigin( double );
double origin() const;
void setFillBrush( const QBrush& );
QBrush fillBrush() const;
void setAlarmBrush( const QBrush& );
QBrush alarmBrush() const;
void setAlarmLevel( double );
double alarmLevel() const;
void setAlarmEnabled( bool );
bool alarmEnabled() const;
void setColorMap( QwtColorMap* );
QwtColorMap* colorMap();
const QwtColorMap* colorMap() const;
void setPipeWidth( int );
int pipeWidth() const;
void setRangeFlags( QwtInterval::BorderFlags );
QwtInterval::BorderFlags rangeFlags() const;
double value() const;
virtual QSize sizeHint() const QWT_OVERRIDE;
virtual QSize minimumSizeHint() const QWT_OVERRIDE;
void setScaleDraw( QwtScaleDraw* );
const QwtScaleDraw* scaleDraw() const;
public Q_SLOTS:
virtual void setValue( double );
protected:
virtual void drawLiquid( QPainter*, const QRect& ) const;
virtual void scaleChange() QWT_OVERRIDE;
virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE;
virtual void resizeEvent( QResizeEvent* ) QWT_OVERRIDE;
virtual void changeEvent( QEvent* ) QWT_OVERRIDE;
QwtScaleDraw* scaleDraw();
QRect pipeRect() const;
QRect fillRect( const QRect& ) const;
QRect alarmRect( const QRect& ) const;
private:
void layoutThermo( bool );
class PrivateData;
PrivateData* m_data;
};
#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