📄 qdial.3qt
字号:
'\" t.TH QDial 3qt "24 January 2005" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQDial \- Rounded rangecontrol (like a speedometer or potentiometer).br.PP\fC#include <qdial.h>\fR.PPInherits QRangeControl and QWidget..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQDial\fR ( QWidget * " "parent" "=0, const char * " "name" "=0 ) ".br.ti -1c.BI "\fBQDial\fR ( int " "minValue" ", int " "maxValue" ", int " "pageStep" ", int " "value" ", QWidget * " "parent" "=0, const char * " "name" "=0 ) ".br.ti -1c.BI "\fB~QDial\fR () ".br.ti -1c.BI "bool \fBtracking\fR () const".br.ti -1c.BI "bool \fBwrapping\fR () const".br.ti -1c.BI "int \fBnotchSize\fR () const".br.ti -1c.BI "virtual void \fBsetNotchTarget\fR ( double ) ".br.ti -1c.BI "double \fBnotchTarget\fR () const".br.ti -1c.BI "bool \fBnotchesVisible\fR () const".br.ti -1c.BI "void \fBsetMinValue\fR ( int ) ".br.ti -1c.BI "void \fBsetMaxValue\fR ( int ) ".br.ti -1c.BI "void \fBsetLineStep\fR ( int ) ".br.ti -1c.BI "void \fBsetPageStep\fR ( int ) ".br.in -1c.SS "Public Slots".in +1c.ti -1c.BI "virtual void \fBsetValue\fR ( int ) ".br.ti -1c.BI "void \fBaddLine\fR () ".br.ti -1c.BI "void \fBsubtractLine\fR () ".br.ti -1c.BI "void \fBaddPage\fR () ".br.ti -1c.BI "void \fBsubtractPage\fR () ".br.ti -1c.BI "virtual void \fBsetNotchesVisible\fR ( bool b ) ".br.ti -1c.BI "virtual void \fBsetWrapping\fR ( bool on ) ".br.ti -1c.BI "virtual void \fBsetTracking\fR ( bool enable ) ".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBvalueChanged\fR ( int value ) ".br.ti -1c.BI "void \fBdialPressed\fR () ".br.ti -1c.BI "void \fBdialMoved\fR ( int value ) ".br.ti -1c.BI "void \fBdialReleased\fR () ".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual void \fBvalueChange\fR () ".br.ti -1c.BI "virtual void \fBrangeChange\fR () ".br.ti -1c.BI "virtual void \fBrepaintScreen\fR ( const QRect * " "cr" " = 0 ) ".br.in -1c.SS "Properties".nf.TSl l l l l- - - - -l l l l l.Type Name READ WRITE Optionsbool tracking tracking setTrackingbool wrapping wrapping setWrappingint notchSize notchSizedouble notchTarget notchTarget setNotchTargetbool notchesVisible notchesVisible setNotchesVisibleint minValue minValue setMinValueint maxValue maxValue setMaxValueint lineStep lineStep setLineStepint pageStep pageStep setPageStepint value value setValue.TE.fi.SH DESCRIPTIONThe QDial class provides a rounded rangecontrol (like a speedometer or potentiometer)..PPQ dial is used when the user needs to control a value within a program-definable range, and the range either wraps around (typically, 0-359 degrees) or the dialog layout needs a square widget..PPBoth API- and UI-wise, the dial is very like a slider. Indeed, when wrapping() is FALSE (the default) there is no hard difference between a slider and a dial. They have the same signals, slots and member functions, all of which do the same things. Which one to use depends only on your taste and on the application..PPThe dial initially emits valueChanged() signals continuously while the slider is being moved; you can make it emit the signal less often by calling setTracking( FALSE ). dialMoved() is emitted continuously even when tracking() is FALSE..PPThe slider also emits dialPressed() and dialReleased() signals when the mouse button is pressed and released. But note that the dial's value can change without these signals being emitted; the keyboard and wheel can be used to change the value..PPUnlike the slider, QDial attempts to draw a "nice" number of notches rather than one per lineStep(). If possible, that number \fIis\fR lineStep(), but if there aren't enough pixels to draw every, QDial will draw every second, third or something. notchSize() returns the number of units per notch, hopefully a multiple of lineStep(); setNotchTarget() sets the target distance between neighbouring notches in pixels. The default is 3.75 pixels..PPLike the slider, the dial makes the QRangeControl functions setValue(), addLine(), substractLine(), addPage() and subtractPage() available as slots..PPThe dial's keyboard interface is fairly simple: The left/up and right/down arrow keys move by lineStep(), page up and page down by pageStep() and Home and End to minValue() and maxValue()..PP.ce 1.B "[Image Omitted]".PP.ce 1.B "[Image Omitted]".PPSee also QScrollBar, QSpinBox and GUI Design Handbook: Slider.SH MEMBER FUNCTION DOCUMENTATION.SH "QDial::QDial ( QWidget * parent=0, const char * name=0 )"Constructs a dial with the default range of QRangeControl..SH "QDial::QDial ( int minValue, int maxValue, int pageStep, int value, QWidget * parent=0, const char * name=0 )"Constructs a dial whose value can never be smaller than \fIminValue\fR or greater than \fImaxValue,\fR whose line step size is \fIlineStep\fR and page step size is \fIpageStep,\fR and whose value is initially \fIvalue.\fR.PP\fIvalue\fR is forced to be within the legal range..SH "QDial::~QDial ()"Destructs the dial..SH "void QDial::addLine () \fC[slot]\fR"Moves the dial one lineStep() upwards..SH "void QDial::addPage () \fC[slot]\fR"Moves the dial one pageStep() upwards..SH "void QDial::dialMoved ( int value ) \fC[signal]\fR"This signal is emitted whenever the dial value changes. The frequency of this signal is \fInot\fR influenced by setTracking()..PPSee also valueChanged(int)..SH "void QDial::dialPressed () \fC[signal]\fR"This signal is emitted when the use begins mouse interaction with the dial..PPSee also dialReleased()..SH "void QDial::dialReleased () \fC[signal]\fR"This signal is emitted when the use ends mouse interaction with the dial..PPSee also dialPressed()..SH "void QDial::focusInEvent ( QFocusEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QDial::focusOutEvent ( QFocusEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QDial::keyPressEvent ( QKeyEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "int QDial::lineStep () const"Reimplemented for internal reasons; the API is not affected..SH "int QDial::maxValue () const"Reimplemented for internal reasons; the API is not affected..SH "int QDial::minValue () const"Reimplemented for internal reasons; the API is not affected..SH "QSize QDial::minimumSizeHint () const \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QDial::mouseMoveEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QDial::mousePressEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QDial::mouseReleaseEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "int QDial::notchSize () const"Returns the current notch size. This is in range control units, not pixels, and if possible it is a multiple of lineStep() that results in an on-screen notch size near notchTarget()..PPSee also notchTarget() and lineStep()..SH "double QDial::notchTarget () const"Returns the target size of the notch; this is the number of pixels QDial attempts to put between each little line..PPThe actual size differs a bit from the target..SH "bool QDial::notchesVisible () const"Retuns TRUE if notches are shown, else FALSE..PPSee also setNotchesVisible()..SH "int QDial::pageStep () const"Reimplemented for internal reasons; the API is not affected..SH "void QDial::paintEvent ( QPaintEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QDial::rangeChange () \fC[virtual protected]\fR"Reimplemented to ensure tick-marks are consistent with the new range..PPReimplemented from QRangeControl..SH "void QDial::repaintScreen ( const QRect * cr = 0 ) \fC[virtual protected]\fR"Paints the dial..SH "void QDial::resizeEvent ( QResizeEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QDial::setLineStep ( int i )"Sets the line step to \fIi.\fR.PPCalls the virtual stepChange() function if the new line step is different from the previous setting..PPSee also lineStep(), QRangeControl::setSteps(), setPageStep() and setRange()..SH "void QDial::setMaxValue ( int i )"A convenience function which just calls setRange( minValue(), i ).PPSee also setRange()..SH "void QDial::setMinValue ( int i )"A convenience function which just calls setRange( i, maxValue() ).PPSee also setRange()..SH "void QDial::setNotchTarget ( double target ) \fC[virtual]\fR"Sets the dial to use a notch size as close to \fItarget\fR pixels as possible. QDial will find a suitable number close to this, based on the dial's on-screen size, range and lineStep()..PPSee also notchTarget() and notchSize()..SH "void QDial::setNotchesVisible ( bool b ) \fC[virtual slot]\fR"Enables or disables showing of notches. If \fIb\fR is TRUE, the notches are shown, else not..SH "void QDial::setPageStep ( int i )"Sets the page step to \fIi.\fR.PPCalls the virtual stepChange() function if the new page step is different from the previous setting..PPSee also pageStep(), QRangeControl::setSteps(), setLineStep() and setRange()..SH "void QDial::setTracking ( bool enable ) \fC[virtual slot]\fR"If \fIenable\fR is TRUE, tracking is enabled. This means that the arrow can be moved using the mouse. Else this is not possible..SH "void QDial::setValue ( int newValue ) \fC[virtual slot]\fR"Makes QRangeControl::setValue() available as a slot..SH "void QDial::setWrapping ( bool enable ) \fC[virtual slot]\fR"If \fIenable\fR is TRUE, wrapping is enabled. This means that the arrow can be turned around 360
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -