SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
interactivechartview.h File Reference

Slice AT.2 — QChartView subclass with Select / Pan / ZoomIn / ZoomOut modes mirroring ProfilePlotDialog's QActionGroup pattern. More...

#include <QChartView>
#include <QDateTime>
#include <QPoint>
#include <QRect>
#include <QTimer>
Include dependency graph for interactivechartview.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  openswmmvis::ui::InteractiveChartView
 

Namespaces

namespace  openswmmvis
 
namespace  openswmmvis::ui
 

Detailed Description

Slice AT.2 — QChartView subclass with Select / Pan / ZoomIn / ZoomOut modes mirroring ProfilePlotDialog's QActionGroup pattern.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later

ComparisonPlotDialog uses Qt Charts for its chart rows. Qt Charts ships with a default rubber-band-zoom hook (setRubberBand) but the semantics are too narrow for our needs:

  • rubber-band only zooms IN; we want OUT too,
  • pan defaults to middle-button only / no left-button-pan mode,
  • no first-class concept of a "Select" mode that just passes events through for cursor read-out.

InteractiveChartView handles all four modes uniformly via overridden mouse events that drive QChart::scroll(dx, dy), QChart::zoomIn(rect), and QChart::zoomReset(). Wheel scroll is mode-agnostic — always zooms about the cursor.

The widget emits chartContextMenuRequested(globalPos) instead of popping its own menu so the dialog can build a row-aware context menu (Copy as Image / Reset Zoom / Hide Cursor / Remove Row / Options …).