QwtCounter.3 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. .TH "QwtCounter" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. QwtCounter \- The Counter Widget\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <qwt_counter\&.h>\fP
  11. .PP
  12. Inherits QWidget\&.
  13. .SS "Public Types"
  14. .in +1c
  15. .ti -1c
  16. .RI "enum \fBButton\fP { \fBButton1\fP, \fBButton2\fP, \fBButton3\fP, \fBButtonCnt\fP }"
  17. .br
  18. .RI "Button index\&. "
  19. .in -1c
  20. .SS "Public Slots"
  21. .in +1c
  22. .ti -1c
  23. .RI "void \fBsetValue\fP (double)"
  24. .br
  25. .RI "Set a new value without adjusting to the step raster\&. "
  26. .in -1c
  27. .SS "Signals"
  28. .in +1c
  29. .ti -1c
  30. .RI "void \fBbuttonReleased\fP (double \fBvalue\fP)"
  31. .br
  32. .ti -1c
  33. .RI "void \fBvalueChanged\fP (double \fBvalue\fP)"
  34. .br
  35. .in -1c
  36. .SS "Public Member Functions"
  37. .in +1c
  38. .ti -1c
  39. .RI "\fBQwtCounter\fP (QWidget *parent=NULL)"
  40. .br
  41. .ti -1c
  42. .RI "virtual \fB~QwtCounter\fP ()"
  43. .br
  44. .RI "Destructor\&. "
  45. .ti -1c
  46. .RI "void \fBsetValid\fP (bool)"
  47. .br
  48. .ti -1c
  49. .RI "bool \fBisValid\fP () const"
  50. .br
  51. .ti -1c
  52. .RI "void \fBsetWrapping\fP (bool)"
  53. .br
  54. .RI "En/Disable wrapping\&. "
  55. .ti -1c
  56. .RI "bool \fBwrapping\fP () const"
  57. .br
  58. .ti -1c
  59. .RI "bool \fBisReadOnly\fP () const"
  60. .br
  61. .ti -1c
  62. .RI "void \fBsetReadOnly\fP (bool)"
  63. .br
  64. .RI "Allow/disallow the user to manually edit the value\&. "
  65. .ti -1c
  66. .RI "void \fBsetNumButtons\fP (int)"
  67. .br
  68. .ti -1c
  69. .RI "int \fBnumButtons\fP () const"
  70. .br
  71. .ti -1c
  72. .RI "void \fBsetIncSteps\fP (\fBQwtCounter::Button\fP, int numSteps)"
  73. .br
  74. .ti -1c
  75. .RI "int \fBincSteps\fP (\fBQwtCounter::Button\fP) const"
  76. .br
  77. .ti -1c
  78. .RI "virtual QSize \fBsizeHint\fP () const"
  79. .br
  80. .RI "A size hint\&. "
  81. .ti -1c
  82. .RI "double \fBsingleStep\fP () const"
  83. .br
  84. .ti -1c
  85. .RI "void \fBsetSingleStep\fP (double stepSize)"
  86. .br
  87. .RI "Set the step size of the counter\&. "
  88. .ti -1c
  89. .RI "void \fBsetRange\fP (double min, double max)"
  90. .br
  91. .RI "Set the minimum and maximum values\&. "
  92. .ti -1c
  93. .RI "double \fBminimum\fP () const"
  94. .br
  95. .ti -1c
  96. .RI "void \fBsetMinimum\fP (double)"
  97. .br
  98. .ti -1c
  99. .RI "double \fBmaximum\fP () const"
  100. .br
  101. .ti -1c
  102. .RI "void \fBsetMaximum\fP (double)"
  103. .br
  104. .ti -1c
  105. .RI "void \fBsetStepButton1\fP (int nSteps)"
  106. .br
  107. .ti -1c
  108. .RI "int \fBstepButton1\fP () const"
  109. .br
  110. .RI "returns the number of increment steps for button 1 "
  111. .ti -1c
  112. .RI "void \fBsetStepButton2\fP (int nSteps)"
  113. .br
  114. .ti -1c
  115. .RI "int \fBstepButton2\fP () const"
  116. .br
  117. .RI "returns the number of increment steps for button 2 "
  118. .ti -1c
  119. .RI "void \fBsetStepButton3\fP (int nSteps)"
  120. .br
  121. .ti -1c
  122. .RI "int \fBstepButton3\fP () const"
  123. .br
  124. .RI "returns the number of increment steps for button 3 "
  125. .ti -1c
  126. .RI "double \fBvalue\fP () const"
  127. .br
  128. .in -1c
  129. .SS "Protected Member Functions"
  130. .in +1c
  131. .ti -1c
  132. .RI "virtual bool \fBevent\fP (QEvent *)"
  133. .br
  134. .ti -1c
  135. .RI "virtual void \fBwheelEvent\fP (QWheelEvent *)"
  136. .br
  137. .ti -1c
  138. .RI "virtual void \fBkeyPressEvent\fP (QKeyEvent *)"
  139. .br
  140. .in -1c
  141. .SH "Detailed Description"
  142. .PP
  143. The Counter Widget\&.
  144. 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\&.
  145. .PP
  146. A counter has a range from a minimum value to a maximum value and a step size\&. When the wrapping property is set the counter is circular\&.
  147. .PP
  148. The number of steps by which a button increments or decrements the value can be specified using \fBsetIncSteps()\fP\&. The number of buttons can be changed with \fBsetNumButtons()\fP\&.
  149. .PP
  150. Example:
  151. .PP
  152. .nf
  153. #include <qwt_counter\&.h>
  154. QwtCounter *counter = new QwtCounter(parent);
  155. counter->setRange(0\&.0, 100\&.0); // From 0\&.0 to 100
  156. counter->setSingleStep( 1\&.0 ); // Step size 1\&.0
  157. counter->setNumButtons(2); // Two buttons each side
  158. counter->setIncSteps(QwtCounter::Button1, 1); // Button 1 increments 1 step
  159. counter->setIncSteps(QwtCounter::Button2, 20); // Button 2 increments 20 steps
  160. connect(counter, SIGNAL(valueChanged(double)), myClass, SLOT(newValue(double)));
  161. .fi
  162. .PP
  163. .SH "Member Enumeration Documentation"
  164. .PP
  165. .SS "enum \fBQwtCounter::Button\fP"
  166. .PP
  167. Button index\&.
  168. .PP
  169. \fBEnumerator\fP
  170. .in +1c
  171. .TP
  172. \fB\fIButton1 \fP\fP
  173. Button intended for minor steps\&.
  174. .TP
  175. \fB\fIButton2 \fP\fP
  176. Button intended for medium steps\&.
  177. .TP
  178. \fB\fIButton3 \fP\fP
  179. Button intended for large steps\&.
  180. .TP
  181. \fB\fIButtonCnt \fP\fP
  182. Number of buttons\&.
  183. .SH "Constructor & Destructor Documentation"
  184. .PP
  185. .SS "QwtCounter::QwtCounter (QWidget * parent = \fCNULL\fP)\fC [explicit]\fP"
  186. The counter is initialized with a range is set to [0\&.0, 1\&.0] with 0\&.01 as single step size\&. The value is invalid\&.
  187. .PP
  188. The default number of buttons is set to 2\&. The default increments are:
  189. .PD 0
  190. .IP "\(bu" 2
  191. Button 1: 1 step
  192. .IP "\(bu" 2
  193. Button 2: 10 steps
  194. .IP "\(bu" 2
  195. Button 3: 100 steps
  196. .PP
  197. \fBParameters\fP
  198. .RS 4
  199. \fIparent\fP
  200. .RE
  201. .PP
  202. .SH "Member Function Documentation"
  203. .PP
  204. .SS "void QwtCounter::buttonReleased (double value)\fC [signal]\fP"
  205. This signal is emitted when a button has been released
  206. .PP
  207. \fBParameters\fP
  208. .RS 4
  209. \fIvalue\fP The new value
  210. .RE
  211. .PP
  212. .SS "bool QwtCounter::event (QEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
  213. Handle QEvent::PolishRequest events
  214. .PP
  215. \fBParameters\fP
  216. .RS 4
  217. \fIevent\fP Event
  218. .RE
  219. .PP
  220. \fBReturns\fP
  221. .RS 4
  222. see QWidget::event()
  223. .RE
  224. .PP
  225. .SS "int QwtCounter::incSteps (\fBQwtCounter::Button\fP button) const"
  226. .PP
  227. \fBReturns\fP
  228. .RS 4
  229. The number of steps by which a specified button increments the value or 0 if the button is invalid\&.
  230. .RE
  231. .PP
  232. \fBParameters\fP
  233. .RS 4
  234. \fIbutton\fP Button index
  235. .RE
  236. .PP
  237. \fBSee also\fP
  238. .RS 4
  239. \fBsetIncSteps()\fP
  240. .RE
  241. .PP
  242. .SS "bool QwtCounter::isReadOnly () const"
  243. .PP
  244. \fBReturns\fP
  245. .RS 4
  246. True, when the line line edit is read only\&. (default is no)
  247. .RE
  248. .PP
  249. \fBSee also\fP
  250. .RS 4
  251. \fBsetReadOnly()\fP
  252. .RE
  253. .PP
  254. .SS "bool QwtCounter::isValid () const"
  255. .PP
  256. \fBReturns\fP
  257. .RS 4
  258. True, if the value is valid
  259. .RE
  260. .PP
  261. \fBSee also\fP
  262. .RS 4
  263. \fBsetValid()\fP, \fBsetValue()\fP
  264. .RE
  265. .PP
  266. .SS "void QwtCounter::keyPressEvent (QKeyEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
  267. Handle key events
  268. .PP
  269. .IP "\(bu" 2
  270. Ctrl + Qt::Key_Home
  271. .br
  272. Step to \fBminimum()\fP
  273. .IP "\(bu" 2
  274. Ctrl + Qt::Key_End
  275. .br
  276. Step to \fBmaximum()\fP
  277. .IP "\(bu" 2
  278. Qt::Key_Up
  279. .br
  280. Increment by incSteps(QwtCounter::Button1)
  281. .IP "\(bu" 2
  282. Qt::Key_Down
  283. .br
  284. Decrement by incSteps(QwtCounter::Button1)
  285. .IP "\(bu" 2
  286. Qt::Key_PageUp
  287. .br
  288. Increment by incSteps(QwtCounter::Button2)
  289. .IP "\(bu" 2
  290. Qt::Key_PageDown
  291. .br
  292. Decrement by incSteps(QwtCounter::Button2)
  293. .IP "\(bu" 2
  294. Shift + Qt::Key_PageUp
  295. .br
  296. Increment by incSteps(QwtCounter::Button3)
  297. .IP "\(bu" 2
  298. Shift + Qt::Key_PageDown
  299. .br
  300. Decrement by incSteps(QwtCounter::Button3)
  301. .PP
  302. .PP
  303. \fBParameters\fP
  304. .RS 4
  305. \fIevent\fP Key event
  306. .RE
  307. .PP
  308. .SS "double QwtCounter::maximum () const"
  309. .PP
  310. \fBReturns\fP
  311. .RS 4
  312. The maximum of the range
  313. .RE
  314. .PP
  315. \fBSee also\fP
  316. .RS 4
  317. \fBsetRange()\fP, \fBsetMaximum()\fP, \fBminimum()\fP
  318. .RE
  319. .PP
  320. .SS "double QwtCounter::minimum () const"
  321. .PP
  322. \fBReturns\fP
  323. .RS 4
  324. The minimum of the range
  325. .RE
  326. .PP
  327. \fBSee also\fP
  328. .RS 4
  329. \fBsetRange()\fP, \fBsetMinimum()\fP, \fBmaximum()\fP
  330. .RE
  331. .PP
  332. .SS "int QwtCounter::numButtons () const"
  333. .PP
  334. \fBReturns\fP
  335. .RS 4
  336. The number of buttons on each side of the widget\&.
  337. .RE
  338. .PP
  339. \fBSee also\fP
  340. .RS 4
  341. \fBsetNumButtons()\fP
  342. .RE
  343. .PP
  344. .SS "void QwtCounter::setIncSteps (\fBQwtCounter::Button\fP button, int numSteps)"
  345. Specify the number of steps by which the value is incremented or decremented when a specified button is pushed\&.
  346. .PP
  347. \fBParameters\fP
  348. .RS 4
  349. \fIbutton\fP Button index
  350. .br
  351. \fInumSteps\fP Number of steps
  352. .RE
  353. .PP
  354. \fBSee also\fP
  355. .RS 4
  356. \fBincSteps()\fP
  357. .RE
  358. .PP
  359. .SS "void QwtCounter::setMaximum (double value)"
  360. Set the maximum value of the range
  361. .PP
  362. \fBParameters\fP
  363. .RS 4
  364. \fIvalue\fP Maximum value
  365. .RE
  366. .PP
  367. \fBSee also\fP
  368. .RS 4
  369. \fBsetRange()\fP, \fBsetMinimum()\fP, \fBmaximum()\fP
  370. .RE
  371. .PP
  372. .SS "void QwtCounter::setMinimum (double value)"
  373. Set the minimum value of the range
  374. .PP
  375. \fBParameters\fP
  376. .RS 4
  377. \fIvalue\fP Minimum value
  378. .RE
  379. .PP
  380. \fBSee also\fP
  381. .RS 4
  382. \fBsetRange()\fP, \fBsetMaximum()\fP, \fBminimum()\fP
  383. .RE
  384. .PP
  385. \fBNote\fP
  386. .RS 4
  387. The maximum is adjusted if necessary to ensure that the range remains valid\&.
  388. .RE
  389. .PP
  390. .SS "void QwtCounter::setNumButtons (int numButtons)"
  391. Specify the number of buttons on each side of the label
  392. .PP
  393. \fBParameters\fP
  394. .RS 4
  395. \fInumButtons\fP Number of buttons
  396. .RE
  397. .PP
  398. \fBSee also\fP
  399. .RS 4
  400. \fBnumButtons()\fP
  401. .RE
  402. .PP
  403. .SS "void QwtCounter::setRange (double min, double max)"
  404. .PP
  405. Set the minimum and maximum values\&. The maximum is adjusted if necessary to ensure that the range remains valid\&. The value might be modified to be inside of the range\&.
  406. .PP
  407. \fBParameters\fP
  408. .RS 4
  409. \fImin\fP Minimum value
  410. .br
  411. \fImax\fP Maximum value
  412. .RE
  413. .PP
  414. \fBSee also\fP
  415. .RS 4
  416. \fBminimum()\fP, \fBmaximum()\fP
  417. .RE
  418. .PP
  419. .SS "void QwtCounter::setReadOnly (bool on)"
  420. .PP
  421. Allow/disallow the user to manually edit the value\&.
  422. .PP
  423. \fBParameters\fP
  424. .RS 4
  425. \fIon\fP True disable editing
  426. .RE
  427. .PP
  428. \fBSee also\fP
  429. .RS 4
  430. \fBisReadOnly()\fP
  431. .RE
  432. .PP
  433. .SS "void QwtCounter::setSingleStep (double stepSize)"
  434. .PP
  435. Set the step size of the counter\&. A value <= 0\&.0 disables stepping
  436. .PP
  437. \fBParameters\fP
  438. .RS 4
  439. \fIstepSize\fP Single step size
  440. .RE
  441. .PP
  442. \fBSee also\fP
  443. .RS 4
  444. \fBsingleStep()\fP
  445. .RE
  446. .PP
  447. .SS "void QwtCounter::setStepButton1 (int nSteps)"
  448. Set the number of increment steps for button 1
  449. .PP
  450. \fBParameters\fP
  451. .RS 4
  452. \fInSteps\fP Number of steps
  453. .RE
  454. .PP
  455. .SS "void QwtCounter::setStepButton2 (int nSteps)"
  456. Set the number of increment steps for button 2
  457. .PP
  458. \fBParameters\fP
  459. .RS 4
  460. \fInSteps\fP Number of steps
  461. .RE
  462. .PP
  463. .SS "void QwtCounter::setStepButton3 (int nSteps)"
  464. Set the number of increment steps for button 3
  465. .PP
  466. \fBParameters\fP
  467. .RS 4
  468. \fInSteps\fP Number of steps
  469. .RE
  470. .PP
  471. .SS "void QwtCounter::setValid (bool on)"
  472. Set the counter to be in valid/invalid state
  473. .PP
  474. When the counter is set to invalid, no numbers are displayed and the buttons are disabled\&.
  475. .PP
  476. \fBParameters\fP
  477. .RS 4
  478. \fIon\fP If true the counter will be set as valid
  479. .RE
  480. .PP
  481. \fBSee also\fP
  482. .RS 4
  483. \fBsetValue()\fP, \fBisValid()\fP
  484. .RE
  485. .PP
  486. .SS "void QwtCounter::setValue (double value)\fC [slot]\fP"
  487. .PP
  488. Set a new value without adjusting to the step raster\&. The state of the counter is set to be valid\&.
  489. .PP
  490. \fBParameters\fP
  491. .RS 4
  492. \fIvalue\fP New value
  493. .RE
  494. .PP
  495. \fBSee also\fP
  496. .RS 4
  497. \fBisValid()\fP, \fBvalue()\fP, \fBvalueChanged()\fP
  498. .RE
  499. .PP
  500. \fBWarning\fP
  501. .RS 4
  502. The value is clipped when it lies outside the range\&.
  503. .RE
  504. .PP
  505. .SS "void QwtCounter::setWrapping (bool on)"
  506. .PP
  507. En/Disable wrapping\&. If wrapping is true stepping up from \fBmaximum()\fP value will take you to the \fBminimum()\fP value and vice versa\&.
  508. .PP
  509. \fBParameters\fP
  510. .RS 4
  511. \fIon\fP En/Disable wrapping
  512. .RE
  513. .PP
  514. \fBSee also\fP
  515. .RS 4
  516. \fBwrapping()\fP
  517. .RE
  518. .PP
  519. .SS "double QwtCounter::singleStep () const"
  520. .PP
  521. \fBReturns\fP
  522. .RS 4
  523. Single step size
  524. .RE
  525. .PP
  526. \fBSee also\fP
  527. .RS 4
  528. \fBsetSingleStep()\fP
  529. .RE
  530. .PP
  531. .SS "double QwtCounter::value () const"
  532. .PP
  533. \fBReturns\fP
  534. .RS 4
  535. Current value of the counter
  536. .RE
  537. .PP
  538. \fBSee also\fP
  539. .RS 4
  540. \fBsetValue()\fP, \fBvalueChanged()\fP
  541. .RE
  542. .PP
  543. .SS "void QwtCounter::valueChanged (double value)\fC [signal]\fP"
  544. This signal is emitted when the counter's value has changed
  545. .PP
  546. \fBParameters\fP
  547. .RS 4
  548. \fIvalue\fP The new value
  549. .RE
  550. .PP
  551. .SS "void QwtCounter::wheelEvent (QWheelEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
  552. Handle wheel events
  553. .PP
  554. \fBParameters\fP
  555. .RS 4
  556. \fIevent\fP Wheel event
  557. .RE
  558. .PP
  559. .SS "bool QwtCounter::wrapping () const"
  560. .PP
  561. \fBReturns\fP
  562. .RS 4
  563. True, when wrapping is set
  564. .RE
  565. .PP
  566. \fBSee also\fP
  567. .RS 4
  568. \fBsetWrapping()\fP
  569. .RE
  570. .PP
  571. .SH "Author"
  572. .PP
  573. Generated automatically by Doxygen for Qwt User's Guide from the source code\&.