📄 qwtcounter.3
字号:
.TH "QwtCounter" 3 "4 Nov 2003" "Qwt User's Guide" \" -*- nroff -*-.ad l.nh.SH NAMEQwtCounter \- .SH SYNOPSIS.br.PPInherits \fBQwtDblRange\fP..PP.SH "Detailed Description".PP The Counter Widget. A Counter consists of a label displaying a number and one ore more (up to three) push buttons on each side of the label which can be used to increment or decrement the counter's value..PPA Counter has a range from a minimum value to a maximum value and a step size. The range can be specified using \fBQwtDblRange::setRange()\fP. The counter's value is an integer multiple of the step size. The number of steps by which a button increments or decrements the value can be specified using \fBQwtCounter::setIncSteps()\fP. The number of buttons can be changed with \fBQwtCounter::setNumButtons()\fP..PPHolding the space bar down with focus on a button is the fastest method to step through the counter values. When the counter underflows/overflows, the focus is set to the smallest up/down button and counting is disabled. Counting is re-enabled on a button release event (mouse or space bar)..PPExample: .PP.nf#include '../include/qwt_counter.h>QwtCounter *cnt;cnt = new QwtCounter(parent, name);cnt->setRange(0.0, 100.0, 1.0); // From 0.0 to 100, step 1.0cnt->setNumButtons(2); // Two buttons each sidecnt->setIncSteps(QwtCounter::Button1, 1); // Button 1 increments 1 stepcnt->setIncSteps(QwtCounter::Button2, 20); // Button 2 increments 20 stepsconnect(cnt, SIGNAL(valueChanged(double)), my_class, SLOT(newValue(double)));.PP.PP.SS "Public Types".in +1c.ti -1c.RI "enum \fBButton\fP { \fBButton1\fP, \fBButton2\fP, \fBButton3\fP, \fBButtonCnt\fP }".br.in -1c.SS "Public Member Functions".in +1c.ti -1c.RI "\fBQwtCounter\fP (QWidget *parent=0, const char *name=0)".br.ti -1c.RI "double \fBstep\fP () const ".br.ti -1c.RI "void \fBsetStep\fP (double s)".br.ti -1c.RI "double \fBminVal\fP () const ".br.ti -1c.RI "void \fBsetMinValue\fP (double m)".br.ti -1c.RI "double \fBmaxVal\fP () const ".br.ti -1c.RI "void \fBsetMaxValue\fP (double m)".br.ti -1c.RI "void \fBsetStepButton1\fP (int nSteps)".br.ti -1c.RI "int \fBstepButton1\fP () const ".br.ti -1c.RI "void \fBsetStepButton2\fP (int nSteps)".br.ti -1c.RI "int \fBstepButton2\fP () const ".br.ti -1c.RI "void \fBsetStepButton3\fP (int nSteps)".br.ti -1c.RI "int \fBstepButton3\fP () const ".br.ti -1c.RI "virtual double \fBvalue\fP () const ".br.ti -1c.RI "void \fBsetNumButtons\fP (int n)".br.ti -1c.RI "int \fBnumButtons\fP () const ".br.ti -1c.RI "void \fBsetIncSteps\fP (\fBQwtCounter::Button\fP btn, int nSteps)".br.ti -1c.RI "int \fBincSteps\fP (\fBQwtCounter::Button\fP btn) const ".br.ti -1c.RI "virtual void \fBsetValue\fP (double)".br.ti -1c.RI "virtual QSizePolicy \fBsizePolicy\fP () const ".br.ti -1c.RI "virtual QSize \fBsizeHint\fP () const ".br.ti -1c.RI "virtual bool \fBeventFilter\fP (QObject *, QEvent *)".br.in -1c.SS "Protected Member Functions".in +1c.ti -1c.RI "void \fBbuttonReleased\fP (double value)".br.ti -1c.RI "void \fBvalueChanged\fP (double value)".br.ti -1c.RI "virtual void \fBrangeChange\fP ()".br.ti -1c.RI "virtual void \fBfontChange\fP (const QFont &f)".br.in -1c.SH "Member Enumeration Documentation".PP .SS "enum \fBQwtCounter::Button\fP".PPButton index .SH "Constructor & Destructor Documentation".PP .SS "QwtCounter::QwtCounter (QWidget * parent = 0, const char * name = 0)".PPThe default number of buttons is set to 2. The default increments are: .IP "\(bu" 2Button 1: 1 step .IP "\(bu" 2Button 2: 10 steps .IP "\(bu" 2Button 3: 100 steps.PP\fBParameters:\fP.RS 4\fIparent\fP .br\fIname\fP Forwarded to QWidget's ctor. .RE.PP.SH "Member Function Documentation".PP .SS "void QwtCounter::buttonReleased (double value)\fC [protected]\fP".PPThis signal is emitted when a button has been released .PP\fBParameters:\fP.RS 4\fIvalue\fP The new value .RE.PP.SS "bool QwtCounter::eventFilter (QObject *, QEvent *)\fC [virtual]\fP".PPKeep track of key press and release events. .SS "void QwtCounter::fontChange (const QFont & f)\fC [protected, virtual]\fP".PPNotify change of font. This function updates the fonts of all widgets contained in QwtCounter. .PP\fBParameters:\fP.RS 4\fIf\fP new font .RE.PP.SS "int QwtCounter::incSteps (\fBQwtCounter::Button\fP btn) const".PP\fBReturns:\fP.RS 4the number of steps by which a specified button increments the value or 0 if the button is invalid. .RE.PP\fBParameters:\fP.RS 4\fIbtn\fP One of \fCQwtCounter::Button1\fP, \fCQwtCounter::Button2\fP, \fCQwtCounter::Button3\fP .RE.PP.SS "double QwtCounter::maxVal () const".PPreturns the maximum value of the range .SS "double QwtCounter::minVal () const".PPreturns the minimum value of the range .SS "int QwtCounter::numButtons () const".PP\fBReturns:\fP.RS 4The number of buttons on each side of the widget. .RE.PP.SS "void QwtCounter::rangeChange ()\fC [protected, virtual]\fP".PPNotify change of range. This function updates the enabled property of all buttons contained in QwtCounter. Reimplemented from \fBQwtDblRange\fP..SS "void QwtCounter::setIncSteps (\fBQwtCounter::Button\fP btn, int nSteps)".PPSpecify the number of steps by which the value is incremented or decremented when a specified button is pushed..PP\fBParameters:\fP.RS 4\fIbtn\fP One of \fCQwtCounter::Button1\fP, \fCQwtCounter::Button2\fP, \fCQwtCounter::Button3\fP .br\fInSteps\fP Number of steps .RE.PP.SS "void QwtCounter::setMaxValue (double m)".PPsets the maximum value of the range .SS "void QwtCounter::setMinValue (double m)".PPsets the minimum value of the range .SS "void QwtCounter::setNumButtons (int n)".PPSpecify the number of buttons on each side of the label. \fBParameters:\fP.RS 4\fIn\fP Number of buttons .RE.PP.SS "void QwtCounter::setStep (double s)".PPsets the step size Reimplemented from \fBQwtDblRange\fP..SS "void QwtCounter::setStepButton1 (int nSteps)".PPset the number of increment steps for button 1 .SS "void QwtCounter::setStepButton2 (int nSteps)".PPset the number of increment steps for button 2 .SS "void QwtCounter::setStepButton3 (int nSteps)".PPset the number of increment steps for button 3 .SS "void QwtCounter::setValue (double v)\fC [virtual]\fP".PPSet a new value. \fBParameters:\fP.RS 4\fIv\fP new value Calls \fBQwtDblRange::setValue\fP and does all visual updates. .RE.PP\fBSee also:\fP.RS 4\fBQwtDblRange::setValue\fP .RE.PPReimplemented from \fBQwtDblRange\fP..SS "QSize QwtCounter::sizeHint () const\fC [virtual]\fP".PPA size hint. .SS "QSizePolicy QwtCounter::sizePolicy () const\fC [virtual]\fP".PPPreferred/Fixed. .SS "double QwtCounter::step () const".PPreturns the step size Reimplemented from \fBQwtDblRange\fP..SS "int QwtCounter::stepButton1 () const".PPreturns the number of increment steps for button 1 .SS "int QwtCounter::stepButton2 () const".PPreturns the number of increment steps for button 2 .SS "int QwtCounter::stepButton3 () const".PPreturns the number of increment steps for button 3 .SS "virtual double QwtCounter::value () const\fC [virtual]\fP".PPReturns the current value. Reimplemented from \fBQwtDblRange\fP..SS "void QwtCounter::valueChanged (double value)\fC [protected]\fP".PPThis signal is emitted when the counter's value has changed .PP\fBParameters:\fP.RS 4\fIvalue\fP The new value .RE.PP.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 + -