📄 qwtthermo.3
字号:
.TH "QwtThermo" 3 "16 Nov 2004" "Version 4.2.0" "Qwt User's Guide" \" -*- nroff -*-.ad l.nh.SH NAMEQwtThermo \- .SH SYNOPSIS.br.PPInherits \fBQwtScaleIf\fP..PP.SH "Detailed Description".PP The Thermometer Widget. QwtThermo is a widget which displays a value in an interval. It supports:.IP "\(bu" 2a horizontal or vertical layout;.IP "\(bu" 2a range;.IP "\(bu" 2a scale;.IP "\(bu" 2an alarm level..PP.PPBy default, the scale and range run over the same interval of values. \fBQwtScaleIf::setScale()\fP changes the interval of the scale and allows easy conversion between physical units. The example shows how to make the scale indicate in degrees Fahrenheit and to set the value in degrees Kelvin: .PP.nf#include <qapplication.h>#include <qwt_thermo.h>double Kelvin2Fahrenheit(double kelvin){ // see http://en.wikipedia.org/wiki/Kelvin return 1.8*kelvin - 459.67;}int main(int argc, char **argv){ const double minKelvin = 0.0; const double maxKelvin = 500.0; QApplication a(argc, argv); QwtThermo t; t.setRange(minKelvin, maxKelvin); t.setScale(Kelvin2Fahrenheit(minKelvin), Kelvin2Fahrenheit(maxKelvin)); // set the value in Kelvin but the scale displays in Fahrenheit // 273.15 Kelvin = 0 Celsius = 32 Fahrenheit t.setValue(273.15); a.setMainWidget(&t); t.show(); return a.exec();}.fi.PP.PP\fBTodo\fP.RS 4Improve the support for a logarithmic range and/or scale. .RE.PP.PPDefinition at line 67 of file qwt_thermo.h..SS "Public Types".in +1c.ti -1c.RI "enum \fBScalePos\fP { \fBNone\fP, \fBLeft\fP, \fBRight\fP, \fBTop\fP, \fBBottom\fP }".br.in -1c.SS "Public Slots".in +1c.ti -1c.RI "void \fBsetValue\fP (double val)".br.in -1c.SS "Public Member Functions".in +1c.ti -1c.RI "\fBQwtThermo\fP (QWidget *parent=0, const char *name=0)".br.ti -1c.RI "virtual \fB~QwtThermo\fP ()".br.ti -1c.RI "void \fBsetOrientation\fP (Qt::Orientation o, ScalePos s)".br.ti -1c.RI "void \fBsetScalePosition\fP (ScalePos s)".br.ti -1c.RI "ScalePos \fBscalePosition\fP () const".br.ti -1c.RI "void \fBsetBorderWidth\fP (int w)".br.ti -1c.RI "int \fBborderWidth\fP () const".br.ti -1c.RI "void \fBsetFillBrush\fP (const QBrush &b)".br.ti -1c.RI "const QBrush & \fBfillBrush\fP () const".br.ti -1c.RI "void \fBsetFillColor\fP (const QColor &c)".br.ti -1c.RI "const QColor & \fBfillColor\fP () const".br.ti -1c.RI "void \fBsetAlarmBrush\fP (const QBrush &b)".br.ti -1c.RI "const QBrush & \fBalarmBrush\fP () const".br.ti -1c.RI "void \fBsetAlarmColor\fP (const QColor &c)".br.ti -1c.RI "const QColor & \fBalarmColor\fP () const".br.ti -1c.RI "void \fBsetAlarmLevel\fP (double v)".br.ti -1c.RI "double \fBalarmLevel\fP () const".br.ti -1c.RI "void \fBsetAlarmEnabled\fP (bool tf)".br.ti -1c.RI "bool \fBalarmEnabled\fP () const".br.ti -1c.RI "void \fBsetPipeWidth\fP (int w)".br.ti -1c.RI "int \fBpipeWidth\fP () const".br.ti -1c.RI "void \fBsetMaxValue\fP (double v)".br.ti -1c.RI "double \fBmaxValue\fP () const".br.ti -1c.RI "void \fBsetMinValue\fP (double v)".br.ti -1c.RI "double \fBminValue\fP () const".br.ti -1c.RI "double \fBvalue\fP () const".br.ti -1c.RI "void \fBsetRange\fP (double vmin, double vmax, bool lg=FALSE)".br.ti -1c.RI "void \fBsetMargin\fP (int m)".br.ti -1c.RI "virtual QSize \fBsizeHint\fP () const".br.ti -1c.RI "virtual QSize \fBminimumSizeHint\fP () const".br.ti -1c.RI "virtual QSizePolicy \fBsizePolicy\fP () const".br.in -1c.SS "Protected Member Functions".in +1c.ti -1c.RI "void \fBdraw\fP (QPainter *p, const QRect &update_rect)".br.ti -1c.RI "void \fBdrawThermo\fP (QPainter *p)".br.ti -1c.RI "void \fBlayoutThermo\fP (bool update=TRUE)".br.ti -1c.RI "virtual void \fBscaleChange\fP ()".br.ti -1c.RI "virtual void \fBfontChange\fP (const QFont &oldFont)".br.ti -1c.RI "virtual void \fBpaintEvent\fP (QPaintEvent *e)".br.ti -1c.RI "virtual void \fBresizeEvent\fP (QResizeEvent *e)".br.in -1c.SH "Constructor & Destructor Documentation".PP .SS "QwtThermo::QwtThermo (QWidget * parent = \fC0\fP, const char * name = \fC0\fP)".PPConstructor. .PPDefinition at line 20 of file qwt_thermo.cpp..SS "QwtThermo::~\fBQwtThermo\fP ()\fC [virtual]\fP".PPDestructor. .PPDefinition at line 27 of file qwt_thermo.cpp..SH "Member Function Documentation".PP .SS "const QBrush & QwtThermo::alarmBrush () const".PPReturn the liquid brush above the alarm threshold. .PPDefinition at line 529 of file qwt_thermo.cpp..SS "const QColor & QwtThermo::alarmColor () const".PPReturn the liquid color above the alarm threshold. .PPDefinition at line 545 of file qwt_thermo.cpp..SS "bool QwtThermo::alarmEnabled () const".PPReturn if the alarm threshold is enabled or disabled. .PPDefinition at line 611 of file qwt_thermo.cpp..SS "double QwtThermo::alarmLevel () const".PPReturn the alarm threshold. .PPDefinition at line 559 of file qwt_thermo.cpp..SS "int QwtThermo::borderWidth () const".PPReturn the border width of the thermometer pipe. .PPDefinition at line 457 of file qwt_thermo.cpp..SS "void QwtThermo::draw (QPainter * p, const QRect & update_rect)\fC [protected]\fP".PPDraw the whole QwtThermo. .PPDefinition at line 80 of file qwt_thermo.cpp..PPReferences QwtScaleDraw::draw(), drawThermo(), and QwtScaleIf::scaleDraw()..PPReferenced by paintEvent()..SS "void QwtThermo::drawThermo (QPainter * p)\fC [protected]\fP".PPRedraw the liquid in thermometer pipe. .PPDefinition at line 288 of file qwt_thermo.cpp..PPReferences QwtDiMap::limTransform()..PPReferenced by draw()..SS "const QBrush & QwtThermo::fillBrush () const".PPReturn the liquid brush. .PPDefinition at line 497 of file qwt_thermo.cpp..SS "const QColor & QwtThermo::fillColor () const".PPReturn the liquid color. .PPDefinition at line 513 of file qwt_thermo.cpp..SS "void QwtThermo::fontChange (const QFont & oldFont)\fC [protected, virtual]\fP".PPNotify a font change. .PPDefinition at line 274 of file qwt_thermo.cpp..PPReferences layoutThermo()..SS "void QwtThermo::layoutThermo (bool update_geometry = \fCTRUE\fP)\fC [protected]\fP".PPRecalculate the QwtThermo geometry and layout based on the QwtThermo::rect() and the fonts. .PP\fBParameters:\fP.RS 4\fIupdate_geometry\fP notify the layout system and call update to redraw the scale .RE.PPDefinition at line 109 of file qwt_thermo.cpp..PPReferences QwtScaleDraw::minBorderDist(), QwtScaleIf::scaleDraw(), QwtScaleDraw::setGeometry(), and QwtDiMap::setIntRange()..PPReferenced by fontChange(), resizeEvent(), scaleChange(), setBorderWidth(), setOrientation(), setPipeWidth(), and setRange()..SS "double QwtThermo::maxValue () const".PPReturn the maximum value. .PPDefinition at line 133 of file qwt_thermo.h..SS "QSize QwtThermo::minimumSizeHint () const\fC [virtual]\fP".PPReturn a minimum size hint. .PP\fBWarning:\fP.RS 4The return value depends on the font and the scale. .RE.PP\fBSee also:\fP.RS 4\fBQwtThermo::sizeHint\fP .RE.PPDefinition at line 652 of file qwt_thermo.cpp..PPReferences QwtScaleDraw::minHeight(), QwtScaleDraw::minWidth(), and QwtScaleIf::scaleDraw()..PPReferenced by sizeHint()..SS "double QwtThermo::minValue () const".PPReturn the minimum value. .PPDefinition at line 138 of file qwt_thermo.h..SS "void QwtThermo::paintEvent (QPaintEvent * e)\fC [protected, virtual]\fP".PPQt paint event. .PPDefinition at line 68 of file qwt_thermo.cpp..PPReferences draw(), and QwtPaintBuffer::painter()..SS "int QwtThermo::pipeWidth () const".PPReturn the width of the pipe. .PPDefinition at line 575 of file qwt_thermo.cpp..SS "void QwtThermo::resizeEvent (QResizeEvent * e)\fC [protected, virtual]\fP".PPQt resize event handler. .PPDefinition at line 98 of file qwt_thermo.cpp..PPReferences layoutThermo()..SS "void QwtThermo::scaleChange ()\fC [protected, virtual]\fP".PPNotify a scale change. .PPImplements \fBQwtScaleIf\fP..PPDefinition at line 281 of file qwt_thermo.cpp..PPReferences layoutThermo()..PPReferenced by setRange()..SS "QwtThermo::ScalePos QwtThermo::scalePosition () const".PPReturn the scale position. .PPDefinition at line 268 of file qwt_thermo.cpp..SS "void QwtThermo::setAlarmBrush (const QBrush & b)".PPSpecify the liquid brush above the alarm threshold. .PP\fBParameters:\fP.RS 4\fIc\fP New brush. The default is solid white. .RE.PPDefinition at line 522 of file qwt_thermo.cpp..SS "void QwtThermo::setAlarmColor (const QColor & c)".PPSpecify the liquid color above the alarm threshold. .PP\fBParameters:\fP.RS 4\fIc\fP New color. The default is white. .RE.PPDefinition at line 538 of file qwt_thermo.cpp..SS "void QwtThermo::setAlarmEnabled (bool tf)".PPEnable or disable the alarm threshold. .PP\fBParameters:\fP.RS 4\fItf\fP TRUE (disabled) or FALSE (enabled) .RE.PPDefinition at line 604 of file qwt_thermo.cpp..SS "void QwtThermo::setAlarmLevel (double v)".PPSpecify the alarm threshold. .PPDefinition at line 551 of file qwt_thermo.cpp..SS "void QwtThermo::setBorderWidth (int w)".PPSet the border width of the pipe. .PPDefinition at line 446 of file qwt_thermo.cpp..PPReferences layoutThermo()..SS "void QwtThermo::setFillBrush (const QBrush & b)".PPChange the brush of the liquid. .PP\fBParameters:\fP.RS 4\fIc\fP New brush. The default brush is solid black. .RE.PPDefinition at line 490 of file qwt_thermo.cpp..SS "void QwtThermo::setFillColor (const QColor & c)".PPChange the color of the liquid. .PP\fBParameters:\fP.RS 4\fIc\fP New color. The default color is black. .RE.PPDefinition at line 506 of file qwt_thermo.cpp..SS "void QwtThermo::setMargin (int m)".PPSpecify the distance between the pipe's endpoints and the widget's border. .PPThe margin is used to leave some space for the scale labels. If a large font is used, it is advisable to adjust the margins. .PP\fBParameters:\fP.RS 4\fIm\fP New Margin. The default values are 10 for horizontal orientation and 20 for vertical orientation. .RE.PP\fBWarning:\fP.RS 4The margin has no effect if the scale is disabled. .PPThis function is a NOOP because margins are determined automatically. .RE.PPDefinition at line 595 of file qwt_thermo.cpp..SS "void QwtThermo::setMaxValue (double v)".PPSet the maximum value. .PPDefinition at line 131 of file qwt_thermo.h..SS "void QwtThermo::setMinValue (double v)".PPSet the minimum value. .PPDefinition at line 136 of file qwt_thermo.h..SS "void QwtThermo::setOrientation (Qt::Orientation o, ScalePos s)".PPSet the thermometer orientation and the scale position. .PPThe scale position None disables the scale. .PP\fBParameters:\fP.RS 4\fIo\fP orientation. Possible values are Qt::Horizontal and Qt::Vertical. The default value is Qt::Vertical. .br\fIs\fP Position of the scale. The default value is None..RE.PPA valid combination of scale position and orientation is enforced:.IP "\(bu" 2a horizontal thermometer can have the scale positions Top, Bottom or None;.IP "\(bu" 2a vertical thermometer can have the scale positions Left, Right or None;.IP "\(bu" 2an invalid scale position will default to None..PP.PP\fBSee also:\fP.RS 4\fBQwtThermo::setScalePosition()\fP .RE.PPDefinition at line 220 of file qwt_thermo.cpp..PPReferences layoutThermo()..PPReferenced by setScalePosition()..SS "void QwtThermo::setPipeWidth (int w)".PPChange the width of the pipe. .PPDefinition at line 565 of file qwt_thermo.cpp..PPReferences layoutThermo()..SS "void QwtThermo::setRange (double vmin, double vmax, bool logarithmic = \fCFALSE\fP)".PPSet the range. .PP\fBParameters:\fP.RS 4\fIvmin\fP value corresponding lower or left end of the thermometer .br\fIvmax\fP value corresponding to the upper or right end of the thermometer .br\fIlogarithmic\fP logarithmic mapping, TRUE or FALSE .RE.PPDefinition at line 468 of file qwt_thermo.cpp..PPReferences QwtScaleIf::hasUserScale(), layoutThermo(), scaleChange(), QwtScaleDraw::scaleDiv(), QwtScaleIf::scaleDraw(), QwtScaleIf::scaleMaxMajor(), QwtScaleIf::scaleMaxMinor(), QwtDiMap::setDblRange(), and QwtScaleDraw::setScale()..SS "void QwtThermo::setScalePosition (ScalePos s)".PPChange the scale position (and thermometer orientation). .PP\fBParameters:\fP.RS 4\fIs\fP Position of the scale..RE.PPA valid combination of scale position and orientation is enforced:.IP "\(bu" 2if the new scale position is Left or Right, the scale orientation will become Qt::Vertical;.IP "\(bu" 2if the new scale position is Bottom or Top, the scale orientation will become Qt::Horizontal;.IP "\(bu" 2if the new scale position is None, the scale orientation will not change..PP.PP\fBSee also:\fP.RS 4\fBQwtThermo::setOrientation()\fP .RE.PPDefinition at line 257 of file qwt_thermo.cpp..PPReferences setOrientation()..SS "void QwtThermo::setValue (double val)\fC [slot]\fP".PPSet the current value. .PPDefinition at line 58 of file qwt_thermo.cpp..SS "QSize QwtThermo::sizeHint () const\fC [virtual]\fP".PP\fBReturns:\fP.RS 4the minimum size hint .RE.PP\fBSee also:\fP.RS 4\fBQwtThermo::minimumSizeHint\fP .RE.PPDefinition at line 642 of file qwt_thermo.cpp..PPReferences minimumSizeHint()..SS "QSizePolicy QwtThermo::sizePolicy () const\fC [virtual]\fP".PP\fBReturns:\fP.RS 4Fixed/MinimumExpanding for vertical, MinimumExpanding/Fixed for horizontal thermos. .RE.PPDefinition at line 621 of file qwt_thermo.cpp..PPReferences QwtScaleDraw::orientation(), and QwtScaleIf::scaleDraw()..SS "double QwtThermo::value () const".PPReturn the value. .PPDefinition at line 141 of file qwt_thermo.h..SH "Author".PP Generated automatically by Doxygen for Qwt User's Guide from the source code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -