1
.TH "QwtPanner" 3 "22 Mar 2009" "Version 5.1.2" "Qwt User's Guide" \" -*- nroff -*-
9
Inherited by \fBQwtPlotPanner\fP.
11
.SH "Detailed Description"
13
\fBQwtPanner\fP provides panning of a widget.
15
\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.
17
\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 in in process. This makes panning fast enough for widgets, where repaints are too slow for mouse movements.
19
For widgets, where repaints are very fast it might be better to implement panning manually by mapping mouse events into paint events.
21
Definition at line 35 of file qwt_panner.h.
26
.RI "void \fBpanned\fP (int dx, int dy)"
29
.RI "void \fBmoved\fP (int dx, int dy)"
32
.SS "Public Member Functions"
36
.RI "\fBQwtPanner\fP (QWidget *parent)"
39
.RI "virtual \fB~QwtPanner\fP ()"
42
.RI "void \fBsetEnabled\fP (bool)"
45
.RI "bool \fBisEnabled\fP () const"
48
.RI "void \fBsetMouseButton\fP (int button, int buttonState=Qt::NoButton)"
51
.RI "void \fBgetMouseButton\fP (int &button, int &buttonState) const "
54
.RI "void \fBsetAbortKey\fP (int key, int state=Qt::NoButton)"
57
.RI "void \fBgetAbortKey\fP (int &key, int &state) const "
60
.RI "void \fBsetCursor\fP (const QCursor &)"
63
.RI "const QCursor \fBcursor\fP () const"
66
.RI "void \fBsetOrientations\fP (Qt::Orientations)"
69
.RI "Qt::Orientations \fBorientations\fP () const"
72
.RI "bool \fBisOrientationEnabled\fP (Qt::Orientation) const"
75
.RI "virtual bool \fBeventFilter\fP (QObject *, QEvent *)"
78
.SS "Protected Member Functions"
82
.RI "virtual void \fBwidgetMousePressEvent\fP (QMouseEvent *)"
85
.RI "virtual void \fBwidgetMouseReleaseEvent\fP (QMouseEvent *)"
88
.RI "virtual void \fBwidgetMouseMoveEvent\fP (QMouseEvent *)"
91
.RI "virtual void \fBwidgetKeyPressEvent\fP (QKeyEvent *)"
94
.RI "virtual void \fBwidgetKeyReleaseEvent\fP (QKeyEvent *)"
97
.RI "virtual void \fBpaintEvent\fP (QPaintEvent *)"
100
.SH "Constructor & Destructor Documentation"
102
.SS "QwtPanner::QwtPanner (QWidget * parent)"
104
Creates an panner that is enabled for the left mouse button.
108
\fIparent\fP Parent widget to be panned
113
Definition at line 121 of file qwt_panner.cpp.
115
References setEnabled().
116
.SS "QwtPanner::~QwtPanner ()\fC [virtual]\fP"
120
Definition at line 140 of file qwt_panner.cpp.
121
.SH "Member Function Documentation"
123
.SS "void QwtPanner::setEnabled (bool on)"
125
En/disable the panner.
127
When enabled is true an event filter is installed for the observed widget, otherwise the event filter is removed.
131
\fIon\fP true or false
136
\fBisEnabled()\fP, \fBeventFilter()\fP
141
Definition at line 220 of file qwt_panner.cpp.
143
Referenced by QwtPanner(), and widgetMousePressEvent().
144
.SS "bool QwtPanner::isEnabled () const"
148
true when enabled, false otherwise
153
\fBsetEnabled\fP, \fBeventFilter()\fP
158
Definition at line 287 of file qwt_panner.cpp.
159
.SS "void QwtPanner::setMouseButton (int button, int buttonState = \fCQt::NoButton\fP)"
161
Change the mouse button The defaults are Qt::LeftButton and Qt::NoButton
163
Definition at line 149 of file qwt_panner.cpp.
164
.SS "void QwtPanner::getMouseButton (int & button, int & buttonState) const"
166
Get the mouse button.
168
Definition at line 156 of file qwt_panner.cpp.
169
.SS "void QwtPanner::setAbortKey (int key, int state = \fCQt::NoButton\fP)"
171
Change the abort key The defaults are Qt::Key_Escape and Qt::NoButton
173
Definition at line 166 of file qwt_panner.cpp.
174
.SS "void QwtPanner::getAbortKey (int & key, int & state) const"
178
Definition at line 173 of file qwt_panner.cpp.
179
.SS "void QwtPanner::setCursor (const QCursor & cursor)"
181
Change the cursor, that is active while panning The default is the cursor of the parent widget.
185
\fIcursor\fP New cursor
195
Definition at line 188 of file qwt_panner.cpp.
196
.SS "const QCursor QwtPanner::cursor () const"
200
Cursor that is active while panning
210
Definition at line 199 of file qwt_panner.cpp.
211
.SS "void QwtPanner::setOrientations (Qt::Orientations o)"
213
Set the orientations, where panning is enabled The default value is in both directions: Qt::Horizontal | Qt::Vertical
217
Definition at line 249 of file qwt_panner.cpp.
218
.SS "Qt::Orientations QwtPanner::orientations () const"
220
Return the orientation, where paning is enabled.
222
Definition at line 255 of file qwt_panner.cpp.
223
.SS "bool QwtPanner::isOrientationEnabled (Qt::Orientation o) const"
225
Return true if a orientatio is enabled
229
\fBorientations()\fP, \fBsetOrientations()\fP
234
Definition at line 272 of file qwt_panner.cpp.
236
Referenced by widgetMouseMoveEvent(), and widgetMouseReleaseEvent().
237
.SS "bool QwtPanner::eventFilter (QObject * o, QEvent * e)\fC [virtual]\fP"
241
When \fBisEnabled()\fP the mouse events of the observed widget are filtered.
245
\fBwidgetMousePressEvent()\fP, \fBwidgetMouseReleaseEvent()\fP, \fBwidgetMouseMoveEvent()\fP
250
Definition at line 341 of file qwt_panner.cpp.
252
References widgetKeyPressEvent(), widgetKeyReleaseEvent(), widgetMouseMoveEvent(), widgetMousePressEvent(), and widgetMouseReleaseEvent().
253
.SS "void QwtPanner::panned (int dx, int dy)\fC [signal]\fP"
255
Signal emitted, when panning is done
259
\fIdx\fP Offset in horizontal direction
261
\fIdy\fP Offset in vertical direction
266
Referenced by QwtPlotPanner::QwtPlotPanner(), and widgetMouseReleaseEvent().
267
.SS "void QwtPanner::moved (int dx, int dy)\fC [signal]\fP"
269
Signal emitted, while the widget moved, but panning is not finished.
273
\fIdx\fP Offset in horizontal direction
275
\fIdy\fP Offset in vertical direction
280
Referenced by widgetMouseMoveEvent().
281
.SS "void QwtPanner::widgetMousePressEvent (QMouseEvent * me)\fC [protected, virtual]\fP"
283
Handle a mouse press event for the observed widget.
292
\fBeventFilter()\fP, \fBwidgetMouseReleaseEvent()\fP, \fBwidgetMouseMoveEvent()\fP,
297
Definition at line 392 of file qwt_panner.cpp.
299
References setEnabled().
301
Referenced by eventFilter().
302
.SS "void QwtPanner::widgetMouseReleaseEvent (QMouseEvent * me)\fC [protected, virtual]\fP"
304
Handle a mouse release event for the observed widget.
313
\fBeventFilter()\fP, \fBwidgetMousePressEvent()\fP, \fBwidgetMouseMoveEvent()\fP,
318
Definition at line 474 of file qwt_panner.cpp.
320
References isOrientationEnabled(), and panned().
322
Referenced by eventFilter().
323
.SS "void QwtPanner::widgetMouseMoveEvent (QMouseEvent * me)\fC [protected, virtual]\fP"
325
Handle a mouse move event for the observed widget.
334
\fBeventFilter()\fP, \fBwidgetMousePressEvent()\fP, \fBwidgetMouseReleaseEvent()\fP
339
Definition at line 446 of file qwt_panner.cpp.
341
References isOrientationEnabled(), and moved().
343
Referenced by eventFilter().
344
.SS "void QwtPanner::widgetKeyPressEvent (QKeyEvent * ke)\fC [protected, virtual]\fP"
346
Handle a key press event for the observed widget.
355
\fBeventFilter()\fP, \fBwidgetKeyReleaseEvent()\fP
360
Definition at line 506 of file qwt_panner.cpp.
362
Referenced by eventFilter().
363
.SS "void QwtPanner::widgetKeyReleaseEvent (QKeyEvent *)\fC [protected, virtual]\fP"
365
Handle a key release event for the observed widget.
374
\fBeventFilter()\fP, \fBwidgetKeyReleaseEvent()\fP
379
Definition at line 535 of file qwt_panner.cpp.
381
Referenced by eventFilter().
382
.SS "void QwtPanner::paintEvent (QPaintEvent * pe)\fC [protected, virtual]\fP"
386
Repaint the grabbed pixmap on its current position and fill the empty spaces by the background of the parent widget.
395
Definition at line 300 of file qwt_panner.cpp.
399
Generated automatically by Doxygen for Qwt User's Guide from the source code.