QwtMagnifier provides zooming by magnifying in steps.
More...
#include <qwt_magnifier.h>
|
| | QwtMagnifier (QWidget *) |
| | Constructor.
|
| |
| QWidget * | parentWidget () |
| | Return the parent widget where the rescaling happens.
|
| |
| const QWidget * | parentWidget () const |
| | Return the parent widget where the rescaling happens.
|
| |
| void | setEnabled (bool) |
| | En/disable the magnifier.
|
| |
| bool | isEnabled () const |
| | Return whether the magnifier is enabled.
|
| |
| void | setMouseFactor (double) |
| | Change the mouse factor.
|
| |
| double | mouseFactor () const |
| | Return the mouse factor.
|
| |
| void | setMouseButton (Qt::MouseButton, Qt::KeyboardModifiers=Qt::NoModifier) |
| | Assign the mouse button that is used for zooming in/out.
|
| |
| void | getMouseButton (Qt::MouseButton &, Qt::KeyboardModifiers &) const |
| | Get the mouse button and modifiers used for zooming.
|
| |
| void | setWheelFactor (double) |
| | Change the wheel factor.
|
| |
| double | wheelFactor () const |
| | Return the wheel factor.
|
| |
| void | setWheelModifiers (Qt::KeyboardModifiers) |
| | Assign keyboard modifiers for zooming in/out using the wheel.
|
| |
| Qt::KeyboardModifiers | wheelModifiers () const |
| | Return the wheel modifiers.
|
| |
| void | setKeyFactor (double) |
| | Change the key factor.
|
| |
| double | keyFactor () const |
| | Return the key factor.
|
| |
| void | setZoomInKey (int key, Qt::KeyboardModifiers=Qt::NoModifier) |
| | Assign the key that is used for zooming in.
|
| |
| void | getZoomInKey (int &key, Qt::KeyboardModifiers &) const |
| | Retrieve the settings of the zoom in key.
|
| |
| void | setZoomOutKey (int key, Qt::KeyboardModifiers=Qt::NoModifier) |
| | Assign the key that is used for zooming out.
|
| |
| void | getZoomOutKey (int &key, Qt::KeyboardModifiers &) const |
| | Retrieve the settings of the zoom out key.
|
| |
| virtual bool | eventFilter (QObject *, QEvent *) override |
| | Event filter.
|
| |
|
|
virtual void | rescale (double factor)=0 |
| |
| virtual void | widgetMousePressEvent (QMouseEvent *) |
| | Handle a mouse press event for the observed widget.
|
| |
| virtual void | widgetMouseReleaseEvent (QMouseEvent *) |
| | Handle a mouse release event for the observed widget.
|
| |
| virtual void | widgetMouseMoveEvent (QMouseEvent *) |
| | Handle a mouse move event for the observed widget.
|
| |
| virtual void | widgetWheelEvent (QWheelEvent *) |
| | Handle a wheel event for the observed widget.
|
| |
| virtual void | widgetKeyPressEvent (QKeyEvent *) |
| | Handle a key press event for the observed widget.
|
| |
| virtual void | widgetKeyReleaseEvent (QKeyEvent *) |
| | Handle a key release event for the observed widget.
|
| |
QwtMagnifier provides zooming by magnifying in steps.
Using QwtMagnifier a plot can be zoomed in/out in steps using keys, the mouse wheel or moving a mouse button in vertical direction.
◆ QwtMagnifier()
| QwtMagnifier::QwtMagnifier |
( |
QWidget * |
parent | ) |
|
|
explicit |
Constructor.
- Parameters
-
| [in] | parent | Widget to be magnified |
Destructor
◆ eventFilter()
| bool QwtMagnifier::eventFilter |
( |
QObject * |
object, |
|
|
QEvent * |
event |
|
) |
| |
|
overridevirtual |
◆ getMouseButton()
| void QwtMagnifier::getMouseButton |
( |
Qt::MouseButton & |
button, |
|
|
Qt::KeyboardModifiers & |
modifiers |
|
) |
| const |
Get the mouse button and modifiers used for zooming.
- Parameters
-
| [out] | button | Mouse button used for zooming |
| [out] | modifiers | Keyboard modifiers used for zooming |
- See also
- setMouseButton()
◆ getZoomInKey()
| void QwtMagnifier::getZoomInKey |
( |
int & |
key, |
|
|
Qt::KeyboardModifiers & |
modifiers |
|
) |
| const |
Retrieve the settings of the zoom in key.
- Parameters
-
| [out] | key | Key code, see Qt::Key |
| [out] | modifiers | Keyboard modifiers |
- See also
- setZoomInKey()
◆ getZoomOutKey()
| void QwtMagnifier::getZoomOutKey |
( |
int & |
key, |
|
|
Qt::KeyboardModifiers & |
modifiers |
|
) |
| const |
Retrieve the settings of the zoom out key.
- Parameters
-
| [out] | key | Key code, see Qt::Key |
| [out] | modifiers | Keyboard modifiers |
- See also
- setZoomOutKey()
◆ isEnabled()
| bool QwtMagnifier::isEnabled |
( |
| ) |
const |
◆ keyFactor()
| double QwtMagnifier::keyFactor |
( |
| ) |
const |
◆ mouseFactor()
| double QwtMagnifier::mouseFactor |
( |
| ) |
const |
◆ parentWidget() [1/2]
| QWidget * QwtMagnifier::parentWidget |
( |
| ) |
|
Return the parent widget where the rescaling happens.
- Returns
- Parent widget
◆ parentWidget() [2/2]
| const QWidget * QwtMagnifier::parentWidget |
( |
| ) |
const |
Return the parent widget where the rescaling happens.
- Returns
- Parent widget (const)
◆ setEnabled()
| void QwtMagnifier::setEnabled |
( |
bool |
on | ) |
|
En/disable the magnifier.
When enabled is true an event filter is installed for the observed widget, otherwise the event filter is removed.
- Parameters
-
- See also
- isEnabled(), eventFilter()
◆ setKeyFactor()
| void QwtMagnifier::setKeyFactor |
( |
double |
factor | ) |
|
◆ setMouseButton()
| void QwtMagnifier::setMouseButton |
( |
Qt::MouseButton |
button, |
|
|
Qt::KeyboardModifiers |
modifiers = Qt::NoModifier |
|
) |
| |
Assign the mouse button that is used for zooming in/out.
The default value is Qt::RightButton.
- Parameters
-
| [in] | button | Button |
| [in] | modifiers | Keyboard modifiers |
- See also
- getMouseButton()
◆ setMouseFactor()
| void QwtMagnifier::setMouseFactor |
( |
double |
factor | ) |
|
◆ setWheelFactor()
| void QwtMagnifier::setWheelFactor |
( |
double |
factor | ) |
|
Change the wheel factor.
The wheel factor defines the ratio between the current range on the parent widget and the zoomed range for each step of the wheel. Use values > 1 for magnification (i.e. 2.0) and values < 1 for scaling down (i.e. 1/2.0 = 0.5). You can use this feature for inverting the direction of the wheel. The default value is 0.9.
- Parameters
-
- See also
- wheelFactor(), setWheelButtonState(), setMouseFactor(), setKeyFactor()
◆ setWheelModifiers()
| void QwtMagnifier::setWheelModifiers |
( |
Qt::KeyboardModifiers |
modifiers | ) |
|
Assign keyboard modifiers for zooming in/out using the wheel.
The default modifiers are Qt::NoModifiers.
- Parameters
-
| [in] | modifiers | Keyboard modifiers |
- See also
- wheelModifiers()
◆ setZoomInKey()
| void QwtMagnifier::setZoomInKey |
( |
int |
key, |
|
|
Qt::KeyboardModifiers |
modifiers = Qt::NoModifier |
|
) |
| |
Assign the key that is used for zooming in.
The default combination is Qt::Key_Plus + Qt::NoModifier.
- Parameters
-
| [in] | key | Key code |
| [in] | modifiers | Keyboard modifiers |
- See also
- getZoomInKey(), setZoomOutKey()
◆ setZoomOutKey()
| void QwtMagnifier::setZoomOutKey |
( |
int |
key, |
|
|
Qt::KeyboardModifiers |
modifiers = Qt::NoModifier |
|
) |
| |
Assign the key that is used for zooming out.
The default combination is Qt::Key_Minus + Qt::NoModifier.
- Parameters
-
| [in] | key | Key code |
| [in] | modifiers | Keyboard modifiers |
- See also
- getZoomOutKey(), setZoomInKey()
◆ wheelFactor()
| double QwtMagnifier::wheelFactor |
( |
| ) |
const |
◆ wheelModifiers()
| Qt::KeyboardModifiers QwtMagnifier::wheelModifiers |
( |
| ) |
const |
◆ widgetKeyPressEvent()
| void QwtMagnifier::widgetKeyPressEvent |
( |
QKeyEvent * |
keyEvent | ) |
|
|
protectedvirtual |
◆ widgetKeyReleaseEvent()
| void QwtMagnifier::widgetKeyReleaseEvent |
( |
QKeyEvent * |
keyEvent | ) |
|
|
protectedvirtual |
◆ widgetMouseMoveEvent()
| void QwtMagnifier::widgetMouseMoveEvent |
( |
QMouseEvent * |
mouseEvent | ) |
|
|
protectedvirtual |
◆ widgetMousePressEvent()
| void QwtMagnifier::widgetMousePressEvent |
( |
QMouseEvent * |
mouseEvent | ) |
|
|
protectedvirtual |
◆ widgetMouseReleaseEvent()
| void QwtMagnifier::widgetMouseReleaseEvent |
( |
QMouseEvent * |
mouseEvent | ) |
|
|
protectedvirtual |
◆ widgetWheelEvent()
| void QwtMagnifier::widgetWheelEvent |
( |
QWheelEvent * |
wheelEvent | ) |
|
|
protectedvirtual |
Handle a wheel event for the observed widget.
- Parameters
-
- See also
- eventFilter()
The documentation for this class was generated from the following files:
- /home/runner/work/QWT/QWT/src/plot/qwt_magnifier.h
- /home/runner/work/QWT/QWT/src/plot/qwt_magnifier.cpp