|
wiRedPanda
Logic Circuit Simulator
|
Extended QGraphicsView with enhanced navigation capabilities. More...
#include <GraphicsView.h>
Public Member Functions | |
| bool | canZoomIn () const |
Returns true if zooming in further is possible. | |
| bool | canZoomOut () const |
Returns true if zooming out further is possible. | |
| GraphicsView (QWidget *parent=nullptr) | |
| Constructs the view with optional parent. | |
| void | resetZoom () |
| Resets the view scale to 1:1. | |
| void | setFastMode (const bool fastMode) |
| Enables or disables fast rendering mode (disables antialiasing). | |
| void | zoomChanged () |
| Emitted whenever the zoom level changes. | |
| void | zoomIn () |
| Increases the view magnification by one zoom step. | |
| void | zoomOut () |
| Decreases the view magnification by one zoom step. | |
| void | zoomToFit () |
Protected Member Functions | |
| void | keyPressEvent (QKeyEvent *event) override |
| void | keyReleaseEvent (QKeyEvent *event) override |
| void | mouseMoveEvent (QMouseEvent *event) override |
| void | mousePressEvent (QMouseEvent *event) override |
| void | mouseReleaseEvent (QMouseEvent *event) override |
| void | paintEvent (QPaintEvent *event) override |
| void | wheelEvent (QWheelEvent *event) override |
Protected Attributes | |
| int | m_zoomLevel = 0 |
| Current zoom step (0 = 1:1, positive = zoomed in). | |
Extended QGraphicsView with enhanced navigation capabilities.
GraphicsView extends the QGraphicsView class to provide additional functionality for zooming, panning, and keyboard navigation. It includes signals to notify when zoom operations occur and supports redirect zoom mode for delegating zoom operations to parent components.
Definition at line 21 of file GraphicsView.h.
|
explicit |
Constructs the view with optional parent.
Definition at line 25 of file GraphicsView.cpp.
| bool GraphicsView::canZoomIn | ( | ) | const |
Returns true if zooming in further is possible.
Definition at line 65 of file GraphicsView.cpp.
References m_zoomLevel.
Referenced by wheelEvent().
| bool GraphicsView::canZoomOut | ( | ) | const |
Returns true if zooming out further is possible.
Definition at line 70 of file GraphicsView.cpp.
References m_zoomLevel.
Referenced by wheelEvent().
|
overrideprotected |
Definition at line 125 of file GraphicsView.cpp.
|
overrideprotected |
Definition at line 146 of file GraphicsView.cpp.
|
overrideprotected |
Definition at line 91 of file GraphicsView.cpp.
|
overrideprotected |
Definition at line 75 of file GraphicsView.cpp.
|
overrideprotected |
Definition at line 113 of file GraphicsView.cpp.
|
overrideprotected |
Definition at line 51 of file GraphicsView.cpp.
| void GraphicsView::resetZoom | ( | ) |
Resets the view scale to 1:1.
Definition at line 214 of file GraphicsView.cpp.
References m_zoomLevel, sentryBreadcrumb(), and zoomChanged().
| void GraphicsView::setFastMode | ( | const bool | fastMode | ) |
Enables or disables fast rendering mode (disables antialiasing).
| fastMode | true to use fast (non-antialiased) rendering. |
Definition at line 187 of file GraphicsView.cpp.
Referenced by MainWindow::setFastMode().
|
overrideprotected |
Definition at line 164 of file GraphicsView.cpp.
References canZoomIn(), canZoomOut(), zoomIn(), and zoomOut().
| void GraphicsView::zoomChanged | ( | ) |
Emitted whenever the zoom level changes.
Referenced by SceneUiBinder::bind(), MinimapWidget::MinimapWidget(), resetZoom(), SceneUiBinder::unbind(), WorkSpace::WorkSpace(), zoomIn(), zoomOut(), and zoomToFit().
| void GraphicsView::zoomIn | ( | ) |
Increases the view magnification by one zoom step.
Definition at line 196 of file GraphicsView.cpp.
References m_zoomLevel, sentryBreadcrumb(), and zoomChanged().
Referenced by wheelEvent().
| void GraphicsView::zoomOut | ( | ) |
Decreases the view magnification by one zoom step.
Definition at line 206 of file GraphicsView.cpp.
References m_zoomLevel, sentryBreadcrumb(), and zoomChanged().
Referenced by wheelEvent().
| void GraphicsView::zoomToFit | ( | ) |
Scales and centres the view so the whole circuit — or the current selection, if any — fits, snapping to the nearest discrete zoom step that still fits so the level ladder (canZoomIn()/zoomIn()/zoomOut()) stays consistent.
Definition at line 222 of file GraphicsView.cpp.
References m_zoomLevel, sentryBreadcrumb(), and zoomChanged().
|
protected |
Current zoom step (0 = 1:1, positive = zoomed in).
Definition at line 87 of file GraphicsView.h.
Referenced by canZoomIn(), canZoomOut(), resetZoom(), zoomIn(), zoomOut(), and zoomToFit().