Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

QwtThermo Class Reference

Inheritance diagram for QwtThermo:

QwtScaleIf List of all members.

Detailed Description

The Thermometer Widget.


Public Types

enum  ScalePos {
  None,
  Left,
  Right,
  Top,
  Bottom
}

Public Member Functions

 QwtThermo (QWidget *parent=0, const char *name=0)
virtual ~QwtThermo ()
void setOrientation (Qt::Orientation o, ScalePos s)
void setBorderWidth (int w)
void setFillColor (const QColor &c)
void setAlarmColor (const QColor &c)
void setAlarmLevel (double v)
void setAlarmEnabled (int tf)
void setPipeWidth (int w)
void setRange (double vmin, double vmax)
void setMargin (int m)
double maxValue ()
double minValue ()
double value ()
virtual QSize sizeHint () const
virtual QSize minimumSizeHint () const
virtual QSizePolicy sizePolicy () const
void setValue (double val)

Protected Member Functions

void draw (QPainter *p, const QRect &update_rect)
void drawThermo (QPainter *p)
void layoutThermo (bool update=TRUE)
virtual void scaleChange ()
virtual void fontChange (const QFont &oldFont)
virtual void paintEvent (QPaintEvent *e)
virtual void resizeEvent (QResizeEvent *e)


Member Enumeration Documentation

enum QwtThermo::ScalePos
 

Position of the scale

See also:
QwtThermo;;QwtThermo


Constructor & Destructor Documentation

QwtThermo::QwtThermo QWidget *  parent = 0,
const char *  name = 0
 

Constructor.

QwtThermo::~QwtThermo  )  [virtual]
 

Destructor.


Member Function Documentation

void QwtThermo::draw QPainter *  p,
const QRect &  update_rect
[protected]
 

redraw the thermo

void QwtThermo::drawThermo QPainter *  p  )  [protected]
 

Redraw the thermometer.

void QwtThermo::fontChange const QFont &  oldFont  )  [protected, virtual]
 

notify changed font

void QwtThermo::layoutThermo bool  update = TRUE  )  [protected]
 

Recalculate the thermo's geometry and layout based on.

double QwtThermo::maxValue  ) 
 

Return max value.

QSize QwtThermo::minimumSizeHint  )  const [virtual]
 

Return a minimum size hint.

Warning:
The return value depends on the font and the scale.
See also:
QwtThermo::sizeHint

double QwtThermo::minValue  ) 
 

Return min value.

void QwtThermo::paintEvent QPaintEvent *  e  )  [protected, virtual]
 

Qt paint event.

void QwtThermo::resizeEvent QResizeEvent *  e  )  [protected, virtual]
 

Qt resize event handler.

void QwtThermo::scaleChange  )  [protected, virtual]
 

notify changed scale

Implements QwtScaleIf.

void QwtThermo::setAlarmColor const QColor &  c  ) 
 

Specify liquid color above the alarm threshold.

Parameters:
c New color. The default is white.

void QwtThermo::setAlarmEnabled int  tf  ) 
 

Enable or disable alarm threshold.

Parameters:
tf ZERO (disabled) or non-zero (enabled)

void QwtThermo::setAlarmLevel double  v  ) 
 

Specify the alarm threshold.

void QwtThermo::setBorderWidth int  w  ) 
 

Set the border width of the pipe.

void QwtThermo::setFillColor const QColor &  c  ) 
 

Change the color of the liquid.

Parameters:
c New color. The default color is black.

void QwtThermo::setMargin int  m  ) 
 

Specify the distance between the pipe's endpoints and the widget's border.

The margin is used to leave some space for the scale labels. If a large font is used, it is advisable to adjust the margins.

Parameters:
m New Margin. The default values are 10 for horizontal orientation and 20 for vertical orientation.
Warning:
The margin has no effect if the scale is disabled.

This function is a NOOP because margins are determined automatically.

void QwtThermo::setOrientation Qt::Orientation  o,
ScalePos  s
 

Change the thermometer's orientation.

The scale position None disables the scale.

Parameters:
o orientation. Possible values are Qt::Horizontal and Qt::Vertical. The default value is Qt::Vertical.
s Position of the scale. For a horizontal orientation, the scale position can be Top, Bottom or None. A vertical thermometer may have the scale positions Left, Right or None. The default is None.

void QwtThermo::setPipeWidth int  w  ) 
 

Change the width of the pipe.

void QwtThermo::setRange double  vmin,
double  vmax
 

Set the range.

Parameters:
vmin Value corresponding lower or left end of the thermometer
vmax Value corresponding to the upper or right end of the thermometer

void QwtThermo::setValue double  val  ) 
 

Set the current value.

QSize QwtThermo::sizeHint  )  const [virtual]
 

Returns:
the minimum size hint
See also:
QwtThermo::minimumSizeHint

QSizePolicy QwtThermo::sizePolicy  )  const [virtual]
 

Returns:
Fixed/MinimumExpanding for vertical, MinimumExpanding/Fixed for horizontal thermos.

double QwtThermo::value  ) 
 

Return value.


Generated on Tue Nov 25 21:15:09 2003 for Qwt User's Guide by doxygen 1.3.4