QwtSlider.3 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. .TH "QwtSlider" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. QwtSlider \- The Slider Widget\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <qwt_slider\&.h>\fP
  11. .PP
  12. Inherits \fBQwtAbstractSlider\fP\&.
  13. .SS "Public Types"
  14. .in +1c
  15. .ti -1c
  16. .RI "enum \fBScalePosition\fP { \fBNoScale\fP, \fBLeadingScale\fP, \fBTrailingScale\fP }"
  17. .br
  18. .in -1c
  19. .SS "Public Member Functions"
  20. .in +1c
  21. .ti -1c
  22. .RI "\fBQwtSlider\fP (QWidget *parent=NULL)"
  23. .br
  24. .ti -1c
  25. .RI "\fBQwtSlider\fP (Qt::Orientation, QWidget *parent=NULL)"
  26. .br
  27. .ti -1c
  28. .RI "virtual \fB~QwtSlider\fP ()"
  29. .br
  30. .RI "Destructor\&. "
  31. .ti -1c
  32. .RI "void \fBsetOrientation\fP (Qt::Orientation)"
  33. .br
  34. .RI "Set the orientation\&. "
  35. .ti -1c
  36. .RI "Qt::Orientation \fBorientation\fP () const"
  37. .br
  38. .ti -1c
  39. .RI "void \fBsetScalePosition\fP (\fBScalePosition\fP)"
  40. .br
  41. .RI "Change the position of the scale\&. "
  42. .ti -1c
  43. .RI "\fBScalePosition\fP \fBscalePosition\fP () const"
  44. .br
  45. .ti -1c
  46. .RI "void \fBsetTrough\fP (bool)"
  47. .br
  48. .ti -1c
  49. .RI "bool \fBhasTrough\fP () const"
  50. .br
  51. .ti -1c
  52. .RI "void \fBsetGroove\fP (bool)"
  53. .br
  54. .ti -1c
  55. .RI "bool \fBhasGroove\fP () const"
  56. .br
  57. .ti -1c
  58. .RI "void \fBsetHandleSize\fP (const QSize &)"
  59. .br
  60. .RI "Set the slider's handle size\&. "
  61. .ti -1c
  62. .RI "QSize \fBhandleSize\fP () const"
  63. .br
  64. .ti -1c
  65. .RI "void \fBsetBorderWidth\fP (int)"
  66. .br
  67. .RI "Change the slider's border width\&. "
  68. .ti -1c
  69. .RI "int \fBborderWidth\fP () const"
  70. .br
  71. .ti -1c
  72. .RI "void \fBsetSpacing\fP (int)"
  73. .br
  74. .RI "Change the spacing between trough and scale\&. "
  75. .ti -1c
  76. .RI "int \fBspacing\fP () const"
  77. .br
  78. .ti -1c
  79. .RI "virtual QSize \fBsizeHint\fP () const"
  80. .br
  81. .ti -1c
  82. .RI "virtual QSize \fBminimumSizeHint\fP () const"
  83. .br
  84. .ti -1c
  85. .RI "void \fBsetScaleDraw\fP (\fBQwtScaleDraw\fP *)"
  86. .br
  87. .RI "Set a scale draw\&. "
  88. .ti -1c
  89. .RI "const \fBQwtScaleDraw\fP * \fBscaleDraw\fP () const"
  90. .br
  91. .ti -1c
  92. .RI "void \fBsetUpdateInterval\fP (int)"
  93. .br
  94. .RI "Specify the update interval for automatic scrolling\&. "
  95. .ti -1c
  96. .RI "int \fBupdateInterval\fP () const"
  97. .br
  98. .in -1c
  99. .SS "Protected Member Functions"
  100. .in +1c
  101. .ti -1c
  102. .RI "virtual double \fBscrolledTo\fP (const QPoint &) const"
  103. .br
  104. .RI "Determine the value for a new position of the slider handle\&. "
  105. .ti -1c
  106. .RI "virtual bool \fBisScrollPosition\fP (const QPoint &) const"
  107. .br
  108. .RI "Determine what to do when the user presses a mouse button\&. "
  109. .ti -1c
  110. .RI "virtual void \fBdrawSlider\fP (QPainter *, const QRect &) const"
  111. .br
  112. .ti -1c
  113. .RI "virtual void \fBdrawHandle\fP (QPainter *, const QRect &, int pos) const"
  114. .br
  115. .ti -1c
  116. .RI "virtual void \fBmousePressEvent\fP (QMouseEvent *)"
  117. .br
  118. .ti -1c
  119. .RI "virtual void \fBmouseReleaseEvent\fP (QMouseEvent *)"
  120. .br
  121. .ti -1c
  122. .RI "virtual void \fBresizeEvent\fP (QResizeEvent *)"
  123. .br
  124. .ti -1c
  125. .RI "virtual void \fBpaintEvent\fP (QPaintEvent *)"
  126. .br
  127. .ti -1c
  128. .RI "virtual void \fBchangeEvent\fP (QEvent *)"
  129. .br
  130. .ti -1c
  131. .RI "virtual void \fBtimerEvent\fP (QTimerEvent *)"
  132. .br
  133. .ti -1c
  134. .RI "virtual void \fBscaleChange\fP ()"
  135. .br
  136. .RI "Notify changed scale\&. "
  137. .ti -1c
  138. .RI "QRect \fBsliderRect\fP () const"
  139. .br
  140. .ti -1c
  141. .RI "QRect \fBhandleRect\fP () const"
  142. .br
  143. .in -1c
  144. .SS "Additional Inherited Members"
  145. .SH "Detailed Description"
  146. .PP
  147. The Slider Widget\&.
  148. \fBQwtSlider\fP is a slider widget which operates on an interval of type double\&. Its position is related to a scale showing the current value\&.
  149. .PP
  150. The slider can be customized by having a through, a groove - or both\&.
  151. .PP
  152. .SH "Member Enumeration Documentation"
  153. .PP
  154. .SS "enum \fBQwtSlider::ScalePosition\fP"
  155. Position of the scale
  156. .PP
  157. \fBSee also\fP
  158. .RS 4
  159. \fBQwtSlider()\fP, \fBsetScalePosition()\fP, \fBsetOrientation()\fP
  160. .RE
  161. .PP
  162. .PP
  163. \fBEnumerator\fP
  164. .in +1c
  165. .TP
  166. \fB\fINoScale \fP\fP
  167. The slider has no scale\&.
  168. .TP
  169. \fB\fILeadingScale \fP\fP
  170. The scale is right of a vertical or below a horizontal slider\&.
  171. .TP
  172. \fB\fITrailingScale \fP\fP
  173. The scale is left of a vertical or above a horizontal slider\&.
  174. .SH "Constructor & Destructor Documentation"
  175. .PP
  176. .SS "QwtSlider::QwtSlider (QWidget * parent = \fCNULL\fP)\fC [explicit]\fP"
  177. Construct vertical slider in QwtSlider::Trough style with a scale to the left\&.
  178. .PP
  179. The scale is initialized to [0\&.0, 100\&.0] and the value set to 0\&.0\&.
  180. .PP
  181. \fBParameters\fP
  182. .RS 4
  183. \fIparent\fP Parent widget
  184. .RE
  185. .PP
  186. \fBSee also\fP
  187. .RS 4
  188. \fBsetOrientation()\fP, \fBsetScalePosition()\fP, setBackgroundStyle()
  189. .RE
  190. .PP
  191. .SS "QwtSlider::QwtSlider (Qt::Orientation orientation, QWidget * parent = \fCNULL\fP)\fC [explicit]\fP"
  192. Construct a slider in QwtSlider::Trough style
  193. .PP
  194. When orientation is Qt::Vertical the scale will be aligned to the left - otherwise at the the top of the slider\&.
  195. .PP
  196. The scale is initialized to [0\&.0, 100\&.0] and the value set to 0\&.0\&.
  197. .PP
  198. \fBParameters\fP
  199. .RS 4
  200. \fIparent\fP Parent widget
  201. .br
  202. \fIorientation\fP Orientation of the slider\&.
  203. .RE
  204. .PP
  205. .SH "Member Function Documentation"
  206. .PP
  207. .SS "int QwtSlider::borderWidth () const"
  208. .PP
  209. \fBReturns\fP
  210. .RS 4
  211. the border width\&.
  212. .RE
  213. .PP
  214. \fBSee also\fP
  215. .RS 4
  216. \fBsetBorderWidth()\fP
  217. .RE
  218. .PP
  219. .SS "void QwtSlider::changeEvent (QEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
  220. Handles QEvent::StyleChange and QEvent::FontChange events
  221. .PP
  222. \fBParameters\fP
  223. .RS 4
  224. \fIevent\fP Change event
  225. .RE
  226. .PP
  227. .SS "void QwtSlider::drawHandle (QPainter * painter, const QRect & handleRect, int pos) const\fC [protected]\fP, \fC [virtual]\fP"
  228. Draw the thumb at a position
  229. .PP
  230. \fBParameters\fP
  231. .RS 4
  232. \fIpainter\fP Painter
  233. .br
  234. \fIhandleRect\fP Bounding rectangle of the handle
  235. .br
  236. \fIpos\fP Position of the handle marker in widget coordinates
  237. .RE
  238. .PP
  239. .SS "void QwtSlider::drawSlider (QPainter * painter, const QRect & sliderRect) const\fC [protected]\fP, \fC [virtual]\fP"
  240. Draw the slider into the specified rectangle\&.
  241. .PP
  242. \fBParameters\fP
  243. .RS 4
  244. \fIpainter\fP Painter
  245. .br
  246. \fIsliderRect\fP Bounding rectangle of the slider
  247. .RE
  248. .PP
  249. .SS "QRect QwtSlider::handleRect () const\fC [protected]\fP"
  250. .PP
  251. \fBReturns\fP
  252. .RS 4
  253. Bounding rectangle of the slider handle
  254. .RE
  255. .PP
  256. .SS "QSize QwtSlider::handleSize () const"
  257. .PP
  258. \fBReturns\fP
  259. .RS 4
  260. Size of the handle\&.
  261. .RE
  262. .PP
  263. \fBSee also\fP
  264. .RS 4
  265. \fBsetHandleSize()\fP
  266. .RE
  267. .PP
  268. .SS "bool QwtSlider::hasGroove () const"
  269. .PP
  270. \fBReturns\fP
  271. .RS 4
  272. True, when the groove is visisble
  273. .RE
  274. .PP
  275. \fBSee also\fP
  276. .RS 4
  277. \fBsetGroove()\fP, \fBhasTrough()\fP
  278. .RE
  279. .PP
  280. .SS "bool QwtSlider::hasTrough () const"
  281. .PP
  282. \fBReturns\fP
  283. .RS 4
  284. True, when the trough is visisble
  285. .RE
  286. .PP
  287. \fBSee also\fP
  288. .RS 4
  289. \fBsetTrough()\fP, \fBhasGroove()\fP
  290. .RE
  291. .PP
  292. .SS "bool QwtSlider::isScrollPosition (const QPoint & pos) const\fC [protected]\fP, \fC [virtual]\fP"
  293. .PP
  294. Determine what to do when the user presses a mouse button\&.
  295. .PP
  296. \fBParameters\fP
  297. .RS 4
  298. \fIpos\fP Mouse position
  299. .RE
  300. .PP
  301. \fBReturn values\fP
  302. .RS 4
  303. \fITrue,when\fP \fBhandleRect()\fP contains pos
  304. .RE
  305. .PP
  306. \fBSee also\fP
  307. .RS 4
  308. \fBscrolledTo()\fP
  309. .RE
  310. .PP
  311. .PP
  312. Implements \fBQwtAbstractSlider\fP\&.
  313. .SS "QSize QwtSlider::minimumSizeHint () const\fC [virtual]\fP"
  314. .PP
  315. \fBReturns\fP
  316. .RS 4
  317. Minimum size hint
  318. .RE
  319. .PP
  320. \fBSee also\fP
  321. .RS 4
  322. \fBsizeHint()\fP
  323. .RE
  324. .PP
  325. .SS "void QwtSlider::mousePressEvent (QMouseEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
  326. Mouse press event handler
  327. .PP
  328. \fBParameters\fP
  329. .RS 4
  330. \fIevent\fP Mouse event
  331. .RE
  332. .PP
  333. .PP
  334. Reimplemented from \fBQwtAbstractSlider\fP\&.
  335. .SS "void QwtSlider::mouseReleaseEvent (QMouseEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
  336. Mouse release event handler
  337. .PP
  338. \fBParameters\fP
  339. .RS 4
  340. \fIevent\fP Mouse event
  341. .RE
  342. .PP
  343. .PP
  344. Reimplemented from \fBQwtAbstractSlider\fP\&.
  345. .SS "Qt::Orientation QwtSlider::orientation () const"
  346. .PP
  347. \fBReturns\fP
  348. .RS 4
  349. Orientation
  350. .RE
  351. .PP
  352. \fBSee also\fP
  353. .RS 4
  354. \fBsetOrientation()\fP
  355. .RE
  356. .PP
  357. .SS "void QwtSlider::paintEvent (QPaintEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
  358. Qt paint event handler
  359. .PP
  360. \fBParameters\fP
  361. .RS 4
  362. \fIevent\fP Paint event
  363. .RE
  364. .PP
  365. .SS "void QwtSlider::resizeEvent (QResizeEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
  366. Qt resize event handler
  367. .PP
  368. \fBParameters\fP
  369. .RS 4
  370. \fIevent\fP Resize event
  371. .RE
  372. .PP
  373. .SS "const \fBQwtScaleDraw\fP * QwtSlider::scaleDraw () const"
  374. .PP
  375. \fBReturns\fP
  376. .RS 4
  377. the scale draw of the slider
  378. .RE
  379. .PP
  380. \fBSee also\fP
  381. .RS 4
  382. \fBsetScaleDraw()\fP
  383. .RE
  384. .PP
  385. .SS "\fBQwtSlider::ScalePosition\fP QwtSlider::scalePosition () const"
  386. .PP
  387. \fBReturns\fP
  388. .RS 4
  389. Position of the scale
  390. .RE
  391. .PP
  392. \fBSee also\fP
  393. .RS 4
  394. \fBsetScalePosition()\fP
  395. .RE
  396. .PP
  397. .SS "double QwtSlider::scrolledTo (const QPoint & pos) const\fC [protected]\fP, \fC [virtual]\fP"
  398. .PP
  399. Determine the value for a new position of the slider handle\&.
  400. .PP
  401. \fBParameters\fP
  402. .RS 4
  403. \fIpos\fP Mouse position
  404. .RE
  405. .PP
  406. \fBReturns\fP
  407. .RS 4
  408. Value for the mouse position
  409. .RE
  410. .PP
  411. \fBSee also\fP
  412. .RS 4
  413. \fBisScrollPosition()\fP
  414. .RE
  415. .PP
  416. .PP
  417. Implements \fBQwtAbstractSlider\fP\&.
  418. .SS "void QwtSlider::setBorderWidth (int width)"
  419. .PP
  420. Change the slider's border width\&. The border width is used for drawing the slider handle and the trough\&.
  421. .PP
  422. \fBParameters\fP
  423. .RS 4
  424. \fIwidth\fP Border width
  425. .RE
  426. .PP
  427. \fBSee also\fP
  428. .RS 4
  429. \fBborderWidth()\fP
  430. .RE
  431. .PP
  432. .SS "void QwtSlider::setGroove (bool on)"
  433. En/Disable the groove
  434. .PP
  435. The slider can be cutomized by showing a groove for the handle\&.
  436. .PP
  437. \fBParameters\fP
  438. .RS 4
  439. \fIon\fP When true, the groove is visible
  440. .RE
  441. .PP
  442. \fBSee also\fP
  443. .RS 4
  444. \fBhasGroove()\fP, setThrough()
  445. .RE
  446. .PP
  447. .SS "void QwtSlider::setHandleSize (const QSize & size)"
  448. .PP
  449. Set the slider's handle size\&. When the size is empty the slider handle will be painted with a default size depending on its \fBorientation()\fP and backgroundStyle()\&.
  450. .PP
  451. \fBParameters\fP
  452. .RS 4
  453. \fIsize\fP New size
  454. .RE
  455. .PP
  456. \fBSee also\fP
  457. .RS 4
  458. \fBhandleSize()\fP
  459. .RE
  460. .PP
  461. .SS "void QwtSlider::setOrientation (Qt::Orientation orientation)"
  462. .PP
  463. Set the orientation\&.
  464. .PP
  465. \fBParameters\fP
  466. .RS 4
  467. \fIorientation\fP Allowed values are Qt::Horizontal and Qt::Vertical\&.
  468. .RE
  469. .PP
  470. \fBSee also\fP
  471. .RS 4
  472. \fBorientation()\fP, \fBscalePosition()\fP
  473. .RE
  474. .PP
  475. .SS "void QwtSlider::setScaleDraw (\fBQwtScaleDraw\fP * scaleDraw)"
  476. .PP
  477. Set a scale draw\&. For changing the labels of the scales, it is necessary to derive from \fBQwtScaleDraw\fP and overload \fBQwtScaleDraw::label()\fP\&.
  478. .PP
  479. \fBParameters\fP
  480. .RS 4
  481. \fIscaleDraw\fP ScaleDraw object, that has to be created with new and will be deleted in \fB~QwtSlider()\fP or the next call of \fBsetScaleDraw()\fP\&.
  482. .RE
  483. .PP
  484. \fBSee also\fP
  485. .RS 4
  486. scaleDraw()
  487. .RE
  488. .PP
  489. .SS "void QwtSlider::setScalePosition (\fBScalePosition\fP scalePosition)"
  490. .PP
  491. Change the position of the scale\&.
  492. .PP
  493. \fBParameters\fP
  494. .RS 4
  495. \fIscalePosition\fP Position of the scale\&.
  496. .RE
  497. .PP
  498. \fBSee also\fP
  499. .RS 4
  500. \fBScalePosition\fP, \fBscalePosition()\fP
  501. .RE
  502. .PP
  503. .SS "void QwtSlider::setSpacing (int spacing)"
  504. .PP
  505. Change the spacing between trough and scale\&. A spacing of 0 means, that the backbone of the scale is covered by the trough\&.
  506. .PP
  507. The default setting is 4 pixels\&.
  508. .PP
  509. \fBParameters\fP
  510. .RS 4
  511. \fIspacing\fP Number of pixels
  512. .RE
  513. .PP
  514. \fBSee also\fP
  515. .RS 4
  516. \fBspacing()\fP;
  517. .RE
  518. .PP
  519. .SS "void QwtSlider::setTrough (bool on)"
  520. En/Disable the trough
  521. .PP
  522. The slider can be cutomized by showing a trough for the handle\&.
  523. .PP
  524. \fBParameters\fP
  525. .RS 4
  526. \fIon\fP When true, the groove is visible
  527. .RE
  528. .PP
  529. \fBSee also\fP
  530. .RS 4
  531. \fBhasTrough()\fP, \fBsetGroove()\fP
  532. .RE
  533. .PP
  534. .SS "void QwtSlider::setUpdateInterval (int interval)"
  535. .PP
  536. Specify the update interval for automatic scrolling\&. The minimal accepted value is 50 ms\&.
  537. .PP
  538. \fBParameters\fP
  539. .RS 4
  540. \fIinterval\fP Update interval in milliseconds
  541. .RE
  542. .PP
  543. \fBSee also\fP
  544. .RS 4
  545. \fBsetUpdateInterval()\fP
  546. .RE
  547. .PP
  548. .SS "QSize QwtSlider::sizeHint () const\fC [virtual]\fP"
  549. .PP
  550. \fBReturns\fP
  551. .RS 4
  552. \fBminimumSizeHint()\fP
  553. .RE
  554. .PP
  555. .SS "QRect QwtSlider::sliderRect () const\fC [protected]\fP"
  556. .PP
  557. \fBReturns\fP
  558. .RS 4
  559. Bounding rectangle of the slider - without the scale
  560. .RE
  561. .PP
  562. .SS "int QwtSlider::spacing () const"
  563. .PP
  564. \fBReturns\fP
  565. .RS 4
  566. Number of pixels between slider and scale
  567. .RE
  568. .PP
  569. \fBSee also\fP
  570. .RS 4
  571. \fBsetSpacing()\fP
  572. .RE
  573. .PP
  574. .SS "void QwtSlider::timerEvent (QTimerEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
  575. Timer event handler
  576. .PP
  577. Handles the timer, when the mouse stays pressed inside the \fBsliderRect()\fP\&.
  578. .PP
  579. \fBParameters\fP
  580. .RS 4
  581. \fIevent\fP Mouse event
  582. .RE
  583. .PP
  584. .SS "int QwtSlider::updateInterval () const"
  585. .PP
  586. \fBReturns\fP
  587. .RS 4
  588. Update interval in milliseconds for automatic scrolling
  589. .RE
  590. .PP
  591. \fBSee also\fP
  592. .RS 4
  593. \fBsetUpdateInterval()\fP
  594. .RE
  595. .PP
  596. .SH "Author"
  597. .PP
  598. Generated automatically by Doxygen for Qwt User's Guide from the source code\&.