Custom QGraphicsView for plugin functionality.
More...
#include <plugin_view.h>
|
| | PluginView (QWidget *parent=nullptr) |
| | Constructs a new PluginView object.
|
| QPointF | getCenter () const |
| | Gets the current center point of the view.
|
| qreal | getScale () const |
| | Gets the current scale factor of the view.
|
| void | setScale (qreal scale) |
| | Sets the scale factor of the view.
|
| void | zoom (float scaleFactor) |
| | Zooms in by a specified scale factor.
|
| void | centerOn (const QPointF &pos) |
| | Centers the view on a given position.
|
| void | centerOn (const QGraphicsItem *item) |
| | Centers the view on a given QGraphicsItem.
|
|
| void | keyPressEvent (QKeyEvent *) override |
| | Handles key press events.
|
| void | keyReleaseEvent (QKeyEvent *) override |
| | Handles key release events.
|
| void | mouseMoveEvent (QMouseEvent *) override |
| | Handles mouse move events.
|
| void | mousePressEvent (QMouseEvent *) override |
| | Handles mouse press events.
|
| void | mouseReleaseEvent (QMouseEvent *) override |
| | Handles mouse release events.
|
| void | wheelEvent (QWheelEvent *) override |
| | Handles wheel events.
|
|
| void | pan (QPointF delta) |
| | Determines which mouse button is used for panning.
|
|
void | zoomIn () |
| | Zooms in.
|
|
void | zoomOut () |
| | Zooms out.
|
|
void | resetZoom () |
| | Resets the view to its default scale.
|
| qreal | quantisedScale (qreal proposedScale) const |
| | Quantises a proposed scale factor to ensure it is within valid limits.
|
|
void | setMaxSize () |
| | Sets the maximum size of the view's scene rect.
|
|
|
bool | mDoMousePanning |
| | Flag to determine if mouse panning should be done.
|
| bool | mDoKeyZoom |
| | Determines whether mouse panning is enabled.
|
| QPoint | mLastMousePos |
| | Determines whether key-based zooming is enabled.
|
| QPointF | mCenterPoint |
| | Stores the last mouse position for panning.
|
| qreal | mPanSpeed |
| | Keeps track of the current center point of the view.
|
| qreal | mZoomDelta |
| | Controls the speed of the panning action.
|
| Qt::Key | mZoomKey |
| | Defines the increment or decrement in zoom level.
|
| qreal | mMinZoom |
| | Specifies the key that triggers zoom actions.
|
| qreal | mMaxZoom |
| | Sets the lower limit for the zoom factor.
|
| Qt::MouseButton | mPanButton |
| | Sets the upper limit for the zoom factor.
|
Custom QGraphicsView for plugin functionality.
◆ PluginView()
| PluginView::PluginView |
( |
QWidget * | parent = nullptr | ) |
|
Constructs a new PluginView object.
- Parameters
-
| parent | Pointer to the parent widget. |
◆ centerOn() [1/2]
| void PluginView::centerOn |
( |
const QGraphicsItem * | item | ) |
|
Centers the view on a given QGraphicsItem.
- Parameters
-
| item | The QGraphicsItem to center on. |
◆ centerOn() [2/2]
| void PluginView::centerOn |
( |
const QPointF & | pos | ) |
|
Centers the view on a given position.
- Parameters
-
| pos | The position to center on. |
◆ getCenter()
| QPointF PluginView::getCenter |
( |
| ) |
const |
Gets the current center point of the view.
- Returns
- QPointF The current center point.
◆ getScale()
| qreal PluginView::getScale |
( |
| ) |
const |
Gets the current scale factor of the view.
- Returns
- qreal The current scale factor.
◆ keyPressEvent()
| void PluginView::keyPressEvent |
( |
QKeyEvent * | event | ) |
|
|
overrideprotected |
Handles key press events.
- Parameters
-
| event | Pointer to the QKeyEvent object. |
◆ keyReleaseEvent()
| void PluginView::keyReleaseEvent |
( |
QKeyEvent * | event | ) |
|
|
overrideprotected |
Handles key release events.
- Parameters
-
| event | Pointer to the QKeyEvent object. |
◆ mouseMoveEvent()
| void PluginView::mouseMoveEvent |
( |
QMouseEvent * | event | ) |
|
|
overrideprotected |
Handles mouse move events.
- Parameters
-
| event | Pointer to the QMouseEvent object. |
◆ mousePressEvent()
| void PluginView::mousePressEvent |
( |
QMouseEvent * | event | ) |
|
|
overrideprotected |
Handles mouse press events.
- Parameters
-
| event | Pointer to the QMouseEvent object. |
◆ mouseReleaseEvent()
| void PluginView::mouseReleaseEvent |
( |
QMouseEvent * | event | ) |
|
|
overrideprotected |
Handles mouse release events.
- Parameters
-
| event | Pointer to the QMouseEvent object. |
◆ pan()
| void PluginView::pan |
( |
QPointF | delta | ) |
|
|
private |
Determines which mouse button is used for panning.
Pans the view by a given delta.
- Parameters
-
| delta | The delta to pan by. |
◆ quantisedScale()
| qreal PluginView::quantisedScale |
( |
qreal | proposedScale | ) |
const |
|
private |
Quantises a proposed scale factor to ensure it is within valid limits.
- Parameters
-
| proposedScale | The proposed scale factor. |
- Returns
- qreal The quantised scale factor.
◆ setScale()
| void PluginView::setScale |
( |
qreal | scale | ) |
|
Sets the scale factor of the view.
- Parameters
-
| scale | The new scale factor. |
◆ wheelEvent()
| void PluginView::wheelEvent |
( |
QWheelEvent * | event | ) |
|
|
overrideprotected |
Handles wheel events.
- Parameters
-
| event | Pointer to the QWheelEvent object. |
◆ zoom()
| void PluginView::zoom |
( |
float | scaleFactor | ) |
|
Zooms in by a specified scale factor.
- Parameters
-
| scaleFactor | The zoom scale factor. |
◆ mCenterPoint
| QPointF PluginView::mCenterPoint |
|
private |
Stores the last mouse position for panning.
Current center point of the view.
◆ mDoKeyZoom
| bool PluginView::mDoKeyZoom |
|
private |
Determines whether mouse panning is enabled.
Flag to determine if key zooming should be done.
◆ mLastMousePos
| QPoint PluginView::mLastMousePos |
|
private |
Determines whether key-based zooming is enabled.
Last known mouse position during panning.
◆ mMaxZoom
| qreal PluginView::mMaxZoom |
|
private |
Sets the lower limit for the zoom factor.
Maximum allowed zoom level.
◆ mMinZoom
| qreal PluginView::mMinZoom |
|
private |
Specifies the key that triggers zoom actions.
Minimum allowed zoom level.
◆ mPanButton
| Qt::MouseButton PluginView::mPanButton |
|
private |
Sets the upper limit for the zoom factor.
Mouse button used for panning.
◆ mPanSpeed
| qreal PluginView::mPanSpeed |
|
private |
Keeps track of the current center point of the view.
Speed at which the view pans.
◆ mZoomDelta
| qreal PluginView::mZoomDelta |
|
private |
Controls the speed of the panning action.
Delta value for zooming.
◆ mZoomKey
| Qt::Key PluginView::mZoomKey |
|
private |
Defines the increment or decrement in zoom level.
Key used for zooming.
The documentation for this class was generated from the following files:
- /__w/maki/maki/app/system/plugin_view.h
- /__w/maki/maki/app/system/plugin_view.cpp