QwtPanner(3)
πΈ NAME πΈ
QwtPanner β QwtPanner provides panning of a widget.
okay bestie, welcome to the QwtPanner(3) page from the Library Functions Manual, aka the Qwt User's Guide universe π
This class is literally about panning a widget around, and it's giving βdrag the whole vibeβ energy.
β¨ SYNOPSIS β¨
#include <qwt_panner.h>
Inherits QWidget.
Inherited by QwtPlotPanner, and QwtPolarPanner.
π Signals
void panned (int dx, int dy)
void moved (int dx, int dy)
π«Ά Public Member Functions
QwtPanner (QWidget *parent)
virtual ~QwtPanner ()
Destructor.
void setEnabled (bool)
En/disable the panner.
bool isEnabled () const
void setMouseButton (Qt::MouseButton,
Qt::KeyboardModifiers=Qt::NoModifier)
void getMouseButton (Qt::MouseButton &button, Qt::KeyboardModifiers &)
const
Get mouse button and modifiers used for panning.
void setAbortKey (int key, Qt::KeyboardModifiers=Qt::NoModifier)
void getAbortKey (int &key, Qt::KeyboardModifiers &) const
Get the abort key and modifiers.
void setCursor (const QCursor &)
const QCursor cursor () const
void setOrientations (Qt::Orientations)
Qt::Orientations orientations () const
Return the orientation, where panning is enabled.
bool isOrientationEnabled (Qt::Orientation) const
virtual bool eventFilter (QObject *, QEvent *) override
Event filter.
π§ Protected Member Functions
virtual void widgetMousePressEvent (QMouseEvent *)
virtual void widgetMouseReleaseEvent (QMouseEvent *)
virtual void widgetMouseMoveEvent (QMouseEvent *)
virtual void widgetKeyPressEvent (QKeyEvent *)
virtual void widgetKeyReleaseEvent (QKeyEvent *)
virtual void paintEvent (QPaintEvent *) override
Paint event.
virtual QBitmap contentsMask () const
Calculate a mask for the contents of the panned widget.
virtual QPixmap grab () const
π Detailed Description
QwtPanner provides panning of a widget. No cap β¨
QwtPanner grabs the contents of a widget, and that content can be dragged in all directions. The offset between the start and the end position is emitted by the panned signal.
Here's the whole slay: QwtPanner 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 π₯
For widgets where repaints are very fast, it might be better to implement panning manually by mapping mouse events into paint events.
Definition at line 35 of file qwt_panner.h.
π Constructor & Destructor Documentation
QwtPanner::QwtPanner (QWidget * parent) [explicit]
Creates an panner that is enabled for the left mouse button. (Yes, the original really says βan pannerβ π we are keeping the lore.)
- Parameters
parentβ Parent widget to be panned
Definition at line 87 of file qwt_panner.cpp.
QwtPanner::~QwtPanner () [virtual]
Destructor. It's giving cleanup era π§Ήβ¨
Definition at line 101 of file qwt_panner.cpp.
π₯ Member Function Documentation
QBitmap QwtPanner::contentsMask () const [protected], [virtual]
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 π
- Returns: An empty bitmap, indicating no mask
- Reimplemented in:
QwtPlotPanner
Definition at line 297 of file qwt_panner.cpp.
const QCursor QwtPanner::cursor () const
- Returns: Cursor that is active while panning
- See also:
setCursor()
Definition at line 167 of file qwt_panner.cpp.
bool QwtPanner::eventFilter (QObject * object, QEvent * event) [override], [virtual]
Event filter. When isEnabled() is true, mouse events of the observed widget are filtered π
- Parameters
objectβ Object to be filteredeventβ Event
- Returns: Always false, beside for paint events for the parent widget.
- See also:
widgetMousePressEvent(),widgetMouseReleaseEvent(),widgetMouseMoveEvent()
Definition at line 330 of file qwt_panner.cpp.
void QwtPanner::getAbortKey (int & key, Qt::KeyboardModifiers & modifiers) const
Get the abort key and modifiers.
Definition at line 140 of file qwt_panner.cpp.
void QwtPanner::getMouseButton (Qt::MouseButton & button, Qt::KeyboardModifiers & modifiers) const
Get mouse button and modifiers used for panning.
Definition at line 118 of file qwt_panner.cpp.
QPixmap QwtPanner::grab () const [protected], [virtual]
Grab the widget into a pixmap.
- Returns: Grabbed pixmap
- Reimplemented in:
QwtPlotPanner
Definition at line 306 of file qwt_panner.cpp.
bool QwtPanner::isEnabled () const
- Returns:
truewhen enabled,falseotherwise - See also:
setEnabled,eventFilter()
Definition at line 240 of file qwt_panner.cpp.
bool QwtPanner::isOrientationEnabled (Qt::Orientation o) const
- Returns: True if an orientation is enabled
- See also:
orientations(),setOrientations()
Definition at line 231 of file qwt_panner.cpp.
void QwtPanner::moved (int dx, int dy) [signal]
Signal emitted, while the widget moved, but panning is not finished.
- Parameters
dxβ Offset in horizontal directiondyβ Offset in vertical direction
Qt::Orientations QwtPanner::orientations () const
Return the orientation, where panning is enabled.
Definition at line 222 of file qwt_panner.cpp.
void QwtPanner::paintEvent (QPaintEvent * event) [override], [protected], [virtual]
Paint event. Repaint the grabbed pixmap on its current position and fill the empty spaces by the background of the parent widget π¨
- Parameters
eventβ Paint event
Definition at line 253 of file qwt_panner.cpp.
void QwtPanner::panned (int dx, int dy) [signal]
Signal emitted, when panning is done.
- Parameters
dxβ Offset in horizontal directiondyβ Offset in vertical direction
void QwtPanner::setAbortKey (int key, Qt::KeyboardModifiers modifiers = Qt::NoModifier)
Change the abort key. The defaults are Qt::Key_Escape and Qt::NoModifiers (yes, the prose says NoModifiers while the signature default is Qt::NoModifier β typo lore π).
- Parameters
keyβ Key ( SeeQt::Keycode)modifiersβ Keyboard modifiers
Definition at line 132 of file qwt_panner.cpp.
void QwtPanner::setCursor (const QCursor & cursor)
Change the cursor that is active while panning. The default is the cursor of the parent widget.
- Parameters
cursorβ New cursor
- See also:
setCursor()
Definition at line 156 of file qwt_panner.cpp.
void QwtPanner::setEnabled (bool on)
En/disable the panner. When enabled is true, an event filter is installed for the observed widget; otherwise the event filter is removed.
- Parameters
onβtrueorfalse
- See also:
isEnabled(),eventFilter()
Definition at line 188 of file qwt_panner.cpp.
void QwtPanner::setMouseButton (Qt::MouseButton button, Qt::KeyboardModifiers modifiers = Qt::NoModifier)
Change the mouse button and modifiers used for panning. The defaults are Qt::LeftButton and Qt::NoModifier.
Definition at line 110 of file qwt_panner.cpp.
void QwtPanner::setOrientations (Qt::Orientations o)
Set the orientations where panning is enabled. The default value is in both directions: Qt::Horizontal | Qt::Vertical.
And the page literally drops this malformed line, so we're keeping it exactly:
/param o Orientation
Definition at line 216 of file qwt_panner.cpp.
void QwtPanner::widgetKeyPressEvent (QKeyEvent * keyEvent) [protected], [virtual]
Handle a key press event for the observed widget.
- Parameters
keyEventβ Key event
- See also:
eventFilter(),widgetKeyReleaseEvent()
Definition at line 482 of file qwt_panner.cpp.
void QwtPanner::widgetKeyReleaseEvent (QKeyEvent * keyEvent) [protected], [virtual]
Handle a key release event for the observed widget.
- Parameters
keyEventβ Key event
- See also:
eventFilter(),widgetKeyReleaseEvent()
Definition at line 502 of file qwt_panner.cpp.
void QwtPanner::widgetMouseMoveEvent (QMouseEvent * mouseEvent) [protected], [virtual]
Handle a mouse move event for the observed widget.
- Parameters
mouseEventβ Mouse event
- See also:
eventFilter(),widgetMousePressEvent(),widgetMouseReleaseEvent()
Definition at line 421 of file qwt_panner.cpp.
void QwtPanner::widgetMousePressEvent (QMouseEvent * mouseEvent) [protected], [virtual]
Handle a mouse press event for the observed widget.
- Parameters
mouseEventβ Mouse event
- See also:
eventFilter(),widgetMouseReleaseEvent(),widgetMouseMoveEvent(), - Reimplemented in:
QwtPolarPanner
Definition at line 381 of file qwt_panner.cpp.
void QwtPanner::widgetMouseReleaseEvent (QMouseEvent * mouseEvent) [protected], [virtual]
Handle a mouse release event for the observed widget.
- Parameters
mouseEventβ Mouse event
- See also:
eventFilter(),widgetMousePressEvent(),widgetMouseMoveEvent(),
Definition at line 449 of file qwt_panner.cpp.
π¦ Author
Generated automatically by Doxygen for Qwt User's Guide from the source code.
okay that's the whole page bestie π signing off from the Qwt User's Guide manual, page QwtPanner(3) β that's the source/version and page tag in the footer. The page doesn't show a date, so I'm not inventing one, periodt πβ¨π«Ά
π¦ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms