QwtPanner.3 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. .TH "QwtPanner" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. QwtPanner \- \fBQwtPanner\fP provides panning of a widget\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <qwt_panner\&.h>\fP
  11. .PP
  12. Inherits QWidget\&.
  13. .PP
  14. Inherited by \fBQwtPlotPanner\fP\&.
  15. .SS "Signals"
  16. .in +1c
  17. .ti -1c
  18. .RI "void \fBpanned\fP (int dx, int dy)"
  19. .br
  20. .ti -1c
  21. .RI "void \fBmoved\fP (int dx, int dy)"
  22. .br
  23. .in -1c
  24. .SS "Public Member Functions"
  25. .in +1c
  26. .ti -1c
  27. .RI "\fBQwtPanner\fP (QWidget *parent)"
  28. .br
  29. .ti -1c
  30. .RI "virtual \fB~QwtPanner\fP ()"
  31. .br
  32. .RI "Destructor\&. "
  33. .ti -1c
  34. .RI "void \fBsetEnabled\fP (bool)"
  35. .br
  36. .RI "En/disable the panner\&. "
  37. .ti -1c
  38. .RI "bool \fBisEnabled\fP () const"
  39. .br
  40. .ti -1c
  41. .RI "void \fBsetMouseButton\fP (Qt::MouseButton, Qt::KeyboardModifiers=Qt::NoModifier)"
  42. .br
  43. .ti -1c
  44. .RI "void \fBgetMouseButton\fP (Qt::MouseButton &button, Qt::KeyboardModifiers &) const"
  45. .br
  46. .RI "Get mouse button and modifiers used for panning\&. "
  47. .ti -1c
  48. .RI "void \fBsetAbortKey\fP (int key, Qt::KeyboardModifiers=Qt::NoModifier)"
  49. .br
  50. .ti -1c
  51. .RI "void \fBgetAbortKey\fP (int &key, Qt::KeyboardModifiers &) const"
  52. .br
  53. .RI "Get the abort key and modifiers\&. "
  54. .ti -1c
  55. .RI "void \fBsetCursor\fP (const QCursor &)"
  56. .br
  57. .ti -1c
  58. .RI "const QCursor \fBcursor\fP () const"
  59. .br
  60. .ti -1c
  61. .RI "void \fBsetOrientations\fP (Qt::Orientations)"
  62. .br
  63. .ti -1c
  64. .RI "Qt::Orientations \fBorientations\fP () const"
  65. .br
  66. .RI "Return the orientation, where paning is enabled\&. "
  67. .ti -1c
  68. .RI "bool \fBisOrientationEnabled\fP (Qt::Orientation) const"
  69. .br
  70. .ti -1c
  71. .RI "virtual bool \fBeventFilter\fP (QObject *, QEvent *)"
  72. .br
  73. .RI "Event filter\&. "
  74. .in -1c
  75. .SS "Protected Member Functions"
  76. .in +1c
  77. .ti -1c
  78. .RI "virtual void \fBwidgetMousePressEvent\fP (QMouseEvent *)"
  79. .br
  80. .ti -1c
  81. .RI "virtual void \fBwidgetMouseReleaseEvent\fP (QMouseEvent *)"
  82. .br
  83. .ti -1c
  84. .RI "virtual void \fBwidgetMouseMoveEvent\fP (QMouseEvent *)"
  85. .br
  86. .ti -1c
  87. .RI "virtual void \fBwidgetKeyPressEvent\fP (QKeyEvent *)"
  88. .br
  89. .ti -1c
  90. .RI "virtual void \fBwidgetKeyReleaseEvent\fP (QKeyEvent *)"
  91. .br
  92. .ti -1c
  93. .RI "virtual void \fBpaintEvent\fP (QPaintEvent *)"
  94. .br
  95. .RI "Paint event\&. "
  96. .ti -1c
  97. .RI "virtual QBitmap \fBcontentsMask\fP () const"
  98. .br
  99. .RI "Calculate a mask for the contents of the panned widget\&. "
  100. .ti -1c
  101. .RI "virtual QPixmap \fBgrab\fP () const"
  102. .br
  103. .in -1c
  104. .SH "Detailed Description"
  105. .PP
  106. \fBQwtPanner\fP provides panning of a widget\&.
  107. \fBQwtPanner\fP grabs the contents of a widget, that can be dragged in all directions\&. The offset between the start and the end position is emitted by the panned signal\&.
  108. .PP
  109. \fBQwtPanner\fP grabs the content of the widget into a pixmap and moves the pixmap around, without initiating any repaint events for the widget\&. Areas, that are not part of content are not painted while panning\&. This makes panning fast enough for widgets, where repaints are too slow for mouse movements\&.
  110. .PP
  111. For widgets, where repaints are very fast it might be better to implement panning manually by mapping mouse events into paint events\&.
  112. .SH "Constructor & Destructor Documentation"
  113. .PP
  114. .SS "QwtPanner::QwtPanner (QWidget * parent)"
  115. Creates an panner that is enabled for the left mouse button\&.
  116. .PP
  117. \fBParameters\fP
  118. .RS 4
  119. \fIparent\fP Parent widget to be panned
  120. .RE
  121. .PP
  122. .SH "Member Function Documentation"
  123. .PP
  124. .SS "QBitmap QwtPanner::contentsMask () const\fC [protected]\fP, \fC [virtual]\fP"
  125. .PP
  126. Calculate a mask for the contents of the panned widget\&. Sometimes only parts of the contents of a widget should be panned\&. F\&.e\&. for a widget with a styled background with rounded borders only the area inside of the border should be panned\&.
  127. .PP
  128. \fBReturns\fP
  129. .RS 4
  130. An empty bitmap, indicating no mask
  131. .RE
  132. .PP
  133. .PP
  134. Reimplemented in \fBQwtPlotPanner\fP\&.
  135. .SS "const QCursor QwtPanner::cursor () const"
  136. .PP
  137. \fBReturns\fP
  138. .RS 4
  139. Cursor that is active while panning
  140. .RE
  141. .PP
  142. \fBSee also\fP
  143. .RS 4
  144. \fBsetCursor()\fP
  145. .RE
  146. .PP
  147. .SS "bool QwtPanner::eventFilter (QObject * object, QEvent * event)\fC [virtual]\fP"
  148. .PP
  149. Event filter\&. When \fBisEnabled()\fP is true mouse events of the observed widget are filtered\&.
  150. .PP
  151. \fBParameters\fP
  152. .RS 4
  153. \fIobject\fP Object to be filtered
  154. .br
  155. \fIevent\fP Event
  156. .RE
  157. .PP
  158. \fBReturns\fP
  159. .RS 4
  160. Always false, beside for paint events for the parent widget\&.
  161. .RE
  162. .PP
  163. \fBSee also\fP
  164. .RS 4
  165. \fBwidgetMousePressEvent()\fP, \fBwidgetMouseReleaseEvent()\fP, \fBwidgetMouseMoveEvent()\fP
  166. .RE
  167. .PP
  168. .SS "QPixmap QwtPanner::grab () const\fC [protected]\fP, \fC [virtual]\fP"
  169. Grab the widget into a pixmap\&.
  170. .PP
  171. \fBReturns\fP
  172. .RS 4
  173. Grabbed pixmap
  174. .RE
  175. .PP
  176. .PP
  177. Reimplemented in \fBQwtPlotPanner\fP\&.
  178. .SS "bool QwtPanner::isEnabled () const"
  179. .PP
  180. \fBReturns\fP
  181. .RS 4
  182. true when enabled, false otherwise
  183. .RE
  184. .PP
  185. \fBSee also\fP
  186. .RS 4
  187. \fBsetEnabled\fP, \fBeventFilter()\fP
  188. .RE
  189. .PP
  190. .SS "bool QwtPanner::isOrientationEnabled (Qt::Orientation o) const"
  191. .PP
  192. \fBReturns\fP
  193. .RS 4
  194. True if an orientation is enabled
  195. .RE
  196. .PP
  197. \fBSee also\fP
  198. .RS 4
  199. \fBorientations()\fP, \fBsetOrientations()\fP
  200. .RE
  201. .PP
  202. .SS "void QwtPanner::moved (int dx, int dy)\fC [signal]\fP"
  203. Signal emitted, while the widget moved, but panning is not finished\&.
  204. .PP
  205. \fBParameters\fP
  206. .RS 4
  207. \fIdx\fP Offset in horizontal direction
  208. .br
  209. \fIdy\fP Offset in vertical direction
  210. .RE
  211. .PP
  212. .SS "void QwtPanner::paintEvent (QPaintEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
  213. .PP
  214. Paint event\&. Repaint the grabbed pixmap on its current position and fill the empty spaces by the background of the parent widget\&.
  215. .PP
  216. \fBParameters\fP
  217. .RS 4
  218. \fIevent\fP Paint event
  219. .RE
  220. .PP
  221. .SS "void QwtPanner::panned (int dx, int dy)\fC [signal]\fP"
  222. Signal emitted, when panning is done
  223. .PP
  224. \fBParameters\fP
  225. .RS 4
  226. \fIdx\fP Offset in horizontal direction
  227. .br
  228. \fIdy\fP Offset in vertical direction
  229. .RE
  230. .PP
  231. .SS "void QwtPanner::setAbortKey (int key, Qt::KeyboardModifiers modifiers = \fCQt::NoModifier\fP)"
  232. Change the abort key The defaults are Qt::Key_Escape and Qt::NoModifiers
  233. .PP
  234. \fBParameters\fP
  235. .RS 4
  236. \fIkey\fP Key ( See Qt::Keycode )
  237. .br
  238. \fImodifiers\fP Keyboard modifiers
  239. .RE
  240. .PP
  241. .SS "void QwtPanner::setCursor (const QCursor & cursor)"
  242. Change the cursor, that is active while panning The default is the cursor of the parent widget\&.
  243. .PP
  244. \fBParameters\fP
  245. .RS 4
  246. \fIcursor\fP New cursor
  247. .RE
  248. .PP
  249. \fBSee also\fP
  250. .RS 4
  251. \fBsetCursor()\fP
  252. .RE
  253. .PP
  254. .SS "void QwtPanner::setEnabled (bool on)"
  255. .PP
  256. En/disable the panner\&. When enabled is true an event filter is installed for the observed widget, otherwise the event filter is removed\&.
  257. .PP
  258. \fBParameters\fP
  259. .RS 4
  260. \fIon\fP true or false
  261. .RE
  262. .PP
  263. \fBSee also\fP
  264. .RS 4
  265. \fBisEnabled()\fP, \fBeventFilter()\fP
  266. .RE
  267. .PP
  268. .SS "void QwtPanner::setMouseButton (Qt::MouseButton button, Qt::KeyboardModifiers modifiers = \fCQt::NoModifier\fP)"
  269. Change the mouse button and modifiers used for panning The defaults are Qt::LeftButton and Qt::NoModifier
  270. .SS "void QwtPanner::setOrientations (Qt::Orientations o)"
  271. Set the orientations, where panning is enabled The default value is in both directions: Qt::Horizontal | Qt::Vertical
  272. .PP
  273. /param o Orientation
  274. .SS "void QwtPanner::widgetKeyPressEvent (QKeyEvent * keyEvent)\fC [protected]\fP, \fC [virtual]\fP"
  275. Handle a key press event for the observed widget\&.
  276. .PP
  277. \fBParameters\fP
  278. .RS 4
  279. \fIkeyEvent\fP Key event
  280. .RE
  281. .PP
  282. \fBSee also\fP
  283. .RS 4
  284. \fBeventFilter()\fP, \fBwidgetKeyReleaseEvent()\fP
  285. .RE
  286. .PP
  287. .SS "void QwtPanner::widgetKeyReleaseEvent (QKeyEvent * keyEvent)\fC [protected]\fP, \fC [virtual]\fP"
  288. Handle a key release event for the observed widget\&.
  289. .PP
  290. \fBParameters\fP
  291. .RS 4
  292. \fIkeyEvent\fP Key event
  293. .RE
  294. .PP
  295. \fBSee also\fP
  296. .RS 4
  297. \fBeventFilter()\fP, \fBwidgetKeyReleaseEvent()\fP
  298. .RE
  299. .PP
  300. .SS "void QwtPanner::widgetMouseMoveEvent (QMouseEvent * mouseEvent)\fC [protected]\fP, \fC [virtual]\fP"
  301. Handle a mouse move event for the observed widget\&.
  302. .PP
  303. \fBParameters\fP
  304. .RS 4
  305. \fImouseEvent\fP Mouse event
  306. .RE
  307. .PP
  308. \fBSee also\fP
  309. .RS 4
  310. \fBeventFilter()\fP, \fBwidgetMousePressEvent()\fP, \fBwidgetMouseReleaseEvent()\fP
  311. .RE
  312. .PP
  313. .SS "void QwtPanner::widgetMousePressEvent (QMouseEvent * mouseEvent)\fC [protected]\fP, \fC [virtual]\fP"
  314. Handle a mouse press event for the observed widget\&.
  315. .PP
  316. \fBParameters\fP
  317. .RS 4
  318. \fImouseEvent\fP Mouse event
  319. .RE
  320. .PP
  321. \fBSee also\fP
  322. .RS 4
  323. \fBeventFilter()\fP, \fBwidgetMouseReleaseEvent()\fP, \fBwidgetMouseMoveEvent()\fP,
  324. .RE
  325. .PP
  326. .SS "void QwtPanner::widgetMouseReleaseEvent (QMouseEvent * mouseEvent)\fC [protected]\fP, \fC [virtual]\fP"
  327. Handle a mouse release event for the observed widget\&.
  328. .PP
  329. \fBParameters\fP
  330. .RS 4
  331. \fImouseEvent\fP Mouse event
  332. .RE
  333. .PP
  334. \fBSee also\fP
  335. .RS 4
  336. \fBeventFilter()\fP, \fBwidgetMousePressEvent()\fP, \fBwidgetMouseMoveEvent()\fP,
  337. .RE
  338. .PP
  339. .SH "Author"
  340. .PP
  341. Generated automatically by Doxygen for Qwt User's Guide from the source code\&.