Skip to main content

DataViewer::DataViewerInputHandler

DataViewer::DataViewerInputHandler

Handles mouse input events for the DataViewer widget. More…

#include <DataViewerInputHandler.hpp>

Inherits from QObject

Public Types

Name
using std::function< std::optional< std::pair< std::string, std::string > >(float, float)> SeriesInfoCallback
Set callback for series info lookup (used for hover display).
using std::function< float(float, std::string const &)> AnalogValueCallback
Set callback for analog value lookup (used for hover display).

Public Signals

Name
void panStarted()
void panDelta(float normalized_dy)
void panEnded()
void clicked(float time_coord, float canvas_y, QString const & series_info)
void hoverCoordinates(float time_coord, float canvas_y, QString const & series_info)
void entityClicked(EntityId entity_id, bool ctrl_pressed)
void entitySelectionCleared()
void intervalEdgeHovered(bool is_edge)
void intervalEdgeDragRequested(CorePlotting::HitTestResult const & hit_result)
void intervalCreationRequested(QString const & series_key, QPoint const & start_pos)
void cursorChangeRequested(Qt::CursorShape cursor)
void tooltipRequested(QPoint const & pos)
void tooltipCancelled()
void repaintRequested()

Public Functions

Name
DataViewerInputHandler(QWidget * parent =[nullptr])
~DataViewerInputHandler() override =default
void setContext(InputContext const & ctx)
Update the context used for coordinate transforms.
bool handleMousePress(QMouseEvent * event)
Process a mouse press event.
bool handleMouseMove(QMouseEvent * event)
Process a mouse move event.
bool handleMouseRelease(QMouseEvent * event)
Process a mouse release event.
bool handleDoubleClick(QMouseEvent * event)
Process a mouse double-click event.
void handleLeave()
Process a leave event (mouse exits widget).
bool isPanning() const
Check if panning is currently active.
void setInteractionActive(bool active)
Set whether an interaction is active (disables some input handling).
void setSeriesInfoCallback(SeriesInfoCallback callback)
void setAnalogValueCallback(AnalogValueCallback callback)

Detailed Description

class DataViewer::DataViewerInputHandler;

Handles mouse input events for the DataViewer widget.

This class processes raw Qt mouse events and translates them into semantic actions (pan, select, hover) that the parent widget can respond to.

Public Types Documentation

using SeriesInfoCallback

using DataViewer::DataViewerInputHandler::SeriesInfoCallback =  std::function<std::optional<std::pair<std::string, std::string>>(float, float)>;

Set callback for series info lookup (used for hover display).

using AnalogValueCallback

using DataViewer::DataViewerInputHandler::AnalogValueCallback =  std::function<float(float, std::string const &)>;

Set callback for analog value lookup (used for hover display).

Public Signals Documentation

signal panStarted

void panStarted()

signal panDelta

void panDelta(
    float normalized_dy
)

signal panEnded

void panEnded()

signal clicked

void clicked(
    float time_coord,
    float canvas_y,
    QString const & series_info
)

signal hoverCoordinates

void hoverCoordinates(
    float time_coord,
    float canvas_y,
    QString const & series_info
)

signal entityClicked

void entityClicked(
    EntityId entity_id,
    bool ctrl_pressed
)

signal entitySelectionCleared

void entitySelectionCleared()

signal intervalEdgeHovered

void intervalEdgeHovered(
    bool is_edge
)

signal intervalEdgeDragRequested

void intervalEdgeDragRequested(
    CorePlotting::HitTestResult const & hit_result
)

signal intervalCreationRequested

void intervalCreationRequested(
    QString const & series_key,
    QPoint const & start_pos
)

signal cursorChangeRequested

void cursorChangeRequested(
    Qt::CursorShape cursor
)

signal tooltipRequested

void tooltipRequested(
    QPoint const & pos
)

signal tooltipCancelled

void tooltipCancelled()

signal repaintRequested

void repaintRequested()

Public Functions Documentation

function DataViewerInputHandler

explicit DataViewerInputHandler(
    QWidget * parent =nullptr
)

function ~DataViewerInputHandler

~DataViewerInputHandler() override =default

function setContext

void setContext(
    InputContext const & ctx
)

Update the context used for coordinate transforms.

Parameters:

  • ctx Current context with view state, layout, and dimensions

function handleMousePress

bool handleMousePress(
    QMouseEvent * event
)

Process a mouse press event.

Parameters:

  • event The Qt mouse event

Return: true if the event was handled (should not propagate)

function handleMouseMove

bool handleMouseMove(
    QMouseEvent * event
)

Process a mouse move event.

Parameters:

  • event The Qt mouse event

Return: true if the event was handled

function handleMouseRelease

bool handleMouseRelease(
    QMouseEvent * event
)

Process a mouse release event.

Parameters:

  • event The Qt mouse event

Return: true if the event was handled

function handleDoubleClick

bool handleDoubleClick(
    QMouseEvent * event
)

Process a mouse double-click event.

Parameters:

  • event The Qt mouse event

Return: true if the event was handled

function handleLeave

void handleLeave()

Process a leave event (mouse exits widget).

function isPanning

inline bool isPanning() const

Check if panning is currently active.

function setInteractionActive

inline void setInteractionActive(
    bool active
)

Set whether an interaction is active (disables some input handling).

function setSeriesInfoCallback

inline void setSeriesInfoCallback(
    SeriesInfoCallback callback
)

function setAnalogValueCallback

inline void setAnalogValueCallback(
    AnalogValueCallback callback
)

Updated on 2026-11-13 at 20:25:42 +0000