Skip to content

Commit

Permalink
Merge pull request STORM-IRIT#848 from nmellado/propagate_mouse_events
Browse files Browse the repository at this point in the history
[Gui] Propage Mouse events using Qt signals
  • Loading branch information
nmellado authored Jan 14, 2022
2 parents 2bf340e + f374091 commit fab45d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Gui/Viewer/Viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,13 @@ void Viewer::mousePressEvent( QMouseEvent* event ) {
m_depthUnderMouse = result.getDepth();

handleMousePressEvent( event, result );
emit onMousePress( event );
emit needUpdate();
}

void Viewer::mouseReleaseEvent( QMouseEvent* event ) {
handleMouseReleaseEvent( event );
emit onMouseRelease( event );
emit needUpdate();
}

Expand All @@ -561,6 +563,7 @@ void Viewer::mouseMoveEvent( QMouseEvent* event ) {
m_depthUnderMouse = result.getDepth();

handleMouseMoveEvent( event, result );
emit onMouseMove( event );
emit needUpdate();
}

Expand Down
7 changes: 7 additions & 0 deletions src/Gui/Viewer/Viewer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ class RA_GUI_API Viewer : public WindowQt, public KeyMappingManageable<Viewer>

void needUpdate();

/// Event sent after a mouse press event has been processed, but before emitting needUpdate()
void onMousePress( QMouseEvent* event );
/// Event sent after a mouse release event has been processed, but before emitting needUpdate()
void onMouseRelease( QMouseEvent* event );
/// Event sent after a mouse move event has been processed, but before emitting needUpdate()
void onMouseMove( QMouseEvent* event );

public slots:
/// Tell the renderer to reload all shaders.
void reloadShaders();
Expand Down

0 comments on commit fab45d9

Please sign in to comment.