From 7f09ce4f0f66aa61c2004ef9bd0dc2860134d50b Mon Sep 17 00:00:00 2001 From: Csaba Pinter Date: Thu, 15 Jun 2023 14:45:54 +0100 Subject: [PATCH] BUG: Fix interaction bug with laser pointer Without this fix, although the first button press worked on any child widget of the set GUI widget, after this first click, no other button reacted to the interaction. Now all the buttons in the GUI widget work as expected. Re KitwareMedical#43 --- GUIWidgets/qSlicerGUIWidgetsModuleWidget.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/GUIWidgets/qSlicerGUIWidgetsModuleWidget.cxx b/GUIWidgets/qSlicerGUIWidgetsModuleWidget.cxx index 3702d41..e03e3b8 100644 --- a/GUIWidgets/qSlicerGUIWidgetsModuleWidget.cxx +++ b/GUIWidgets/qSlicerGUIWidgetsModuleWidget.cxx @@ -338,7 +338,7 @@ void qSlicerGUIWidgetsModuleWidget::onStartInteractionButtonClicked() } else { - //std::cout << "No intersection was found... \n"; + //std::cout << "No intersection was found \n"; return; } @@ -386,13 +386,11 @@ void qSlicerGUIWidgetsModuleWidget::onStartInteractionButtonClicked() QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress); pressEvent.setScenePos(QPointF(xPositionPixels, yPositionPixels)); pressEvent.setButton(Qt::LeftButton); - pressEvent.setButtons(Qt::LeftButton); QApplication::sendEvent(texture->GetScene(), &pressEvent); // Send release event QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease); releaseEvent.setScenePos(QPointF(xPositionPixels, yPositionPixels)); releaseEvent.setButton(Qt::LeftButton); - releaseEvent.setButtons(Qt::LeftButton); QApplication::sendEvent(texture->GetScene(), &releaseEvent); }