Loading...
Searching...
No Matches
qwt_thermo.cpp
/******************************************************************************
* 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
*****************************************************************************/
#include "qwt_thermo.h"
#include "qwt_scale_draw.h"
#include "qwt_scale_map.h"
#include "qwt_color_map.h"
#include "qwt_math.h"
#include <qpainter.h>
#include <qevent.h>
#include <qdrawutil.h>
#include <qstyle.h>
#include <qstyleoption.h>
#include <qmargins.h>
#include <algorithm>
#include <functional>
static inline void qwtDrawLine( QPainter* painter, int pos,
const QColor& color, const QRect& pipeRect, const QRect& liquidRect,
Qt::Orientation orientation )
{
painter->setPen( color );
if ( orientation == Qt::Horizontal )
{
if ( pos >= liquidRect.left() && pos < liquidRect.right() )
painter->drawLine( pos, pipeRect.top(), pos, pipeRect.bottom() );
}
else
{
if ( pos >= liquidRect.top() && pos < liquidRect.bottom() )
painter->drawLine( pipeRect.left(), pos, pipeRect.right(), pos );
}
}
static QVector< double > qwtTickList( const QwtScaleDiv& scaleDiv )
{
QVector< double > values;
double lowerLimit = scaleDiv.interval().minValue();
double upperLimit = scaleDiv.interval().maxValue();
if ( upperLimit < lowerLimit )
qSwap( lowerLimit, upperLimit );
values += lowerLimit;
for ( int tickType = QwtScaleDiv::MinorTick;
tickType < QwtScaleDiv::NTickTypes; tickType++ )
{
const QList< double > ticks = scaleDiv.ticks( tickType );
for ( int i = 0; i < ticks.count(); i++ )
{
const double v = ticks[i];
if ( v > lowerLimit && v < upperLimit )
values += v;
}
}
values += upperLimit;
return values;
}
class QwtThermo::PrivateData
{
public:
PrivateData()
: orientation( Qt::Vertical )
, scalePosition( QwtThermo::TrailingScale )
, spacing( 3 )
, borderWidth( 2 )
, pipeWidth( 10 )
, alarmLevel( 0.0 )
, alarmEnabled( false )
, autoFillPipe( true )
, originMode( QwtThermo::OriginMinimum )
, origin( 0.0 )
, colorMap( NULL )
, value( 0.0 )
{
rangeFlags = QwtInterval::IncludeBorders;
}
~PrivateData()
{
delete colorMap;
}
Qt::Orientation orientation;
QwtThermo::ScalePosition scalePosition;
int spacing;
int borderWidth;
int pipeWidth;
QwtInterval::BorderFlags rangeFlags;
double alarmLevel;
bool alarmEnabled;
bool autoFillPipe;
QwtThermo::OriginMode originMode;
double origin;
QwtColorMap* colorMap;
double value;
};
QwtThermo::QwtThermo( QWidget* parent )
: QwtAbstractScale( parent )
{
m_data = new PrivateData;
QSizePolicy policy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );
if ( m_data->orientation == Qt::Vertical )
policy.transpose();
setSizePolicy( policy );
setAttribute( Qt::WA_WState_OwnSizePolicy, false );
layoutThermo( true );
}
QwtThermo::~QwtThermo()
{
delete m_data;
}
void QwtThermo::setRangeFlags( QwtInterval::BorderFlags flags )
{
if ( m_data->rangeFlags != flags )
{
m_data->rangeFlags = flags;
update();
}
}
QwtInterval::BorderFlags QwtThermo::rangeFlags() const
{
return m_data->rangeFlags;
}
void QwtThermo::setValue( double value )
{
if ( m_data->value != value )
{
m_data->value = value;
update();
}
}
double QwtThermo::value() const
{
return m_data->value;
}
void QwtThermo::setScaleDraw( QwtScaleDraw* scaleDraw )
{
setAbstractScaleDraw( scaleDraw );
layoutThermo( true );
}
const QwtScaleDraw* QwtThermo::scaleDraw() const
{
return static_cast< const QwtScaleDraw* >( abstractScaleDraw() );
}
QwtScaleDraw* QwtThermo::scaleDraw()
{
return static_cast< QwtScaleDraw* >( abstractScaleDraw() );
}
void QwtThermo::paintEvent( QPaintEvent* event )
{
QPainter painter( this );
painter.setClipRegion( event->region() );
QStyleOption opt;
opt.initFrom(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
const QRect tRect = pipeRect();
if ( !tRect.contains( event->rect() ) )
{
if ( m_data->scalePosition != QwtThermo::NoScale )
scaleDraw()->draw( &painter, palette() );
}
const int bw = m_data->borderWidth;
const QBrush brush = palette().brush( QPalette::Base );
qDrawShadePanel( &painter,
tRect.adjusted( -bw, -bw, bw, bw ),
palette(), true, bw,
m_data->autoFillPipe ? &brush : NULL );
drawLiquid( &painter, tRect );
}
void QwtThermo::resizeEvent( QResizeEvent* event )
{
Q_UNUSED( event );
layoutThermo( false );
}
void QwtThermo::changeEvent( QEvent* event )
{
switch( event->type() )
{
case QEvent::StyleChange:
case QEvent::FontChange:
{
layoutThermo( true );
break;
}
default:
break;
}
}
void QwtThermo::layoutThermo( bool update_geometry )
{
const QRect tRect = pipeRect();
const int bw = m_data->borderWidth + m_data->spacing;
const bool inverted = ( upperBound() < lowerBound() );
int from, to;
if ( m_data->orientation == Qt::Horizontal )
{
from = tRect.left();
to = tRect.right();
if ( m_data->rangeFlags & QwtInterval::ExcludeMinimum )
{
if ( inverted )
to++;
else
from--;
}
if ( m_data->rangeFlags & QwtInterval::ExcludeMaximum )
{
if ( inverted )
from--;
else
to++;
}
if ( m_data->scalePosition == QwtThermo::TrailingScale )
{
scaleDraw()->setAlignment( QwtScaleDraw::TopScale );
scaleDraw()->move( from, tRect.top() - bw );
}
else
{
scaleDraw()->setAlignment( QwtScaleDraw::BottomScale );
scaleDraw()->move( from, tRect.bottom() + bw );
}
scaleDraw()->setLength( qMax( to - from, 0 ) );
}
else // Qt::Vertical
{
from = tRect.top();
to = tRect.bottom();
if ( m_data->rangeFlags & QwtInterval::ExcludeMinimum )
{
if ( inverted )
from--;
else
to++;
}
if ( m_data->rangeFlags & QwtInterval::ExcludeMaximum )
{
if ( inverted )
to++;
else
from--;
}
if ( m_data->scalePosition == QwtThermo::LeadingScale )
{
scaleDraw()->setAlignment( QwtScaleDraw::RightScale );
scaleDraw()->move( tRect.right() + bw, from );
}
else
{
scaleDraw()->setAlignment( QwtScaleDraw::LeftScale );
scaleDraw()->move( tRect.left() - bw, from );
}
scaleDraw()->setLength( qMax( to - from, 0 ) );
}
if ( update_geometry )
{
updateGeometry();
update();
}
}
QRect QwtThermo::pipeRect() const
{
int mbd = 0;
if ( m_data->scalePosition != QwtThermo::NoScale )
{
int d1, d2;
scaleDraw()->getBorderDistHint( font(), d1, d2 );
mbd = qMax( d1, d2 );
}
const int bw = m_data->borderWidth;
const int scaleOff = bw + mbd;
const QRect cr = contentsRect();
QRect pipeRect = cr;
if ( m_data->orientation == Qt::Horizontal )
{
pipeRect.adjust( scaleOff, 0, -scaleOff, 0 );
if ( m_data->scalePosition == QwtThermo::TrailingScale )
pipeRect.setTop( cr.top() + cr.height() - bw - m_data->pipeWidth );
else
pipeRect.setTop( bw );
pipeRect.setHeight( m_data->pipeWidth );
}
else // Qt::Vertical
{
pipeRect.adjust( 0, scaleOff, 0, -scaleOff );
if ( m_data->scalePosition == QwtThermo::LeadingScale )
pipeRect.setLeft( bw );
else
pipeRect.setLeft( cr.left() + cr.width() - bw - m_data->pipeWidth );
pipeRect.setWidth( m_data->pipeWidth );
}
return pipeRect;
}
void QwtThermo::setOrientation( Qt::Orientation orientation )
{
if ( orientation == m_data->orientation )
return;
m_data->orientation = orientation;
if ( !testAttribute( Qt::WA_WState_OwnSizePolicy ) )
{
QSizePolicy sp = sizePolicy();
sp.transpose();
setSizePolicy( sp );
setAttribute( Qt::WA_WState_OwnSizePolicy, false );
}
layoutThermo( true );
}
Qt::Orientation QwtThermo::orientation() const
{
return m_data->orientation;
}
void QwtThermo::setOriginMode( OriginMode m )
{
if ( m == m_data->originMode )
return;
m_data->originMode = m;
update();
}
QwtThermo::OriginMode QwtThermo::originMode() const
{
return m_data->originMode;
}
void QwtThermo::setOrigin( double origin )
{
if ( origin == m_data->origin )
return;
m_data->origin = origin;
update();
}
double QwtThermo::origin() const
{
return m_data->origin;
}
void QwtThermo::setScalePosition( ScalePosition scalePosition )
{
if ( m_data->scalePosition == scalePosition )
return;
m_data->scalePosition = scalePosition;
if ( testAttribute( Qt::WA_WState_Polished ) )
layoutThermo( true );
}
QwtThermo::ScalePosition QwtThermo::scalePosition() const
{
return m_data->scalePosition;
}
void QwtThermo::scaleChange()
{
layoutThermo( true );
}
void QwtThermo::drawLiquid(
QPainter* painter, const QRect& pipeRect ) const
{
painter->save();
painter->setClipRect( pipeRect, Qt::IntersectClip );
painter->setPen( Qt::NoPen );
const QwtScaleMap scaleMap = scaleDraw()->scaleMap();
QRect liquidRect = fillRect( pipeRect );
if ( m_data->colorMap != NULL )
{
const QwtInterval interval = scaleDiv().interval().normalized();
// Because the positions of the ticks are rounded
// we calculate the colors for the rounded tick values
QVector< double > values = qwtTickList( scaleDraw()->scaleDiv() );
if ( scaleMap.isInverting() )
std::sort( values.begin(), values.end(), std::greater< double >() );
else
std::sort( values.begin(), values.end(), std::less< double >() );
int from;
if ( !values.isEmpty() )
{
from = qRound( scaleMap.transform( values[0] ) );
qwtDrawLine( painter, from,
m_data->colorMap->color( interval, values[0] ),
pipeRect, liquidRect, m_data->orientation );
}
for ( int i = 1; i < values.size(); i++ )
{
const int to = qRound( scaleMap.transform( values[i] ) );
for ( int pos = from + 1; pos < to; pos++ )
{
const double v = scaleMap.invTransform( pos );
qwtDrawLine( painter, pos,
m_data->colorMap->color( interval, v ),
pipeRect, liquidRect, m_data->orientation );
}
qwtDrawLine( painter, to,
m_data->colorMap->color( interval, values[i] ),
pipeRect, liquidRect, m_data->orientation );
from = to;
}
}
else
{
if ( !liquidRect.isEmpty() && m_data->alarmEnabled )
{
const QRect r = alarmRect( liquidRect );
if ( !r.isEmpty() )
{
painter->fillRect( r, palette().brush( QPalette::Highlight ) );
liquidRect = QRegion( liquidRect ).subtracted( r ).boundingRect();
}
}
painter->fillRect( liquidRect, palette().brush( QPalette::ButtonText ) );
}
painter->restore();
}
void QwtThermo::setSpacing( int spacing )
{
if ( spacing <= 0 )
spacing = 0;
if ( spacing != m_data->spacing )
{
m_data->spacing = spacing;
layoutThermo( true );
}
}
int QwtThermo::spacing() const
{
return m_data->spacing;
}
void QwtThermo::setBorderWidth( int width )
{
if ( width <= 0 )
width = 0;
if ( width != m_data->borderWidth )
{
m_data->borderWidth = width;
layoutThermo( true );
}
}
int QwtThermo::borderWidth() const
{
return m_data->borderWidth;
}
void QwtThermo::setColorMap( QwtColorMap* colorMap )
{
if ( colorMap != m_data->colorMap )
{
delete m_data->colorMap;
m_data->colorMap = colorMap;
}
}
QwtColorMap* QwtThermo::colorMap()
{
return m_data->colorMap;
}
const QwtColorMap* QwtThermo::colorMap() const
{
return m_data->colorMap;
}
void QwtThermo::setFillBrush( const QBrush& brush )
{
QPalette pal = palette();
pal.setBrush( QPalette::ButtonText, brush );
setPalette( pal );
}
QBrush QwtThermo::fillBrush() const
{
return palette().brush( QPalette::ButtonText );
}
void QwtThermo::setAlarmBrush( const QBrush& brush )
{
QPalette pal = palette();
pal.setBrush( QPalette::Highlight, brush );
setPalette( pal );
}
QBrush QwtThermo::alarmBrush() const
{
return palette().brush( QPalette::Highlight );
}
void QwtThermo::setAlarmLevel( double level )
{
m_data->alarmLevel = level;
m_data->alarmEnabled = 1;
update();
}
double QwtThermo::alarmLevel() const
{
return m_data->alarmLevel;
}
void QwtThermo::setPipeWidth( int width )
{
if ( width > 0 )
{
m_data->pipeWidth = width;
layoutThermo( true );
}
}
int QwtThermo::pipeWidth() const
{
return m_data->pipeWidth;
}
void QwtThermo::setAlarmEnabled( bool on )
{
m_data->alarmEnabled = on;
update();
}
bool QwtThermo::alarmEnabled() const
{
return m_data->alarmEnabled;
}
QSize QwtThermo::sizeHint() const
{
return minimumSizeHint();
}
QSize QwtThermo::minimumSizeHint() const
{
int w = 0, h = 0;
if ( m_data->scalePosition != NoScale )
{
const int sdExtent = qwtCeil( scaleDraw()->extent( font() ) );
const int sdLength = scaleDraw()->minLength( font() );
w = sdLength;
h = m_data->pipeWidth + sdExtent + m_data->spacing;
}
else // no scale
{
w = 200;
h = m_data->pipeWidth;
}
if ( m_data->orientation == Qt::Vertical )
qSwap( w, h );
w += 2 * m_data->borderWidth;
h += 2 * m_data->borderWidth;
// finally add the margins
const QMargins m = contentsMargins();
w += m.left() + m.right();
h += m.top() + m.bottom();
return QSize( w, h );
}
QRect QwtThermo::fillRect( const QRect& pipeRect ) const
{
double origin;
if ( m_data->originMode == OriginMinimum )
{
origin = qMin( lowerBound(), upperBound() );
}
else if ( m_data->originMode == OriginMaximum )
{
origin = qMax( lowerBound(), upperBound() );
}
else // OriginCustom
{
origin = m_data->origin;
}
const QwtScaleMap scaleMap = scaleDraw()->scaleMap();
int from = qRound( scaleMap.transform( m_data->value ) );
int to = qRound( scaleMap.transform( origin ) );
if ( to < from )
qSwap( from, to );
QRect fillRect = pipeRect;
if ( m_data->orientation == Qt::Horizontal )
{
fillRect.setLeft( from );
fillRect.setRight( to );
}
else // Qt::Vertical
{
fillRect.setTop( from );
fillRect.setBottom( to );
}
return fillRect.normalized();
}
QRect QwtThermo::alarmRect( const QRect& fillRect ) const
{
QRect alarmRect( 0, 0, -1, -1); // something invalid
if ( !m_data->alarmEnabled )
return alarmRect;
const bool inverted = ( upperBound() < lowerBound() );
bool increasing;
if ( m_data->originMode == OriginCustom )
{
increasing = m_data->value > m_data->origin;
}
else
{
increasing = m_data->originMode == OriginMinimum;
}
const QwtScaleMap map = scaleDraw()->scaleMap();
const int alarmPos = qRound( map.transform( m_data->alarmLevel ) );
const int valuePos = qRound( map.transform( m_data->value ) );
if ( m_data->orientation == Qt::Horizontal )
{
int v1, v2;
if ( inverted )
{
v1 = fillRect.left();
v2 = alarmPos - 1;
v2 = qMin( v2, increasing ? fillRect.right() : valuePos );
}
else
{
v1 = alarmPos + 1;
v1 = qMax( v1, increasing ? fillRect.left() : valuePos );
v2 = fillRect.right();
}
alarmRect.setRect( v1, fillRect.top(), v2 - v1 + 1, fillRect.height() );
}
else
{
int v1, v2;
if ( inverted )
{
v1 = alarmPos + 1;
v1 = qMax( v1, increasing ? fillRect.top() : valuePos );
v2 = fillRect.bottom();
}
else
{
v1 = fillRect.top();
v2 = alarmPos - 1;
v2 = qMin( v2, increasing ? fillRect.bottom() : valuePos );
}
alarmRect.setRect( fillRect.left(), v1, fillRect.width(), v2 - v1 + 1 );
}
return alarmRect;
}
#include "moc_qwt_thermo.cpp"
QList< double >
QVector< double >
QwtAbstractScaleDraw::scaleMap
const QwtScaleMap & scaleMap() const
Definition qwt_abstract_scale_draw.cpp:121
QwtAbstractScaleDraw::draw
virtual void draw(QPainter *, const QPalette &) const
Draw the scale.
Definition qwt_abstract_scale_draw.cpp:169
QwtAbstractScale
An abstract base class for widgets having a scale.
Definition qwt_abstract_scale.h:37
QwtAbstractScale::scaleMap
const QwtScaleMap & scaleMap() const
Definition qwt_abstract_scale.cpp:357
QwtAbstractScale::lowerBound
double lowerBound() const
Definition qwt_abstract_scale.cpp:88
QwtAbstractScale::abstractScaleDraw
const QwtAbstractScaleDraw * abstractScaleDraw() const
Definition qwt_abstract_scale.cpp:302
QwtAbstractScale::scaleDiv
const QwtScaleDiv & scaleDiv() const
Definition qwt_abstract_scale.cpp:349
QwtAbstractScale::setAbstractScaleDraw
void setAbstractScaleDraw(QwtAbstractScaleDraw *)
Set a scale draw.
Definition qwt_abstract_scale.cpp:277
QwtAbstractScale::upperBound
double upperBound() const
Definition qwt_abstract_scale.cpp:111
QwtColorMap
QwtColorMap is used to map values into colors.
Definition qwt_color_map.h:38
QwtColorMap::color
QColor color(const QwtInterval &, double value) const
Definition qwt_color_map.h:248
QwtInterval
A class representing an interval.
Definition qwt_interval.h:23
QwtInterval::minValue
double minValue() const
Definition qwt_interval.h:192
QwtInterval::normalized
QwtInterval normalized() const
Normalize the limits of the interval.
Definition qwt_interval.cpp:29
QwtInterval::ExcludeMaximum
@ ExcludeMaximum
Max value is not included in the interval.
Definition qwt_interval.h:38
QwtInterval::ExcludeMinimum
@ ExcludeMinimum
Min value is not included in the interval.
Definition qwt_interval.h:35
QwtInterval::IncludeBorders
@ IncludeBorders
Min/Max values are inside the interval.
Definition qwt_interval.h:32
QwtInterval::maxValue
double maxValue() const
Definition qwt_interval.h:198
QwtInterval::BorderFlags
QFlags< BorderFlag > BorderFlags
Border flags.
Definition qwt_interval.h:45
QwtScaleDiv
A class representing a scale division.
Definition qwt_scale_div.h:34
QwtScaleDiv::interval
QwtInterval interval() const
Definition qwt_scale_div.cpp:111
QwtScaleDiv::ticks
QList< double > ticks(int tickType) const
Definition qwt_scale_div.cpp:309
QwtScaleDiv::MinorTick
@ MinorTick
Minor ticks.
Definition qwt_scale_div.h:43
QwtScaleDiv::NTickTypes
@ NTickTypes
Number of valid tick types.
Definition qwt_scale_div.h:52
QwtScaleDraw
A class for drawing scales.
Definition qwt_scale_draw.h:36
QwtScaleDraw::setLength
void setLength(double length)
Definition qwt_scale_draw.cpp:732
QwtScaleDraw::move
void move(double x, double y)
Definition qwt_scale_draw.h:118
QwtScaleDraw::getBorderDistHint
void getBorderDistHint(const QFont &, int &start, int &end) const
Determine the minimum border distance.
Definition qwt_scale_draw.cpp:361
QwtScaleDraw::minLength
int minLength(const QFont &) const
Definition qwt_scale_draw.cpp:560
QwtScaleDraw::setAlignment
void setAlignment(Alignment)
Definition qwt_scale_draw.cpp:322
QwtScaleDraw::BottomScale
@ BottomScale
The scale is below.
Definition qwt_scale_draw.h:45
QwtScaleDraw::TopScale
@ TopScale
The scale is above.
Definition qwt_scale_draw.h:48
QwtScaleDraw::RightScale
@ RightScale
The scale is right.
Definition qwt_scale_draw.h:54
QwtScaleDraw::LeftScale
@ LeftScale
The scale is left.
Definition qwt_scale_draw.h:51
QwtScaleMap
A scale map.
Definition qwt_scale_map.h:27
QwtScaleMap::isInverting
bool isInverting() const
Definition qwt_scale_map.h:164
QwtScaleMap::transform
double transform(double s) const
Definition qwt_scale_map.h:137
QwtScaleMap::invTransform
double invTransform(double p) const
Definition qwt_scale_map.h:154
QwtThermo
The Thermometer Widget.
Definition qwt_thermo.h:47
QwtThermo::setOrigin
void setOrigin(double)
Specifies the custom origin.
Definition qwt_thermo.cpp:491
QwtThermo::setScalePosition
void setScalePosition(ScalePosition)
Change the position of the scale.
Definition qwt_thermo.cpp:515
QwtThermo::setAlarmEnabled
void setAlarmEnabled(bool)
Enable or disable the alarm threshold.
Definition qwt_thermo.cpp:825
QwtThermo::setAlarmLevel
void setAlarmLevel(double)
Definition qwt_thermo.cpp:775
QwtThermo::resizeEvent
virtual void resizeEvent(QResizeEvent *) override
Definition qwt_thermo.cpp:267
QwtThermo::pipeRect
QRect pipeRect() const
Definition qwt_thermo.cpp:385
QwtThermo::spacing
int spacing() const
Definition qwt_thermo.cpp:645
QwtThermo::QwtThermo
QwtThermo(QWidget *parent=NULL)
Definition qwt_thermo.cpp:121
QwtThermo::setValue
virtual void setValue(double)
Definition qwt_thermo.cpp:181
QwtThermo::setPipeWidth
void setPipeWidth(int)
Definition qwt_thermo.cpp:800
QwtThermo::scaleDraw
const QwtScaleDraw * scaleDraw() const
Definition qwt_thermo.cpp:217
QwtThermo::setAlarmBrush
void setAlarmBrush(const QBrush &)
Specify the liquid brush above the alarm threshold.
Definition qwt_thermo.cpp:747
QwtThermo::ScalePosition
ScalePosition
Definition qwt_thermo.h:74
QwtThermo::NoScale
@ NoScale
The slider has no scale.
Definition qwt_thermo.h:76
QwtThermo::TrailingScale
@ TrailingScale
The scale is left of a vertical or above of a horizontal slider.
Definition qwt_thermo.h:82
QwtThermo::LeadingScale
@ LeadingScale
The scale is right of a vertical or below of a horizontal slider.
Definition qwt_thermo.h:79
QwtThermo::pipeWidth
int pipeWidth() const
Definition qwt_thermo.cpp:813
QwtThermo::origin
double origin() const
Definition qwt_thermo.cpp:504
QwtThermo::paintEvent
virtual void paintEvent(QPaintEvent *) override
Definition qwt_thermo.cpp:235
QwtThermo::setSpacing
void setSpacing(int)
Change the spacing between pipe and scale.
Definition qwt_thermo.cpp:629
QwtThermo::fillBrush
QBrush fillBrush() const
Definition qwt_thermo.cpp:731
QwtThermo::setBorderWidth
void setBorderWidth(int)
Definition qwt_thermo.cpp:655
QwtThermo::setScaleDraw
void setScaleDraw(QwtScaleDraw *)
Set a scale draw.
Definition qwt_thermo.cpp:207
QwtThermo::colorMap
QwtColorMap * colorMap()
Definition qwt_thermo.cpp:697
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::OriginCustom
@ OriginCustom
The origin is specified using the origin() property.
Definition qwt_thermo.h:100
QwtThermo::OriginMinimum
@ OriginMinimum
The origin is the minimum of the scale.
Definition qwt_thermo.h:94
QwtThermo::setOriginMode
void setOriginMode(OriginMode)
Change how the origin is determined.
Definition qwt_thermo.cpp:464
QwtThermo::rangeFlags
QwtInterval::BorderFlags rangeFlags() const
Definition qwt_thermo.cpp:170
QwtThermo::value
double value() const
Return the value.
Definition qwt_thermo.cpp:191
QwtThermo::alarmBrush
QBrush alarmBrush() const
Definition qwt_thermo.cpp:761
QwtThermo::setRangeFlags
void setRangeFlags(QwtInterval::BorderFlags)
Exclude/Include min/max values.
Definition qwt_thermo.cpp:157
QwtThermo::changeEvent
virtual void changeEvent(QEvent *) override
Definition qwt_thermo.cpp:277
QwtThermo::fillRect
QRect fillRect(const QRect &) const
Calculate the filled rectangle of the pipe.
Definition qwt_thermo.cpp:897
QwtThermo::minimumSizeHint
virtual QSize minimumSizeHint() const override
Definition qwt_thermo.cpp:856
QwtThermo::drawLiquid
virtual void drawLiquid(QPainter *, const QRect &) const
Definition qwt_thermo.cpp:546
QwtThermo::setFillBrush
void setFillBrush(const QBrush &)
Change the brush of the liquid.
Definition qwt_thermo.cpp:720
QwtThermo::~QwtThermo
virtual ~QwtThermo()
Destructor.
Definition qwt_thermo.cpp:137
QwtThermo::setColorMap
void setColorMap(QwtColorMap *)
Assign a color map for the fill color.
Definition qwt_thermo.cpp:683
QwtThermo::borderWidth
int borderWidth() const
Definition qwt_thermo.cpp:671
QwtThermo::alarmEnabled
bool alarmEnabled() const
Definition qwt_thermo.cpp:837
QwtThermo::orientation
Qt::Orientation orientation() const
Definition qwt_thermo.cpp:455
QwtThermo::originMode
OriginMode originMode() const
Definition qwt_thermo.cpp:477
QwtThermo::setOrientation
void setOrientation(Qt::Orientation)
Set the orientation.
Definition qwt_thermo.cpp:432
QwtThermo::scalePosition
ScalePosition scalePosition() const
Definition qwt_thermo.cpp:530
QwtThermo::alarmRect
QRect alarmRect(const QRect &) const
Calculate the alarm rectangle of the pipe.
Definition qwt_thermo.cpp:944
QwtThermo::scaleChange
virtual void scaleChange() override
Notify a scale change.
Definition qwt_thermo.cpp:536
QwtThermo::alarmLevel
double alarmLevel() const
Definition qwt_thermo.cpp:789
QwtThermo::sizeHint
virtual QSize sizeHint() const override
Definition qwt_thermo.cpp:846