#include <sectionpreviewwidget.h>
◆ SectionPreviewWidget()
| openswmmvis::sectionview::SectionPreviewWidget::SectionPreviewWidget |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
◆ achievedVerticalExaggeration()
| double openswmmvis::sectionview::SectionPreviewWidget::achievedVerticalExaggeration |
( |
| ) |
const |
|
inlinenoexcept |
V:H ratio used by the last paint — 1.0 for a true-scale or uniform-scale drawing. Reflects the automatic choice as well as an explicit one, so callers (and tests) never have to infer it from pixels. Valid only after something has been painted.
◆ lastFitRect()
| QRectF openswmmvis::sectionview::SectionPreviewWidget::lastFitRect |
( |
| ) |
const |
|
inlinenoexcept |
Pixel rect the model bounds were fitted into by the last paint, before zoom/pan. Exposed for tests and for any host that needs to relate widget coordinates back to the drawing.
◆ model()
◆ mouseDoubleClickEvent()
| void openswmmvis::sectionview::SectionPreviewWidget::mouseDoubleClickEvent |
( |
QMouseEvent * |
event | ) |
|
|
overrideprotected |
◆ mouseMoveEvent()
| void openswmmvis::sectionview::SectionPreviewWidget::mouseMoveEvent |
( |
QMouseEvent * |
event | ) |
|
|
overrideprotected |
◆ mousePressEvent()
| void openswmmvis::sectionview::SectionPreviewWidget::mousePressEvent |
( |
QMouseEvent * |
event | ) |
|
|
overrideprotected |
◆ mouseReleaseEvent()
| void openswmmvis::sectionview::SectionPreviewWidget::mouseReleaseEvent |
( |
QMouseEvent * |
event | ) |
|
|
overrideprotected |
◆ paintEvent()
| void openswmmvis::sectionview::SectionPreviewWidget::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
overrideprotected |
◆ renderToImage()
| QImage openswmmvis::sectionview::SectionPreviewWidget::renderToImage |
( |
const QSize & |
size | ) |
const |
Render the current model into an image — used by tests (offscreen) and by any future "copy diagram" action. Honours the current view.
◆ setModel()
Replace the drawing and repaint. Passing a default-constructed model clears the widget to its empty state.
Does NOT reset zoom/pan — see the note in the implementation. Call zoomToExtents() when the SUBJECT changes, not when its values do.
◆ setPlaceholderText()
| void openswmmvis::sectionview::SectionPreviewWidget::setPlaceholderText |
( |
const QString & |
text | ) |
|
Message shown when the model has nothing to draw and carries no emptyText of its own.
◆ setViewport()
| void openswmmvis::sectionview::SectionPreviewWidget::setViewport |
( |
const DiagramViewport & |
viewport | ) |
|
◆ viewport()
| const DiagramViewport & openswmmvis::sectionview::SectionPreviewWidget::viewport |
( |
| ) |
const |
|
inlinenoexcept |
◆ viewportChanged
| void openswmmvis::sectionview::SectionPreviewWidget::viewportChanged |
( |
const DiagramViewport & |
viewport | ) |
|
|
signal |
Emitted whenever zoom or pan changes, so a host can mirror the state (e.g. a zoom-percentage readout).
◆ wheelEvent()
| void openswmmvis::sectionview::SectionPreviewWidget::wheelEvent |
( |
QWheelEvent * |
event | ) |
|
|
overrideprotected |
◆ zoomBy()
| void openswmmvis::sectionview::SectionPreviewWidget::zoomBy |
( |
double |
factor, |
|
|
const QPointF & |
anchorPx |
|
) |
| |
Multiply the current zoom by factor, keeping the model point under anchorPx (widget coordinates) stationary.
◆ zoomToExtents()
| void openswmmvis::sectionview::SectionPreviewWidget::zoomToExtents |
( |
| ) |
|
Reset to the automatic fit. Invoked by middle double-click, and by hosts when the displayed object (not merely its values) changes.
The documentation for this class was generated from the following files: