📄 qwtdial.3
字号:
.TH "QwtDial" 3 "16 Nov 2004" "Version 4.2.0" "Qwt User's Guide" \" -*- nroff -*-.ad l.nh.SH NAMEQwtDial \- .SH SYNOPSIS.br.PPInherits \fBQwtSliderBase\fP..PPInherited by \fBQwtAnalogClock\fP, and \fBQwtCompass\fP..PP.SH "Detailed Description".PP QwtDial class provides a rounded range control. QwtDial is intended as base class for dial widgets like speedometers, compass widgets, clocks ....PP.PPA dial contains a scale and a needle indicating the current value of the dial. Depending on Mode one of them is fixed and the other is rotating. If not \fBisReadOnly()\fP the dial can be rotated by dragging the mouse or using keyboard inputs (see \fBkeyPressEvent()\fP). A dial might be wrapping, what means a rotation below/above one limit continues on the other limit (f.e compass). The scale might cover any arc of the dial, its values are related to the \fBorigin()\fP of the dial..PPQwt is missing a set of good looking needles (\fBQwtDialNeedle\fP). Contributions are very welcome..PP\fBSee also:\fP.RS 4\fBQwtCompass\fP, \fBQwtAnalogClock\fP, \fBQwtDialNeedle\fP .RE.PP\fBNote:\fP.RS 4The examples/dials example shows different types of dials. .RE.PP.PPDefinition at line 72 of file qwt_dial.h..SS "Public Types".in +1c.ti -1c.RI "enum \fBShadow\fP { \fBPlain\fP = QFrame::Plain, \fBRaised\fP = QFrame::Raised, \fBSunken\fP = QFrame::Sunken }".br.ti -1c.RI "enum \fBScaleOptions\fP { \fBScaleBackbone\fP = 1, \fBScaleTicks\fP = 2, \fBScaleLabel\fP = 4 }".br.ti -1c.RI "enum \fBMode\fP { \fBRotateNeedle\fP, \fBRotateScale\fP }".br.in -1c.SS "Public Member Functions".in +1c.ti -1c.RI "\fBQwtDial\fP (QWidget *parent=0, const char *name=0)".br.ti -1c.RI "virtual \fB~QwtDial\fP ()".br.ti -1c.RI "void \fBsetFrameShadow\fP (\fBShadow\fP)".br.ti -1c.RI "\fBShadow\fP \fBframeShadow\fP () const".br.ti -1c.RI "bool \fBhasVisibleBackground\fP () const".br.ti -1c.RI "void \fBshowBackground\fP (bool)".br.ti -1c.RI "void \fBsetLineWidth\fP (int)".br.ti -1c.RI "int \fBlineWidth\fP () const".br.ti -1c.RI "void \fBsetMode\fP (\fBMode\fP)".br.ti -1c.RI "\fBMode\fP \fBmode\fP () const".br.ti -1c.RI "virtual void \fBsetWrapping\fP (bool)".br.ti -1c.RI "bool \fBwrapping\fP () const".br.ti -1c.RI "virtual void \fBsetScale\fP (int maxMajIntv, int maxMinIntv, double step=0.0)".br.ti -1c.RI "void \fBsetScaleArc\fP (double min, double max)".br.ti -1c.RI "void \fBsetScaleOptions\fP (int)".br.ti -1c.RI "void \fBsetScaleTicks\fP (int minLen, int medLen, int majLen, int penWidth=1)".br.ti -1c.RI "double \fBminScaleArc\fP () const".br.ti -1c.RI "double \fBmaxScaleArc\fP () const".br.ti -1c.RI "virtual void \fBsetOrigin\fP (double)".br.ti -1c.RI "double \fBorigin\fP () const".br.ti -1c.RI "virtual void \fBsetNeedle\fP (\fBQwtDialNeedle\fP *)".br.ti -1c.RI "const \fBQwtDialNeedle\fP * \fBneedle\fP () const".br.ti -1c.RI "\fBQwtDialNeedle\fP * \fBneedle\fP ()".br.ti -1c.RI "QRect \fBboundingRect\fP () const".br.ti -1c.RI "QRect \fBcontentsRect\fP () const".br.ti -1c.RI "virtual QRect \fBscaleContentsRect\fP () const".br.ti -1c.RI "virtual QSize \fBsizeHint\fP () const".br.ti -1c.RI "virtual QSize \fBminimumSizeHint\fP () const".br.ti -1c.RI "virtual void \fBsetScaleDraw\fP (\fBQwtDialScaleDraw\fP *)".br.ti -1c.RI "\fBQwtDialScaleDraw\fP * \fBscaleDraw\fP ()".br.ti -1c.RI "const \fBQwtDialScaleDraw\fP * \fBscaleDraw\fP () const".br.in -1c.SS "Protected Member Functions".in +1c.ti -1c.RI "virtual void \fBpaintEvent\fP (QPaintEvent *)".br.ti -1c.RI "virtual void \fBresizeEvent\fP (QResizeEvent *)".br.ti -1c.RI "virtual void \fBkeyPressEvent\fP (QKeyEvent *)".br.ti -1c.RI "virtual void \fBdrawFrame\fP (QPainter *p)".br.ti -1c.RI "virtual void \fBdrawContents\fP (QPainter *) const".br.ti -1c.RI "virtual void \fBdrawFocusIndicator\fP (QPainter *) const".br.ti -1c.RI "virtual void \fBdrawScale\fP (QPainter *, const QPoint ¢er, int radius, double origin, double arcMin, double arcMax) const".br.ti -1c.RI "virtual void \fBdrawScaleContents\fP (QPainter *painter, const QPoint ¢er, int radius) const".br.ti -1c.RI "virtual void \fBdrawNeedle\fP (QPainter *, const QPoint &, int radius, double direction, QPalette::ColorGroup) const".br.ti -1c.RI "virtual QString \fBscaleLabel\fP (double) const".br.ti -1c.RI "void \fBupdateScale\fP ()".br.ti -1c.RI "virtual void \fBrangeChange\fP ()".br.ti -1c.RI "virtual void \fBvalueChange\fP ()".br.ti -1c.RI "virtual double \fBgetValue\fP (const QPoint &)".br.ti -1c.RI "virtual void \fBgetScrollMode\fP (const QPoint &, int &scrollMode, int &direction)".br.in -1c.SH "Member Enumeration Documentation".PP .SS "enum \fBQwtDial::Mode\fP".PPIn case of RotateNeedle the needle is rotating, in case of RotateScale, the needle points to \fBorigin()\fP and the scale is rotating. Definition at line 117 of file qwt_dial.h..PPReferenced by mode()..SS "enum \fBQwtDial::ScaleOptions\fP".PPsee \fBQwtDial::setScaleOptions\fP .PPDefinition at line 105 of file qwt_dial.h..SS "enum \fBQwtDial::Shadow\fP".PPFrame shadow. .PPUnfortunately it is not possible to use QFrame::Shadow as a property of a widget that is not derived from QFrame. The following enum is made for the designer only. It is safe to use QFrame::Shadow instead. Definition at line 97 of file qwt_dial.h..PPReferenced by frameShadow()..SH "Constructor & Destructor Documentation".PP .SS "QwtDial::QwtDial (QWidget * parent = \fC0\fP, const char * name = \fC0\fP)".PPConstructor. .PP\fBParameters:\fP.RS 4\fIparent\fP Parent widget .br\fIname\fP Widget name.RE.PPCreate a dial widget with no scale and no needle. The default origin is 90.0 with no valid value. It accepts mouse and keyboard inputs and has no step size. The default mode is QwtDial::RotateNeedle. Definition at line 107 of file qwt_dial.cpp..PPReferences QwtScaleDraw::setGeometry(), QwtDblRange::setRange(), and setScaleArc()..SS "QwtDial::~\fBQwtDial\fP ()\fC [virtual]\fP".PPDestructor. .PPDefinition at line 147 of file qwt_dial.cpp..SH "Member Function Documentation".PP .SS "QRect QwtDial::boundingRect () const".PP\fBReturns:\fP.RS 4bounding rect of the dial including the frame .RE.PP\fBSee also:\fP.RS 4\fBQwtDial::setLineWidth\fP, \fBQwtDial::scaleContentsRect\fP, \fBQwtDial::contentsRect\fP .RE.PPDefinition at line 260 of file qwt_dial.cpp..PPReferenced by contentsRect(), drawContents(), drawFrame(), resizeEvent(), and showBackground()..SS "QRect QwtDial::contentsRect () const".PP\fBReturns:\fP.RS 4bounding rect of the circle inside the frame .RE.PP\fBSee also:\fP.RS 4\fBQwtDial::setLineWidth\fP, \fBQwtDial::scaleContentsRect\fP, \fBQwtDial::boundingRect\fP .RE.PPDefinition at line 243 of file qwt_dial.cpp..PPReferences boundingRect(), and lineWidth()..PPReferenced by drawFocusIndicator(), getScrollMode(), and scaleContentsRect()..SS "void QwtDial::drawContents (QPainter * painter) const\fC [protected, virtual]\fP".PPDraw the contents inside the frame. .PPQColorGroup::Background is the background color outside of the frame. QColorGroup::Base is the background color inside the frame. QColorGroup::Foreground is the background color inside the scale..PP\fBParameters:\fP.RS 4\fIpainter\fP Painter .RE.PP\fBSee also:\fP.RS 4\fBQwtDial::boundingRect\fP, \fBQwtDial::contentsRect\fP, \fBQwtDial::scaleContentsRect\fP, QWidget::setPalette .RE.PPDefinition at line 475 of file qwt_dial.cpp..PPReferences boundingRect(), drawNeedle(), drawScale(), drawScaleContents(), QwtSliderBase::isValid(), QwtDblRange::maxValue(), QwtDblRange::minValue(), mode(), origin(), scaleContentsRect(), and QwtDblRange::value()..PPReferenced by paintEvent()..SS "void QwtDial::drawFocusIndicator (QPainter * painter) const\fC [protected, virtual]\fP".PPDraw a dotted round circle, if !isReadOnly().PP\fBParameters:\fP.RS 4\fIpainter\fP Painter .RE.PPDefinition at line 394 of file qwt_dial.cpp..PPReferences contentsRect(), and QwtSliderBase::isReadOnly()..PPReferenced by paintEvent()..SS "void QwtDial::drawFrame (QPainter * painter)\fC [protected, virtual]\fP".PPDraw the frame around the dial.PP\fBParameters:\fP.RS 4\fIpainter\fP Painter .RE.PP\fBSee also:\fP.RS 4\fBQwtDial::lineWidth\fP, \fBQwtDial::frameShadow\fP .RE.PPDefinition at line 431 of file qwt_dial.cpp..PPReferences boundingRect(), QwtPainter::drawRoundFrame(), and lineWidth()..PPReferenced by paintEvent()..SS "void QwtDial::drawNeedle (QPainter * painter, const QPoint & center, int radius, double direction, QPalette::ColorGroup cg) const\fC [protected, virtual]\fP".PPDraw the needle.PPQwt is missing a set of good looking needles. Contributions are very welcome..PP\fBParameters:\fP.RS 4\fIpainter\fP Painter .br\fIcenter\fP Center of the dial .br\fIradius\fP Length for the needle .br\fIdirection\fP Direction of the needle in degrees, counter clockwise .br\fIcg\fP ColorGroup .RE.PP.PPReimplemented in \fBQwtAnalogClock\fP..PPDefinition at line 584 of file qwt_dial.cpp..PPReferences QwtDialNeedle::draw()..PPReferenced by drawContents()..SS "void QwtDial::drawScale (QPainter * painter, const QPoint & center, int radius, double origin, double minArc, double maxArc) const\fC [protected, virtual]\fP".PPDraw the scale.PP\fBParameters:\fP.RS 4\fIpainter\fP Painter .br\fIcenter\fP Center of the dial .br\fIradius\fP Radius of the scale .br\fIorigin\fP Origin of the scale .br\fIminArc\fP Minimum of the arc .br\fImaxArc\fP Minimum of the arc.RE.PP\fBSee also:\fP.RS 4\fBQwtScaleDraw::setAngleRange\fP .RE.PPDefinition at line 606 of file qwt_dial.cpp..PPReferences QwtScaleDraw::draw(), QwtDialScaleDraw::penWidth(), QwtScaleDraw::setAngleRange(), and QwtScaleDraw::setGeometry()..PPReferenced by drawContents()..SS "void QwtDial::drawScaleContents (QPainter * painter, const QPoint & center, int radius) const\fC [protected, virtual]\fP".PPDraw the contents inside the scale.PPPaints nothing..PP\fBParameters:\fP.RS 4\fIpainter\fP Painter .br\fIcenter\fP Center of the contents circle .br\fIradius\fP Radius of the contents circle .RE.PP.PPReimplemented in \fBQwtCompass\fP..PPDefinition at line 643 of file qwt_dial.cpp..PPReferenced by drawContents()..SS "\fBQwtDial::Shadow\fP QwtDial::frameShadow () const".PP\fBReturns:\fP.RS 4Frame shadow /sa \fBQwtDial::setFrameShadow\fP, \fBQwtDial::lineWidth\fP, QFrame::frameShadow .RE.PPDefinition at line 206 of file qwt_dial.cpp..PPReferences Shadow..SS "void QwtDial::getScrollMode (const QPoint & p, int & scrollMode, int & direction)\fC [protected, virtual]\fP".PP\fBSee also:\fP.RS 4\fBQwtSliderBase::getScrollMode\fP .RE.PP.PPImplements \fBQwtSliderBase\fP..PPDefinition at line 1012 of file qwt_dial.cpp..PPReferences contentsRect()..SS "double QwtDial::getValue (const QPoint & pos)\fC [protected, virtual]\fP".PPFind the value for a given position.PP\fBParameters:\fP.RS 4\fIpos\fP .RE.PP\fBReturns:\fP.RS 4Value .RE.PP.PPImplements \fBQwtSliderBase\fP..PPDefinition at line 909 of file qwt_dial.cpp..PPReferences QwtDblRange::maxValue(), QwtDblRange::minValue(), mode(), QwtDblRange::value(), and wrapping()..SS "bool QwtDial::hasVisibleBackground () const".PPTRUE when the area outside of the frame is visible.PP\fBSee also:\fP.RS 4\fBQwtDial::showBackground\fP, QWidget::setMask .RE.PPDefinition at line 181 of file qwt_dial.cpp..PPReferenced by resizeEvent()..SS "void QwtDial::keyPressEvent (QKeyEvent * e)\fC [protected, virtual]\fP".PPHandles key events.PP.IP "\(bu" 2Key_Down, KeyLeft.br Decrement by 1.IP "\(bu" 2Key_Prior.br Decrement by \fBpageSize()\fP.IP "\(bu" 2Key_Home
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -